/* ============================================================
   AccessKit dashboard — self-contained design system.
   No external stylesheet or font CDN required to render correctly
   (a webfont is progressively applied if it loads).
   ============================================================ */

:root {
  --bg: #0a0c10;
  --surface: #12151b;
  --surface2: #171b22;
  --surface3: #1d222b;
  --border: rgba(255,255,255,0.09);
  --text: #f2f3f5;
  --text-sec: #a7adba;
  --text-hint: #767c8a;
  --accent: #6366f1;
  --accent-light: #8b8cf7;
  --accent-hover: #4f46e5;
  --on-accent: #ffffff;
  --green: #4ade80;
  --red: #f87171;
  --blue: #60a5fa;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 40px rgba(0,0,0,0.45);
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface2: #f1f2f5;
    --surface3: #e9eaee;
    --border: rgba(15,18,26,0.10);
    --text: #16181d;
    --text-sec: #4a505c;
    --text-hint: #767c8a;
    --shadow: 0 18px 40px rgba(35,40,48,0.16);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-light); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ── Header ─────────────────────────────────────────────── */
.header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 20px;
}
.logo-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.05rem; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  display: flex; align-items: center; justify-content: center; font-size: 16px; color: #fff;
}
.logo-brand:hover { text-decoration: none; }
.nav { display: flex; gap: 22px; font-size: 0.9rem; font-weight: 600; }
.nav a { color: var(--text-sec); }
.nav a.active, .nav a:hover { color: var(--text); text-decoration: none; }
.header-auth { display: flex; align-items: center; gap: 10px; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  appearance: none; border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; font-size: 0.88rem;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface2); }
.btn-sm { padding: 7px 13px; font-size: 0.82rem; }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #ef4444; }

/* ── Hero / marketing ───────────────────────────────────── */
.hero { padding: 76px 0 56px; text-align: center; }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 16px; letter-spacing: -0.02em; }
.hero p { color: var(--text-sec); font-size: 1.08rem; max-width: 620px; margin: 0 auto 32px; }
.hero-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin: 56px 0;
}
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}
.feature-card .fc-icon { font-size: 1.5rem; margin-bottom: 10px; }
.feature-card h3 { margin: 0 0 6px; font-size: 1rem; }
.feature-card p { margin: 0; color: var(--text-sec); font-size: 0.88rem; }

.steps { counter-reset: step; display: grid; gap: 14px; max-width: 640px; margin: 32px auto; }
.step { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.step-num {
  counter-increment: step; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center;
}
.step h4 { margin: 0 0 4px; font-size: 0.95rem; }
.step p, .step pre { margin: 4px 0 0; color: var(--text-sec); font-size: 0.85rem; }

footer.site-footer { border-top: 1px solid var(--border); padding: 26px 0; color: var(--text-hint); font-size: 0.82rem; text-align: center; }

/* ── Dashboard shell ────────────────────────────────────── */
.dashboard-wrap { max-width: 900px; margin: 0 auto; padding: 32px 20px 80px; }
.db-topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.db-title { font-size: 1.3rem; font-weight: 800; }

.auth-gate {
  text-align: center; padding: 80px 20px; max-width: 420px; margin: 0 auto;
}
.auth-gate-icon { font-size: 2.4rem; margin-bottom: 12px; }
.auth-gate h2 { margin: 0 0 8px; }
.auth-gate p { color: var(--text-sec); margin: 0 0 24px; }
.auth-gate-btns { display: flex; gap: 10px; justify-content: center; }

/* ── Cards / settings ───────────────────────────────────── */
.settings-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin-bottom: 18px;
}
.settings-section-title { font-weight: 800; font-size: 1rem; margin-bottom: 6px; }
.settings-group { margin-bottom: 18px; }
.settings-group:last-child { margin-bottom: 0; }
.settings-label { display: block; font-weight: 700; font-size: 0.82rem; margin-bottom: 7px; text-transform: uppercase; letter-spacing: .02em; color: var(--text-sec); }
.settings-input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; font-size: 0.9rem;
}
.settings-input:focus { border-color: var(--accent-light); }
.save-btn {
  width: 100%; background: var(--accent); color: #fff; border: none; cursor: pointer;
  padding: 13px; border-radius: var(--radius-sm); font-weight: 800; font-size: 0.95rem;
}
.save-btn:hover { background: var(--accent-hover); }
.save-btn:disabled { opacity: .6; cursor: not-allowed; }

