/* FABULOUS AI — black & white, clean, rounded */

@font-face {
  font-family: "Geist";
  src: url("../fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f6;
  --bg-sunken: #efefef;
  --fg: #0a0a0a;
  --fg-2: #3d3d3d;
  --muted: #7a7a7a;
  --line: #e9e9e9;
  --line-strong: #d6d6d6;
  --inverse-bg: #0a0a0a;
  --inverse-fg: #ffffff;
  --focus: rgba(10, 10, 10, .14);
  --danger: #c81e1e;
  --danger-soft: #fdf0f0;
  --success: #0f7a3d;

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px -12px rgba(0,0,0,.08);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0a;
    --bg-soft: #141414;
    --bg-sunken: #1c1c1c;
    --fg: #f5f5f5;
    --fg-2: #c9c9c9;
    --muted: #8c8c8c;
    --line: #232323;
    --line-strong: #333333;
    --inverse-bg: #ffffff;
    --inverse-fg: #0a0a0a;
    --focus: rgba(255, 255, 255, .18);
    --danger: #ff6b6b;
    --danger-soft: #2a1414;
    --success: #4ade80;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}
a { color: inherit; }
img, svg { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 22px; height: 22px; }

/* ---- Buttons ---------------------------------------------------------------- */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: var(--r);
  border: 1px solid transparent;
  font: inherit; font-weight: 550; font-size: 14.5px;
  text-decoration: none; white-space: nowrap;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .05s, opacity .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.btn-primary { background: var(--inverse-bg); color: var(--inverse-fg); }
.btn-primary:hover { opacity: .86; }
.btn-secondary { background: var(--bg); color: var(--fg); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--bg-soft); }
.btn-ghost { background: transparent; color: var(--fg-2); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--fg); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: .88; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.link { color: var(--fg); font-weight: 550; text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.link:hover { border-color: var(--fg); }
.link-muted { color: var(--muted); text-decoration: none; font-size: 13.5px; }
.link-muted:hover { color: var(--fg); }

/* ---- Forms ------------------------------------------------------------------ */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.label { font-size: 13.5px; font-weight: 550; color: var(--fg); }
.hint { font-size: 12.5px; color: var(--muted); }
.input {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--bg); color: var(--fg);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: var(--muted); }
.input:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 4px var(--focus); }
.input[readonly] { background: var(--bg-soft); color: var(--fg-2); }
.input.has-error { border-color: var(--danger); }
.input-code { height: 60px; text-align: center; font-family: var(--mono); font-size: 26px; letter-spacing: .45em; padding-left: .45em; }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-wrap .reveal {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
}
.input-wrap .reveal:hover { color: var(--fg); background: var(--bg-soft); }
.error-text { font-size: 12.5px; color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--fg-2); cursor: pointer; }
.check input {
  appearance: none; flex: none; margin: 1px 0 0;
  width: 18px; height: 18px; border-radius: 6px;
  border: 1.5px solid var(--line-strong); background: var(--bg);
  display: grid; place-items: center; cursor: pointer;
}
.check input:checked { background: var(--inverse-bg); border-color: var(--inverse-bg); }
.check input:checked::after {
  content: ""; width: 9px; height: 5px; margin-top: -2px;
  border: 2px solid var(--inverse-fg); border-top: 0; border-right: 0; transform: rotate(-45deg);
}
.check input:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }

/* ---- Flash ------------------------------------------------------------------- */
.flashes { display: grid; gap: 10px; margin-bottom: 22px; }
.flash {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r);
  font-size: 14px; border: 1px solid var(--line);
  background: var(--bg-soft);
}
.flash .icon { margin-top: 2px; }
.flash-success { background: var(--inverse-bg); color: var(--inverse-fg); border-color: var(--inverse-bg); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: transparent; }

/* ---- Brand ------------------------------------------------------------------ */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .08em; font-size: 13px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--inverse-bg); color: var(--inverse-fg);
  display: grid; place-items: center;
}
.brand-mark svg { width: 16px; height: 16px; fill: currentColor; }
.brand-name b { font-weight: 800; }
.brand-name span { font-weight: 450; opacity: .55; margin-left: 4px; }

