/* ============================================================
   QuestCore — central identity hub.
   Family DNA (warm dark, gold serif) + a cool periwinkle accent
   for the "keycard / system" identity feel. Mobile-first.
   ============================================================ */
:root {
  --bg:        #131217;
  --bg-2:      #1a1922;
  --panel:     #1f1d29;
  --panel-2:   #282534;
  --line:      #38344a;
  --ink:       #ece8f2;
  --ink-dim:   #c3bdd0;
  --muted:     #8f899f;
  --gold:      #e0b856;
  --gold-soft: #f2d492;
  --accent:    #8f9bf2;   /* periwinkle — identity */
  --accent-soft:#bcc4f8;
  --good:      #74c98a;
  --bad:       #e88a78;
  --radius:    16px;
  --radius-sm: 11px;
  --shadow:    0 14px 38px rgba(0,0,0,.5);
  --serif: "Iowan Old Style","Palatino Linotype",Palatino,Georgia,"Times New Roman",serif;
  --sans:  -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --maxw: 980px;
  --fs: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 720px at 50% -12%, #262138 0%, transparent 60%),
    radial-gradient(760px 520px at 88% 6%, rgba(143,155,242,.07) 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--gold); color: #201a08; }
.skip-link { position: absolute; left: -9999px; background: var(--gold); color: #201a08; padding: 8px 14px; }
.skip-link:focus { left: 8px; top: 8px; z-index: 99; border-radius: 8px; }

/* ---- App bar ---- */
.appbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(11px, env(safe-area-inset-top)) clamp(16px,5vw,28px) 11px;
  background: rgba(19,18,23,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-glyph { display: inline-flex; color: var(--gold); }
.brand-glyph svg { width: 26px; height: 26px; display: block; filter: drop-shadow(0 0 9px rgba(224,184,86,.45)); }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.brand-name .thin { color: var(--accent-soft); font-weight: 600; }
.appbar-actions { display: flex; align-items: center; gap: 8px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: 15px;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #211903; border-color: transparent;
  box-shadow: 0 6px 18px rgba(224,184,86,.25);
}
.btn-primary:hover { filter: brightness(1.05); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: transparent; }
.btn-danger:hover { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }

/* ---- Centered auth layout ---- */
.auth-wrap { max-width: 520px; margin: 0 auto; padding: clamp(24px,6vw,52px) 18px 48px; }
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: clamp(22px,5vw,32px);
}
.card + .card { margin-top: 16px; }
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { font-size: clamp(26px,6vw,34px); }
.auth-head p { color: var(--ink-dim); margin: 8px 0 0; }

/* ---- Forms ---- */
.field { margin-bottom: 16px; }
.field > label { display: block; font-size: 14px; font-weight: 600; color: var(--ink-dim); margin-bottom: 7px; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date], select, textarea {
  width: 100%; background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: inherit; font-size: 15px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(143,155,242,.18); }
input::placeholder { color: var(--muted); }
input[type=text].mono, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .12em; }

/* checkbox / multi-select pills */
.pillset { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink-dim);
  padding: 8px 13px; border-radius: 999px; font-size: 14px; user-select: none;
}
.pill input { position: absolute; opacity: 0; width: 0; height: 0; }
.pill:hover { border-color: var(--accent); }
.pill.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg-2)); color: var(--ink); }

/* choice cards (path / role) */
.choices { display: grid; gap: 12px; }
@media (min-width: 480px) { .choices.two { grid-template-columns: 1fr 1fr; } }
.choice {
  text-align: left; border: 1px solid var(--line); background: var(--panel);
  border-radius: var(--radius); padding: 18px; display: flex; gap: 14px; align-items: flex-start;
  transition: transform .12s ease, border-color .15s ease;
}
.choice:hover { transform: translateY(-2px); border-color: var(--accent); }
.choice .ico { font-size: 26px; line-height: 1; margin-top: 2px; }
.choice h3 { font-size: 17px; }
.choice p { margin: 4px 0 0; color: var(--ink-dim); font-size: 13.5px; }

