:root {
  --bg: #070b16;
  --bg-2: #0d1424;
  --panel: rgba(20, 28, 46, 0.72);
  --panel-solid: #141c2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef2f9;
  --muted: #93a1bd;
  --muted-2: #64708c;
  --brand: #5b7cfa;
  --brand-2: #7c5cfc;
  --accent: #22d3ee;
  --ok: #22c55e;
  --err: #f43f5e;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 600px at 12% -10%, rgba(91, 124, 250, 0.28), transparent 60%),
    radial-gradient(800px 600px at 100% 0%, rgba(124, 92, 252, 0.22), transparent 55%),
    radial-gradient(700px 700px at 50% 120%, rgba(34, 211, 238, 0.12), transparent 60%);
  z-index: -1;
  pointer-events: none;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────── */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 0 22px; }

/* ── Nav ─────────────────────────────────────────────────── */
nav.top {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 22, 0.72);
  border-bottom: 1px solid var(--border);
}
nav.top .inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-size: 15px;
  box-shadow: 0 6px 18px -6px var(--brand);
}
.nav-links { display: flex; gap: 8px; align-items: center; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-family: inherit; font-size: 15px; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 18px; cursor: pointer;
  transition: transform .12s ease, background .2s, border-color .2s, opacity .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; box-shadow: 0 10px 26px -10px var(--brand);
}
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.btn-block { width: 100%; padding: 13px 18px; font-size: 16px; }

/* ── Cards / panels ──────────────────────────────────────── */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.card-pad { padding: 30px; }

/* ── Forms ───────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.input {
  width: 100%; font-family: inherit; font-size: 15px;
  padding: 13px 15px; color: var(--text);
  background: rgba(8, 12, 22, 0.7);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .18s, box-shadow .18s;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91,124,250,.18); }
.input::placeholder { color: var(--muted-2); }
.hint { font-size: 12px; color: var(--muted-2); margin-top: 6px; }
.field-ok .input { border-color: rgba(34,197,94,.6); }
.field-err .input { border-color: rgba(244,63,94,.7); }
.err-msg { color: var(--err); font-size: 12px; margin-top: 6px; min-height: 14px; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; margin-bottom: 16px; display: none; }
.alert.show { display: block; }
.alert-err { background: rgba(244,63,94,.12); border: 1px solid rgba(244,63,94,.35); color: #fecdd3; }
.alert-ok { background: rgba(34,197,94,.12); border: 1px solid rgba(34,197,94,.35); color: #bbf7d0; }
.alert-info { background: rgba(91,124,250,.12); border: 1px solid rgba(91,124,250,.35); color: #c7d2fe; }

/* ── Captcha ─────────────────────────────────────────────── */
.captcha-box {
  background: rgba(8,12,22,.55);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.captcha-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 11px; gap: 10px; }
.captcha-prompt { font-size: 13.5px; font-weight: 600; color: var(--text); }
.captcha-count { font-size: 12px; color: var(--muted); }
.captcha-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.tile {
  background: rgba(20,28,46,.9);
  border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 6px;
  cursor: pointer; text-align: center;
  transition: border-color .15s, background .15s, transform .1s;
  user-select: none;
}
.tile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tile .emoji { font-size: 26px; line-height: 1; display: block; margin-bottom: 6px; }
.tile .name { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.tile.sel { border-color: var(--brand); background: rgba(91,124,250,.16); }
.tile.sel .name { color: var(--text); }
.tile.correct { border-color: var(--ok); background: rgba(34,197,94,.14); }
.tile.wrong { border-color: var(--err); background: rgba(244,63,94,.14); }
.captcha-refresh {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 12px; font-family: inherit; display: inline-flex; align-items: center; gap: 5px;
}
.captcha-refresh:hover { color: var(--text); }

/* ── PIN inputs ──────────────────────────────────────────── */
.pin-row { display: flex; gap: 9px; justify-content: center; margin: 6px 0 4px; }

/* Password fields */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 66px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  font-size: 12.5px; font-weight: 600; padding: 6px 8px; border-radius: 8px;
}
.pw-toggle:hover { color: var(--text); background: rgba(255,255,255,.05); }
.pw-meter { height: 4px; border-radius: 3px; background: var(--border-strong); margin-top: 9px; overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 8%; border-radius: 3px; transition: width .2s, background .2s; background: var(--err); }
.pw-meter[data-score="2"] span { background: #f59e0b; }
.pw-meter[data-score="3"] span { background: #22c55e; }
.pw-meter[data-score="4"] span { background: #16a34a; }
.pin-input {
  width: 48px; height: 58px; text-align: center;
  font-size: 24px; font-weight: 700; font-family: 'JetBrains Mono', monospace;
  color: var(--text); background: rgba(8,12,22,.7);
  border: 1.5px solid var(--border-strong); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.pin-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91,124,250,.18); }
.pin-input.filled { border-color: var(--brand); }

/* ── Landing hero ────────────────────────────────────────── */
.hero { padding: 74px 0 46px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 44px; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--accent);
  background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.28);
  padding: 6px 13px; border-radius: 999px; margin-bottom: 22px;
}
.hero h1 { font-size: 47px; line-height: 1.08; letter-spacing: -0.03em; font-weight: 800; margin-bottom: 18px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--brand), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lead { font-size: 17.5px; color: var(--muted); margin-bottom: 30px; max-width: 540px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-side { display: grid; gap: 12px; }
.stage-mini {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--border);
}
.stage-mini .num {
  width: 38px; height: 38px; flex: none; border-radius: 11px;
  display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg, rgba(91,124,250,.25), rgba(124,92,252,.2));
  color: var(--brand);
}
.stage-mini .t { font-weight: 700; font-size: 15px; }
.stage-mini .d { font-size: 12.5px; color: var(--muted); }

.feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 30px 0 70px; }
.feat { padding: 22px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); }
.feat .ico { font-size: 22px; margin-bottom: 10px; }
.feat h3 { font-size: 15.5px; margin-bottom: 6px; }
.feat p { font-size: 13.5px; color: var(--muted); }

/* ── Four ikigai pillars ─────────────────────────────────── */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 34px 0 20px; }
.pillar {
  padding: 24px 22px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  border: 1px solid var(--border); transition: transform .15s, border-color .15s;
}
.pillar:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.pillar .ico { font-size: 26px; margin-bottom: 14px; line-height: 1; }
.pillar h3 { font-size: 16.5px; margin-bottom: 8px; letter-spacing: -0.01em; }
.pillar p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.cta-band {
  text-align: center; margin: 40px 0 70px; padding: 44px 28px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(91,124,250,.12), rgba(34,211,238,.08));
  border: 1px solid var(--border-strong);
}
.cta-band h2 { font-size: 30px; letter-spacing: -0.02em; margin-bottom: 12px; }
.cta-band p { color: var(--muted); font-size: 15.5px; max-width: 620px; margin: 0 auto 24px; }

/* ── Auth page ───────────────────────────────────────────── */
.auth-shell { display: grid; place-items: center; min-height: 100vh; padding: 40px 0 60px; }
.auth-card { width: 100%; max-width: 460px; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h2 { font-size: 26px; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-head p { color: var(--muted); font-size: 14.5px; }
.switch-line { text-align: center; font-size: 14px; color: var(--muted); margin-top: 20px; }
.progress-steps { display: flex; gap: 8px; justify-content: center; margin-bottom: 22px; }
.step-dot { width: 34px; height: 4px; border-radius: 3px; background: var(--border-strong); }
.step-dot.active { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

/* ── Dashboard ───────────────────────────────────────────── */
.dash-head { padding: 36px 0 10px; }
.dash-head h1 { font-size: 30px; letter-spacing: -0.02em; }
.dash-head p { color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.stat { padding: 22px; border-radius: 14px; background: var(--panel); border: 1px solid var(--border); }
.stat .k { font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .v { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }
.stage-list { display: grid; gap: 12px; margin-top: 8px; }
.stage-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-radius: 13px; background: var(--panel); border: 1px solid var(--border);
}
.stage-row .l { display: flex; align-items: center; gap: 13px; }
.pill { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pill.done { background: rgba(34,197,94,.15); color: #86efac; }
.pill.todo { background: rgba(148,163,184,.15); color: var(--muted); }
.bar { height: 8px; border-radius: 5px; background: var(--border); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); }

.skeleton { color: var(--muted); text-align: center; padding: 40px; }
.spinner {
  width: 22px; height: 22px; border: 2.5px solid var(--border-strong);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero h1 { font-size: 36px; }
  .feats { grid-template-columns: 1fr; }
  .pillars { grid-template-columns: 1fr 1fr; }
  .cta-band h2 { font-size: 24px; }
  .stat-grid { grid-template-columns: 1fr; }
  .pin-input { width: 42px; height: 52px; font-size: 21px; }
}