/* ---- Auth layout -------------------------------------------------------------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside {
  position: relative; overflow: hidden;
  margin: 12px; border-radius: var(--r-xl);
  background: #0a0a0a; color: #fff;
  padding: 40px; display: flex; flex-direction: column; justify-content: space-between;
}
@media (prefers-color-scheme: dark) { .auth-aside { background: #141414; border: 1px solid var(--line); } }
.auth-aside .brand-mark { background: #fff; color: #0a0a0a; }
.auth-aside .grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 70%);
}
.auth-aside .orb {
  position: absolute; right: -120px; top: -120px; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.22), rgba(255,255,255,0) 62%);
  filter: blur(4px);
}
.auth-aside > * { position: relative; }
.auth-claim { font-size: clamp(34px, 4.2vw, 58px); font-weight: 650; letter-spacing: -0.045em; line-height: 1.02; max-width: 12ch; }
.auth-claim em { font-style: normal; color: rgba(255,255,255,.42); }
.auth-sub { margin-top: 18px; max-width: 40ch; color: rgba(255,255,255,.6); font-size: 15px; }
.auth-foot { font-size: 12.5px; color: rgba(255,255,255,.4); display: flex; justify-content: space-between; }
.auth-main { display: flex; flex-direction: column; padding: 28px 24px; }
.auth-main .brand { display: none; }
.auth-card { width: 100%; max-width: 400px; margin: auto; padding: 24px 0; }
.auth-head { margin-bottom: 28px; }
.auth-head h1 { font-size: 28px; font-weight: 650; }
.auth-head p { margin-top: 8px; color: var(--muted); }
.auth-alt { margin-top: 26px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-badge {
  width: 52px; height: 52px; border-radius: 16px; margin-bottom: 22px;
  display: grid; place-items: center; background: var(--bg-soft); border: 1px solid var(--line);
}
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; margin: 6px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main .brand { display: inline-flex; }
}

/* ---- App layout ------------------------------------------------------------------ */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 14px; border-right: 1px solid var(--line); background: var(--bg);
}
.sidebar .brand { padding: 4px 10px 22px; }
.nav { display: grid; gap: 2px; }
.nav-label { padding: 14px 12px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nav a {
  display: flex; align-items: center; gap: 12px;
  height: 42px; padding: 0 12px; border-radius: var(--r);
  text-decoration: none; color: var(--fg-2); font-weight: 500; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg-soft); color: var(--fg); }
.nav a.active { background: var(--inverse-bg); color: var(--inverse-fg); }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-soft);
}
.avatar {
  width: 36px; height: 36px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--inverse-bg); color: var(--inverse-fg);
  font-size: 13px; font-weight: 650; letter-spacing: .02em;
}
.avatar-xl { width: 64px; height: 64px; border-radius: 20px; font-size: 22px; }
.user-meta { min-width: 0; flex: 1; }
.user-meta b { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  width: 34px; height: 34px; flex: none; border: 0; border-radius: var(--r-sm);
  display: grid; place-items: center; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--fg); }

.topbar { display: none; }
.main { min-width: 0; padding: 40px clamp(20px, 4vw, 56px) 64px; }
.container { max-width: 1080px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 32px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 650; }
.page-head p { margin-top: 8px; color: var(--muted); max-width: 60ch; }
.eyebrow { font-size: 12.5px; font-weight: 550; color: var(--muted); margin-bottom: 8px; display: block; }

.scrim { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 280px;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.35); }
  .topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between;
    height: 60px; padding: 0 16px;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .main { padding: 28px 16px 56px; }
  .page-head h1 { font-size: 26px; }
}

/* ---- Cards ------------------------------------------------------------------------- */
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.card-head h2 { font-size: 17px; font-weight: 600; }
.card-head p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.card-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.card-inverse { background: var(--inverse-bg); color: var(--inverse-fg); border-color: var(--inverse-bg); }
.card-inverse .muted { color: color-mix(in srgb, var(--inverse-fg) 60%, transparent); }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-2, .grid-main { grid-template-columns: 1fr; } }