.wt-col { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-hint); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; margin-left: 6px; }
.wt-hint { font-size: 11px; color: var(--text-hint); margin-top: 5px; line-height: 1.5; }
.wt-color-row { display: flex; gap: 8px; align-items: center; }
.wt-swatch { width: 48px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface2); cursor: pointer; padding: 2px; flex: none; }
.wt-hex { max-width: 140px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: uppercase; }
.wt-err { font-size: 11px; color: var(--red); margin-top: 5px; display: none; }
.ak-slider-row { display: flex; align-items: center; }

/* ── Embed / domain cards ───────────────────────────────── */
.embed-box {
  background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  color: var(--text); overflow-x: auto; white-space: pre; position: relative;
}
.copy-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.client-id-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
}

.domain-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.domain-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 8px 6px 14px; font-size: 0.85rem;
}
.domain-chip button {
  appearance: none; border: none; background: transparent; color: var(--text-hint);
  cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 6px; border-radius: 50%;
}
.domain-chip button:hover { background: var(--surface3); color: var(--red); }
.domain-add-row { display: flex; gap: 8px; }
.domain-add-row .settings-input { flex: 1; }
.empty-hint { color: var(--text-hint); font-size: 0.85rem; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.status-pill.active { background: rgba(74,222,128,0.14); color: var(--green); }
.status-pill.inactive, .status-pill.suspended { background: rgba(248,113,113,0.14); color: var(--red); }

/* ── User menu ──────────────────────────────────────────── */
.user-menu-wrap { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px 5px 5px; cursor: pointer; color: var(--text); font: inherit;
}
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none;
}
.user-avatar-lg { width: 40px; height: 40px; font-size: 14px; }
.user-menu-name { font-size: 0.85rem; font-weight: 600; }
.user-caret { font-size: 10px; color: var(--text-hint); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 8px; z-index: 30;
}
.user-dropdown-header { display: flex; gap: 10px; align-items: center; padding: 8px; }
.user-dropdown-name { font-weight: 700; font-size: 0.9rem; }
.user-dropdown-email { font-size: 0.78rem; color: var(--text-sec); }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 8px 0; }
.user-dropdown-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none; cursor: pointer;
  color: var(--text); font: inherit; font-size: 0.85rem; padding: 9px 8px; border-radius: 8px;
}
.user-dropdown-item:hover { background: var(--surface2); text-decoration: none; }
.user-dropdown-logout { color: var(--red); }

/* ── Auth modal ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5,6,9,0.6); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .15s ease; z-index: 100; padding: 16px;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); width: 100%; max-width: 380px; padding: 26px; position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px; background: transparent; border: none; cursor: pointer;
  color: var(--text-hint); font-size: 20px; line-height: 1; padding: 4px;
}
.modal-close:hover { color: var(--text); }
.modal-tabs { display: flex; gap: 4px; background: var(--surface2); border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.modal-tab { flex: 1; background: transparent; border: none; cursor: pointer; padding: 8px; border-radius: 8px; font: inherit; font-weight: 700; font-size: 0.82rem; color: var(--text-sec); }
.modal-tab.active { background: var(--surface); color: var(--text); }
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--text-sec); margin-bottom: 6px; }
.form-field input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; font-size: 0.9rem;
}
.form-field input:focus { border-color: var(--accent-light); }
.modal-btn-full {
  width: 100%; background: var(--accent); color: #fff; border: none; cursor: pointer;
  padding: 12px; border-radius: var(--radius-sm); font-weight: 800; font-size: 0.9rem; margin-top: 4px;
}
.modal-btn-full:hover { background: var(--accent-hover); }
.modal-btn-full:disabled { opacity: .6; cursor: not-allowed; }
.modal-error, .modal-success { display: none; font-size: 0.82rem; border-radius: 8px; padding: 9px 11px; margin-bottom: 14px; }
.modal-error { background: rgba(248,113,113,0.12); color: var(--red); }
.modal-success { background: rgba(74,222,128,0.12); color: var(--green); }
.modal-footer-link { text-align: center; margin-top: 14px; font-size: 0.82rem; }
.modal-footer-link a { cursor: pointer; }

/* ── Live preview stage (widget mock) ───────────────────── */
.wt-pv-tab {}

@media (max-width: 640px) {
  .header-inner { height: auto; padding: 12px 0; flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; justify-content: center; }
}
