/* CirEdge Portal — modern fintech light theme (payx.gg inspired) */

:root {
  /* Backgrounds */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --bg-elev-2: #f0f1f4;
  --bg-strong: #ffffff;

  /* Borders */
  --border: #e8e8eb;
  --border-strong: #d4d4d8;

  /* Text */
  --text: #0a0a0a;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --text-on-accent: #ffffff;

  /* Accent — modern violet/indigo */
  --accent: #5b5bd6;
  --accent-hover: #4f46e5;
  --accent-soft: rgba(91, 91, 214, 0.08);
  --accent-gradient: linear-gradient(135deg, #5b5bd6 0%, #8b5cf6 100%);

  /* Semantic */
  --success: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Radii */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* Fonts */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.07), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 12px 16px -4px rgba(16, 24, 40, 0.08), 0 4px 6px -2px rgba(16, 24, 40, 0.03);
  --shadow: var(--shadow-sm);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  font-size: 14px;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Sticky footer: body flex column min 100vh, content flex 1 → footer hep altta */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.content { flex: 1 0 auto; }
.footer { flex-shrink: 0; }

a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-hover); }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.mono { font-family: var(--font-mono); }
code { font-family: var(--font-mono); background: var(--surface-2); padding: 2px 6px; border-radius: 4px; font-size: 12px; color: var(--text); }

h1, h2, h3, h4 { letter-spacing: -0.02em; font-weight: 600; color: var(--text); }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }

/* Lucide icon helper */
.icon { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 20px; height: 20px; }
[data-lucide] { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; vertical-align: middle; }

/* Numbered step circle (used in downloads SmartScreen guide etc.) */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-gradient);
  color: white;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(91, 91, 214, 0.25);
}

/* Topbar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--text); font-size: 15px;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-gradient);
  color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(91, 91, 214, 0.3);
}
.brand-mark [data-lucide] { width: 16px; height: 16px; stroke-width: 2.5; color: white; }
.brand-name { font-weight: 700; }
.brand-tag { color: var(--text-muted); font-size: 11px; font-weight: 500; margin-left: 4px; letter-spacing: 0; text-transform: lowercase; padding: 2px 7px; background: var(--surface-2); border-radius: 4px; }
nav { display: flex; align-items: center; gap: 18px; }
.nav-link { color: var(--text-muted); font-size: 13px; font-weight: 500; transition: color .15s ease; display: inline-flex; align-items: center; gap: 6px; }
.nav-link:hover { color: var(--text); }
.nav-link [data-lucide] { width: 14px; height: 14px; stroke-width: 2; }
.btn [data-lucide] { width: 14px; height: 14px; stroke-width: 2; }
.link-btn { background: none; border: none; padding: 0; color: var(--text-muted); cursor: pointer; font: inherit; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { color: var(--text); }
.link-btn [data-lucide] { width: 14px; height: 14px; stroke-width: 2; }

.lang-link {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: background .12s ease, border-color .12s ease;
}
.lang-link:hover { background: var(--surface-3, var(--surface-2)); border-color: var(--accent); }
.flag-icon { width: 22px; height: 14px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,0.1); display: block; }
.footer {
  text-align: center; padding: 24px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
}

/* Layout */
.content {
  max-width: 1100px; margin: 0 auto;
  padding: 32px 28px 60px;
}
.footer {
  text-align: center; padding: 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* Hero / landing */
.hero {
  text-align: center;
  padding: 96px 20px 64px;
  max-width: 880px;
  margin: 0 auto;
}
.hero-eyebrow {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
}
.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.65;
}
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.cta-row .btn { padding: 12px 22px; font-size: 14px; }
.cta-row .btn-primary { font-weight: 600; }

.hero-trust { margin-top: 36px; }
.trust-row {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 12px;
}
.trust-chip {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 60px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}
.feature {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: transform .2s ease, box-shadow .2s ease;
}
.feature:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.feature-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 12px;
  margin-bottom: 18px;
}
.feature-icon [data-lucide] { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.55; }

/* Auth card */
.auth-card {
  max-width: 420px; margin: 80px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}