/* ---- Steps / progress ---- */
.steps { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 18px; }
.steps .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.steps .dot.on { background: var(--gold); }
.steps .dot.done { background: var(--accent); }
.step { display: none; }
.step.active { display: block; }

/* ---- 2FA panel ---- */
.qr-box { background: #fff; border-radius: 12px; padding: 12px; width: max-content; margin: 0 auto 14px; }
.qr-box svg { display: block; width: 200px; height: 200px; }
.secret {
  text-align: center; font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .18em; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px; word-break: break-all; font-size: 14px; color: var(--gold-soft);
}
.backup-codes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px;
  background: var(--bg-2); border: 1px dashed var(--line); border-radius: 10px; padding: 14px;
}
.otp-input { text-align: center; font-size: 26px; letter-spacing: .5em; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* ---- Alerts ---- */
.alert { border-radius: var(--radius-sm); padding: 11px 14px; font-size: 14px; margin-bottom: 14px; border: 1px solid; }
.alert.err { color: #ffd9cf; background: color-mix(in srgb, var(--bad) 16%, transparent); border-color: color-mix(in srgb, var(--bad) 45%, var(--line)); }
.alert.ok  { color: #d6f2df; background: color-mix(in srgb, var(--good) 15%, transparent); border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.alert.info{ color: var(--accent-soft); background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mt { margin-top: 16px; }
.sm { font-size: 13.5px; }
.validity { font-size: 13px; margin-top: 7px; min-height: 18px; }
.validity.ok { color: var(--good); }
.validity.bad { color: var(--bad); }

/* ---- Landing hero ---- */
.hero { max-width: var(--maxw); margin: 0 auto; padding: clamp(40px,9vw,84px) 20px 40px; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent-soft); background: rgba(143,155,242,.09);
  border: 1px solid rgba(143,155,242,.26); padding: 6px 13px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(36px,8.5vw,62px); letter-spacing: -.5px; }
.hero h1 .thin { color: var(--gold); }
.hero .lede { max-width: 40ch; margin: 16px auto 0; color: var(--ink-dim); font-size: clamp(16px,3.4vw,19px); }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.features { max-width: var(--maxw); margin: 8px auto 0; padding: 0 20px 60px; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.feature .ico { font-size: 24px; }
.feature h3 { font-size: 16px; margin: 10px 0 5px; }
.feature p { margin: 0; color: var(--ink-dim); font-size: 14px; }

/* ---- Dashboard ---- */
.dash { max-width: var(--maxw); margin: 0 auto; padding: clamp(20px,5vw,36px) clamp(16px,5vw,28px) 60px; }
.dash-head { margin-bottom: 22px; }
.dash-head h1 { font-size: clamp(24px,5vw,32px); }
.dash-head .sub { color: var(--ink-dim); margin-top: 6px; }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); margin-bottom: 20px; }
.stat { background: linear-gradient(180deg,var(--panel-2),var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .num { font-family: var(--serif); font-size: 30px; font-weight: 700; color: var(--gold-soft); }
.stat .lbl { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px,4vw,22px); margin-bottom: 16px; }
.panel h2 { font-size: 18px; margin-bottom: 12px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb,var(--accent) 18%,var(--bg-2)); color: var(--accent-soft); border: 1px solid color-mix(in srgb,var(--accent) 35%,var(--line)); }
.badge.gold { background: color-mix(in srgb,var(--gold) 18%,var(--bg-2)); color: var(--gold-soft); border-color: color-mix(in srgb,var(--gold) 35%,var(--line)); }
table.grid-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid-table th, table.grid-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.grid-table th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.code-chip { font-family: ui-monospace,Menlo,Consolas,monospace; letter-spacing: .12em; background: var(--bg-2); border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; color: var(--gold-soft); }
.app-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); }
.app-tile { display: flex; flex-direction: column; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.app-tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); transition: transform .12s; }
.app-tile .ico { font-size: 22px; }
.app-tile .nm { font-weight: 700; color: var(--ink); font-size: 14px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
