/* Hindsight website. Same tokens as the desktop app (docs/mockups):
   neutral surfaces, one amber accent, thin icons, Segoe UI Variable. */
:root {
  --bg: #0F1012; --side: #141518; --card: #17181B; --card-2: #1C1D21; --line: #26272C; --line-2: #303137;
  --text: #ECECEF; --text-2: #A1A2AA; --text-3: #6E7078; --ctrl: #1F2024; --ctrl-hover: #26272C; --sel: #22232A;
  --accent: #F0A33A; --accent-hover: #F4B257; --on-accent: #1A1206; --accent-text: #F0A33A; --accent-soft: rgba(240, 163, 58, .12);
  --live: #4CC38A; --live-soft: rgba(76, 195, 138, .12); --danger: #E5534B; --danger-soft: rgba(229, 83, 75, .12);
  --warn: #E2B341; --warn-soft: rgba(226, 179, 65, .12);
  --shadow: 0 8px 24px rgba(0, 0, 0, .35), 0 1px 2px rgba(0, 0, 0, .3);
  --r: 8px; --r-lg: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #F7F7F8; --side: #EFEFF1; --card: #FFFFFF; --card-2: #F9F9FA; --line: #E3E3E7; --line-2: #D6D6DB;
    --text: #16171A; --text-2: #5D5F67; --text-3: #8A8C94; --ctrl: #F2F2F4; --ctrl-hover: #E9E9EC; --sel: #E9E9EC;
    --accent: #E8952B; --accent-hover: #DA8820; --on-accent: #1A1206; --accent-text: #B36A0E; --accent-soft: rgba(232, 149, 43, .14);
    --live: #1F9D64; --live-soft: rgba(31, 157, 100, .12); --danger: #C93C35; --danger-soft: rgba(201, 60, 53, .10);
    --warn: #A87A0B; --warn-soft: rgba(168, 122, 11, .12);
    --shadow: 0 8px 24px rgba(20, 20, 30, .10), 0 1px 2px rgba(20, 20, 30, .08);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; margin: 0; }
p { margin: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; vertical-align: middle; }
svg.i.sm { width: 16px; height: 16px; }
svg.i.lg { width: 22px; height: 22px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- top bar */
.top {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 24px;
  padding: 0 max(16px, calc((100vw - 1120px) / 2)); background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid transparent; transition: border-color .2s var(--ease);
}
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand img { width: 24px; height: 24px; }
.top nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.top nav a.link { color: var(--text-2); padding: 6px 10px; border-radius: 6px; transition: color .15s, background .15s; }
.top nav a.link:hover { color: var(--text); background: var(--ctrl); text-decoration: none; }

/* ---------------------------------------------------------------- buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px;
  border-radius: var(--r); border: 1px solid var(--line-2); background: var(--ctrl); color: var(--text);
  font: 500 13.5px var(--font); cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease), opacity .15s;
}
.btn:hover { background: var(--ctrl-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--ctrl); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn.block { width: 100%; }
.btn.icon { width: 32px; padding: 0; height: 32px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field .hint { font-size: 12.5px; color: var(--text-3); }
.field .err { font-size: 12.5px; color: var(--danger); min-height: 0; }
.input, select.input, textarea.input {
  width: 100%; height: 38px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--ctrl); color: var(--text); font: 14px var(--font); outline: none;
  transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: color-mix(in srgb, var(--text-3) 60%, var(--line-2)); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--card); }
.input.bad { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.input.code { font-family: var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.input.otp { font-family: var(--mono); font-size: 22px; letter-spacing: .4em; text-align: center; height: 50px; }
.pw { position: relative; }
.pw .input { padding-right: 44px; }
.pw button { position: absolute; right: 4px; top: 4px; height: 30px; width: 36px; border: 0; background: transparent; color: var(--text-3); border-radius: 6px; cursor: pointer; font: 12px var(--font); }
.pw button:hover { color: var(--text); background: var(--ctrl-hover); }
.check-row { display: flex; gap: 10px; align-items: center; color: var(--text-2); font-size: 13px; }

/* ---------------------------------------------------------------- pills, dots, tags */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--ctrl); color: var(--text-2); white-space: nowrap; }
.pill.live { background: var(--live-soft); color: var(--live); }
.pill.accent { background: var(--accent-soft); color: var(--accent-text); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; display: inline-block; }
.dot.live { background: var(--live); box-shadow: 0 0 0 3px var(--live-soft); }
.dot.live.beat { animation: beat 2s var(--ease) infinite; }
@keyframes beat { 50% { box-shadow: 0 0 0 5px transparent; } }
.dot.danger { background: var(--danger); }
.dot.warn { background: var(--warn); }
kbd { font: 12px var(--mono); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--line-2); background: var(--ctrl); color: var(--text); }