.stat { display: grid; gap: 18px; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.stat-icon { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--bg-soft); color: var(--fg); }
.stat-value { font-size: 34px; font-weight: 650; letter-spacing: -0.04em; line-height: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--bg-soft); color: var(--fg-2); border: 1px solid var(--line);
}
.badge-solid { background: var(--inverse-bg); color: var(--inverse-fg); border-color: var(--inverse-bg); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { color: var(--success); }

/* checklist */
.steps { display: grid; gap: 4px; }
.step {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; margin: 0 -12px; border-radius: var(--r);
  text-decoration: none; color: inherit;
}
a.step:hover { background: var(--bg-soft); }
.step-dot {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px dashed var(--line-strong); color: var(--muted);
}
.step.done .step-dot { background: var(--inverse-bg); color: var(--inverse-fg); border: 0; }
.step.done .step-title { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.step-dot .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.step-title { font-weight: 550; font-size: 14.5px; }
.step-sub { font-size: 13px; color: var(--muted); }
.step .chev { margin-left: auto; color: var(--muted); }

.progress { height: 6px; border-radius: 99px; background: var(--bg-sunken); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--fg); border-radius: inherit; }
.w-0 { width: 0; } .w-25 { width: 25%; } .w-50 { width: 50%; } .w-75 { width: 75%; } .w-100 { width: 100%; }

/* empty state */
.empty {
  display: grid; place-items: center; text-align: center; gap: 8px;
  padding: 64px 24px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--bg-soft) 70%, transparent) 14px 15px);
}
.empty-icon {
  width: 60px; height: 60px; border-radius: 18px; margin-bottom: 10px;
  display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.empty h3 { font-size: 18px; font-weight: 600; }
.empty p { color: var(--muted); max-width: 42ch; font-size: 14.5px; }
.empty .btn { margin-top: 14px; }

/* ---- Settings ---------------------------------------------------------------------- */
.tabs {
  display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 28px;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.tabs a {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-sm);
  text-decoration: none; font-size: 14px; font-weight: 550; color: var(--muted); white-space: nowrap;
}
.tabs a:hover { color: var(--fg); }
.tabs a.active { background: var(--bg); color: var(--fg); box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 0 0 1px var(--line); }
.tabs .icon { width: 16px; height: 16px; }

.settings-narrow { max-width: 720px; }
.form-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile-head b { font-size: 18px; font-weight: 600; display: block; }

.option-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .option-grid { grid-template-columns: 1fr; } }
.option {
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--bg-soft);
}
.option-icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); }
.option h3 { font-size: 15.5px; font-weight: 600; }
.option p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.option form { margin-top: auto; }
.option .tag { font-size: 11.5px; font-weight: 600; color: var(--muted); }

.status-row { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--bg-soft); border: 1px solid var(--line); }
.status-row .option-icon { flex: none; }
.status-row b { display: block; font-weight: 600; }

.setup { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 640px) { .setup { grid-template-columns: 1fr; } }
.qr { width: 200px; aspect-ratio: 1; padding: 14px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); }
.qr svg { width: 100%; height: 100%; }
.secret {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 10px 10px 14px; border-radius: var(--r); background: var(--bg-soft); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 13px; word-break: break-all;
}
.step-num { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--inverse-bg); color: var(--inverse-fg); font-size: 12px; font-weight: 700; margin-right: 8px; }
.setup-step + .setup-step { margin-top: 22px; }
.setup-step h3 { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; margin-bottom: 10px; }

.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.codes code {
  padding: 10px 12px; border-radius: var(--r-sm); text-align: center;
  background: color-mix(in srgb, var(--inverse-fg) 10%, transparent);
  font-family: var(--mono); font-size: 14px; letter-spacing: .06em;
}

details.disclose { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; }
details.disclose summary {
  list-style: none; cursor: pointer; padding: 12px 0;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 550; font-size: 14.5px;
}
details.disclose summary::-webkit-details-marker { display: none; }
details.disclose summary .icon { color: var(--muted); transition: transform .2s; }
details.disclose[open] summary .icon { transform: rotate(180deg); }
details.disclose .form { padding: 4px 0 8px; }

.list { display: grid; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; padding-bottom: 0; }
.list-row:first-child { padding-top: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row b { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.list-row span.muted { font-size: 13px; }

.inline-form { display: inline; }
.stack-sm > * + * { margin-top: 6px; }
.mt-2 { margin-top: 8px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.center { text-align: center; }

/* error page */
.error-code { font-size: 96px; font-weight: 700; letter-spacing: -0.06em; line-height: 1; margin-bottom: 16px; }
