:root {
  --bg: #0a0a0b;
  --card: #121315;
  --card-2: #17191b;
  --line: rgba(255,255,255,0.09);
  --text: #fafafa;
  --text-2: #b8b6b0;
  --text-3: #8a8984;
  --accent: #6EE7B7;
  --accent-ink: #04140d;
  --danger: #ff8a8a;
  --warn: #F2C063;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(60% 40% at 80% 0%, rgba(110,231,183,0.08), transparent 60%), var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.noscript { text-align: center; padding: 24px; color: var(--text-2); }

/* Header / footer */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px max(16px, env(safe-area-inset-left)); max-width: 980px; width: 100%; margin: 0 auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 18px; border-radius: 5px; background: linear-gradient(180deg, #B7F5DA 0 30%, var(--accent) 30%); box-shadow: 0 0 18px rgba(110,231,183,0.35); }
.top-nav { display: flex; gap: 8px; align-items: center; }
.main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 12px 16px 40px; display: flex; flex-direction: column; align-items: center; }
.foot { text-align: center; font-size: 12px; color: var(--text-3); padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }

/* Cards & text */
.card { width: 100%; max-width: 440px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 28px 26px; box-shadow: 0 30px 80px -40px rgba(0,0,0,0.8); }
.card + .card { margin-top: 14px; }
.card-wide { max-width: 640px; }
.card-center { display: flex; justify-content: center; padding: 48px; }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; margin-bottom: 6px; }
h2 { font-size: 15px; margin-bottom: 10px; }
.lede { color: var(--text-2); margin-bottom: 22px; }
.muted { color: var(--text-3); font-size: 13px; }
.eyebrow { font: 800 10px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.section { padding: 20px 0; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; padding-top: 4px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input { width: 100%; padding: 12px 14px; border-radius: 11px; border: 1px solid var(--line); background: var(--card-2); color: var(--text); font: 15px var(--font); outline: none; transition: border-color .15s, box-shadow .15s; }
.field input:focus { border-color: rgba(110,231,183,0.55); box-shadow: 0 0 0 3px rgba(110,231,183,0.14); }
.field input[aria-invalid="true"] { border-color: rgba(255,138,138,0.6); }
.field .hint { font-size: 12px; color: var(--text-3); }
.field .hint.ok { color: var(--accent); }
.field .hint.bad { color: var(--danger); }
.code-input { font: 600 24px var(--mono) !important; letter-spacing: 0.4em; text-align: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,0.05); color: var(--text); font: 650 14px var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { background: rgba(255,255,255,0.1); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { background: #8AEEC6; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.btn-block { width: 100%; }
.links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: 13px; }
.alert { padding: 11px 13px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; }
.alert-error { background: rgba(255,138,138,0.1); border: 1px solid rgba(255,138,138,0.3); color: #ffc2c2; }
.alert-ok { background: rgba(110,231,183,0.08); border: 1px solid rgba(110,231,183,0.3); color: #c8f7e3; }
.alert-warn { background: rgba(242,192,99,0.08); border: 1px solid rgba(242,192,99,0.3); color: #f6dca7; }
.meter { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--danger); transition: width .2s, background .2s; }
.meter i.s2 { background: var(--warn); }
.meter i.s3, .meter i.s4 { background: var(--accent); }

/* 2FA setup */
.steps { display: grid; gap: 16px; }
.step-n { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; background: rgba(110,231,183,0.15); color: var(--accent); font: 700 12px var(--mono); margin-right: 8px; }
.qr { display: block; width: 196px; height: 196px; margin: 4px auto; padding: 10px; background: #fff; border-radius: 12px; }
.secret { font: 600 13px var(--mono); letter-spacing: 0.08em; word-break: break-all; padding: 10px 12px; border-radius: 10px; background: var(--card-2); border: 1px dashed var(--line); text-align: center; user-select: all; }

/* Landing + apps */
.hero { text-align: center; max-width: 620px; margin: 28px auto 26px; }
.hero h1 { font-size: clamp(30px, 6vw, 44px); margin-bottom: 10px; }
.hero .lede { font-size: 16px; }
.hero-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; width: 100%; max-width: 640px; }
.app-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); color: var(--text); transition: border-color .15s, transform .15s; }
.app-card:hover { border-color: rgba(110,231,183,0.45); transform: translateY(-2px); text-decoration: none; }
.app-icon { font-size: 26px; }
.app-name { font-weight: 700; font-size: 17px; }
.app-desc { color: var(--text-2); font-size: 13.5px; }
.app-host { color: var(--text-3); font: 12px var(--mono); margin-top: 4px; }

/* Lists (factors) */
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); }
.item-title { font-weight: 600; }
.item-sub { font-size: 12px; color: var(--text-3); }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,0.15); border-top-color: var(--accent); animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
.btn .spinner { width: 14px; height: 14px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } .app-card { transition: none; } }
@media (max-width: 480px) { .card { padding: 22px 18px; border-radius: 18px; } }