/* ---------------------------------------------------------------- cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card.pad { padding: 20px; }
.card h2 { font-size: 16px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 15px; }
.card-head .sub { color: var(--text-2); font-size: 13px; }
.card-head .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-body { padding: 20px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--ctrl); border: 1px solid var(--line); color: var(--text-2); font-size: 13.5px; }
.notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--text); }
.notice.danger svg { color: var(--danger); }
.notice.accent { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); }
.notice.accent svg { color: var(--accent-text); }
.notice.ok { background: var(--live-soft); border-color: color-mix(in srgb, var(--live) 35%, transparent); color: var(--text); }
.notice.ok svg { color: var(--live); }

/* ---------------------------------------------------------------- auth pages */
.auth-wrap { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 32px 16px 80px; }
.auth {
  width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 32px; box-shadow: var(--shadow); animation: rise .35s var(--ease) both;
}
.auth .mark { width: 40px; height: 40px; margin-bottom: 20px; }
.auth h1 { font-size: 24px; margin-bottom: 6px; }
.auth .lead { color: var(--text-2); margin-bottom: 24px; }
.auth form { display: grid; gap: 16px; }
.auth .foot { margin-top: 20px; text-align: center; color: var(--text-2); font-size: 13.5px; }
.auth .form-err { display: none; }
.auth .form-err.show { display: flex; animation: rise .2s var(--ease) both; }
.step { animation: rise .25s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.reqs { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; color: var(--text-3); }
.reqs li { display: flex; gap: 6px; align-items: center; transition: color .15s; }
.reqs li svg { width: 14px; height: 14px; opacity: .35; transition: opacity .15s; }
.reqs li.ok { color: var(--live); }
.reqs li.ok svg { opacity: 1; }
.meter { height: 4px; border-radius: 2px; background: var(--ctrl-hover); overflow: hidden; margin-top: 2px; }
.meter > i { display: block; height: 100%; width: 0; background: var(--danger); border-radius: 2px; transition: width .25s var(--ease), background .25s; }

/* ---------------------------------------------------------------- landing */
.page { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; padding: 72px 0 56px; }
.hero h1 { font-size: clamp(34px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -.025em; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero .lead { margin-top: 18px; font-size: 16.5px; color: var(--text-2); max-width: 30em; }
.hero .cta { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.hero .small { margin-top: 14px; font-size: 13px; color: var(--text-3); }
.shot { border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--side); box-shadow: var(--shadow); overflow: hidden; animation: rise .5s var(--ease) .1s both; }
.shot .bar { height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); background: var(--side); }
.shot .bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); }
.shot .bar span { margin-left: 6px; font-size: 12px; color: var(--text-3); }
.shot img { display: block; width: 100%; height: auto; }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 16px 0 64px; }
.feature { padding: 20px; }
.feature .ico { width: 36px; height: 36px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; margin-bottom: 14px; }
.feature h3 { font-size: 15px; margin-bottom: 6px; }
.feature p { color: var(--text-2); font-size: 13.5px; }
.band { display: flex; align-items: center; gap: 24px; padding: 28px; margin-bottom: 72px; }
.band h2 { font-size: 20px; }
.band p { color: var(--text-2); margin-top: 4px; }
.band .end { margin-left: auto; display: flex; gap: 10px; }
.foot-bar { border-top: 1px solid var(--line); padding: 24px 16px 40px; text-align: center; color: var(--text-3); font-size: 13px; }
.foot-bar a { color: var(--text-2); }

/* ---------------------------------------------------------------- account */
.acct { max-width: 920px; margin: 0 auto; padding: 32px 16px 80px; display: grid; gap: 20px; }
.acct-head { display: flex; align-items: center; gap: 16px; }
.avatar { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; font: 600 20px var(--font-display); flex: none; }
.acct-head h1 { font-size: 24px; }
.acct-head .end { margin-left: auto; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dl { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card-2); transition: border-color .15s, transform .15s var(--ease); color: var(--text); }
.dl:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.dl .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; flex: none; }
.dl b { display: block; font-weight: 600; }
.dl span { color: var(--text-2); font-size: 13px; }
.rows { display: grid; grid-template-columns: minmax(0, 1fr); }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .ico { width: 36px; height: 36px; border-radius: 9px; background: var(--ctrl); color: var(--text-2); display: grid; place-items: center; flex: none; }
.row .main { min-width: 0; flex: 1; }
.row .main b { font-weight: 600; }
.row .main .meta { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .end { display: flex; gap: 8px; align-items: center; }
.row.enter { animation: rise .25s var(--ease) both; }
.row.leaving { opacity: 0; transform: translateX(8px); transition: opacity .2s, transform .2s var(--ease); }
.form-grid { display: grid; gap: 14px; max-width: 420px; }
.totp-setup { display: grid; grid-template-columns: 180px 1fr; gap: 20px; align-items: start; }
.totp-setup img { width: 180px; height: 180px; border-radius: 10px; background: #fff; padding: 6px; }
.secret { font: 13px var(--mono); padding: 8px 10px; border-radius: 6px; background: var(--ctrl); border: 1px solid var(--line); word-break: break-all; }
.empty { padding: 28px 20px; text-align: center; color: var(--text-3); }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13.5px; animation: rise .25s var(--ease) both; }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s var(--ease); }
.toast svg { margin-top: 1px; }
.toast.ok svg { color: var(--live); }
.toast.bad svg { color: var(--danger); }

/* ---------------------------------------------------------------- modal */
.scrim { position: fixed; inset: 0; background: rgba(8, 8, 10, .55); display: grid; place-items: center; z-index: 60; padding: 16px; animation: fade .15s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px; display: grid; gap: 14px; animation: rise .2s var(--ease) both; }
.modal h2 { font-size: 18px; }
.modal .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; gap: 32px; }
  .features { grid-template-columns: 1fr 1fr; }
  .band { flex-direction: column; align-items: flex-start; }
  .band .end { margin-left: 0; }
  .totp-setup { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .features, .dl-grid { grid-template-columns: 1fr; }
  .auth { padding: 24px 20px; }
  .top nav a.link.opt { display: none; }
}