.auth-card h2 { margin: 0 0 8px; font-size: 22px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.auth-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.auth-card input {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; color: var(--text); font: inherit;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.auth-card input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px; font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
  transition: all .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-primary {
  background: var(--accent-gradient);
  color: var(--text-on-accent);
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(91, 91, 214, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: var(--text-on-accent);
  border-color: transparent;
  box-shadow: 0 4px 10px rgba(91, 91, 214, 0.25);
}
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); box-shadow: none; }
.btn-danger:hover { background: rgba(239,68,68,.08); border-color: var(--danger); color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); border-color: transparent; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-top: 18px;
  box-shadow: var(--shadow-xs);
}
.card h2 { margin: 0 0 14px; }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px; font-size: 13px; font-weight: 500; }
.alert [data-lucide] { flex-shrink: 0; margin-top: 1px; }
.alert-error { background: rgba(239,68,68,.08); color: var(--danger); border: 1px solid rgba(239,68,68,.18); }
.alert-info { background: rgba(59,130,246,.08); color: var(--info); border: 1px solid rgba(59,130,246,.18); }
.alert-success { background: rgba(16,185,129,.08); color: var(--success); border: 1px solid rgba(16,185,129,.18); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon {
  width: 56px; height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-muted);
  border-radius: 50%; margin-bottom: 16px;
}
.empty-icon [data-lucide] { width: 26px; height: 26px; }
.empty-state h3 { font-size: 16px; margin: 0 0 6px; color: var(--text); }

/* Modal — Alpine.js driven */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h2 { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; }
.modal-body {
  padding: 22px 24px 24px;
}
.modal-body form { display: flex; flex-direction: column; gap: 14px; }
.modal-body label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--text-muted); font-weight: 500;
}
.modal-body input, .modal-body select, .modal-body textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  color: var(--text);
  font: inherit;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.modal-body input:focus, .modal-body select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.modal-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 8px;
}
.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
  flex-shrink: 0;
}
.btn-icon:hover { background: var(--surface-2); color: var(--text); }

/* Alpine.js transitions (sade fade+scale) */
[x-cloak] { display: none !important; }
.modal-overlay[style*="display: none"] { display: none !important; }
form label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--text-muted); }
form input, form select, form textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 10px; color: var(--text); font: inherit;
}
form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Dashboard */
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.dash-head h1 { margin: 0 0 4px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }

/* Device cards */
.device-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-top: 18px;
}
.device-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-faint);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.device-card:has(.badge-ok) { border-left-color: var(--success); }
.device-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.device-name { font-weight: 700; font-size: 16px; }
.device-slug { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.device-body dl { display: grid; grid-template-columns: 100px 1fr; gap: 4px 12px; margin: 8px 0; font-size: 12px; }
.device-body dt { color: var(--text-muted); }
.device-body dd { margin: 0; }
.device-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-muted);
  font-size: 11px; font-weight: 600;
  border: 1px solid var(--border);
}
.badge-ok { color: var(--success); border-color: rgba(16,185,129,.25); background: rgba(16,185,129,.08); }
.badge-warn { color: var(--warn); border-color: rgba(245,158,11,.25); background: rgba(245,158,11,.08); }
.badge-err { color: var(--danger); border-color: rgba(239,68,68,.25); background: rgba(239,68,68,.08); }
.badge-idle { color: var(--text-muted); }

/* Device cards — fintech card style */
.device-card {
  border-left: none !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
.device-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* Enrollment kod listesi */
.code-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 8px; }
.code-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.big-code {
  font-family: var(--font-mono); font-size: 22px; font-weight: 700;
  color: var(--accent);
  background: var(--bg-elev-2); padding: 6px 14px;
  border-radius: var(--radius-sm); letter-spacing: 4px;
}
.cmd-block {
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-mono); font-size: 12px;
  overflow-x: auto;
  margin-top: 8px;
}

/* Device detail strip — tek satır kompakt durum */
.device-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.strip-item {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 140px;
  flex: 1 1 140px;
  position: relative;
  box-shadow: var(--shadow-xs);
}
.strip-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 4px;
}
.strip-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.strip-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.strip-btn:hover:not(:disabled) { background: var(--bg-elev-2); color: var(--text); }
.strip-btn:disabled { opacity: .3; cursor: not-allowed; }
