:root {
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --accent: #0891b2;
  --accent2: #0f766e;
  --bg: #f0f9ff;
  --navy: #0f172a;
  --card: #ffffff;
  --gradient1: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0891b2 100%);
  --gradient2: linear-gradient(135deg, #0891b2 0%, #0f766e 100%);
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; margin: 0; }

body {
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; font-weight: 600; }
a:hover { color: var(--accent2); }

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 64px;
  background: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,.08);
  position: sticky; top: 0; z-index: 100;
}
.brand {
  font-weight: 800; font-size: 20px; color: #fff; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 8px;
}
.brand-logo { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.brand-sub { font-weight: 400; font-size: 11px; color: #22d3ee; letter-spacing: 1px; text-transform: uppercase; }

nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
nav a { color: #94a3b8; padding: 8px 14px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all .15s; }
nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
nav form { display: inline; }
nav button { border: 0; border-radius: 8px; padding: 8px 14px; font-weight: 600; font-size: 14px; cursor: pointer; color: #94a3b8; background: transparent; transition: all .15s; }
nav button:hover { color: #fff; background: rgba(255,255,255,.08); }

.button {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 12px 24px;
  font-weight: 700; font-size: 15px; cursor: pointer;
  background: var(--gradient2); color: #fff;
  box-shadow: 0 2px 8px rgba(8,145,178,.25);
  transition: all .2s;
  text-decoration: none;
}
.button:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(8,145,178,.35); color: #fff; }
.button.ghost { background: transparent; color: var(--accent); box-shadow: none; border: 1.5px solid var(--accent); }
.button.ghost:hover { background: var(--accent); color: #fff; }
.button.large { padding: 16px 36px; font-size: 17px; border-radius: 14px; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  min-height: 80vh; display: flex; align-items: center; justify-content: center;
  background: var(--gradient1); color: #fff; padding: 80px 32px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 800px 500px at 80% 20%, rgba(8,145,178,.15), transparent),
              radial-gradient(ellipse 600px 400px at 20% 80%, rgba(15,118,110,.1), transparent);
  pointer-events: none;
}
.hero-content { max-width: 720px; text-align: center; position: relative; z-index: 1; }
.hero-logo { width: 96px; height: 96px; object-fit: contain; margin: 0 auto 16px; display: block; }
.hero-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; color: #22d3ee; margin-bottom: 20px; }
.hero h1 { font-size: 64px; font-weight: 900; line-height: 1.05; letter-spacing: -1.5px; margin-bottom: 20px; }
.hero h1 span { background: linear-gradient(135deg, #22d3ee, #5eead4); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 19px; line-height: 1.7; color: #cbd5e1; max-width: 560px; margin: 0 auto 32px; }
.hero .actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ── Layout ───────────────────────────────────────────────────── */
main { max-width: 1120px; margin: 0 auto; padding: 40px 28px; }

.panel, .auth, .question {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 36px; box-shadow: var(--shadow);
}
.panel h1, .panel h2, .panel h3 { margin-bottom: 16px; }
.panel h1 { font-size: 28px; font-weight: 800; }
.panel h2 { font-size: 20px; font-weight: 700; color: var(--ink); margin-top: 36px; }
.panel h3 { font-size: 16px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }

.auth { max-width: 460px; margin: 60px auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }

.card, .row {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 22px; box-shadow: var(--shadow);
  transition: all .2s;
}
.card:hover { border-color: var(--accent); box-shadow: 0 4px 20px rgba(8,145,178,.08); }

.price { font-size: 40px; font-weight: 900; letter-spacing: -1px; color: var(--ink); }
.price .muted { font-size: 16px; font-weight: 500; color: var(--muted); }

/* ── Metrics ───────────────────────────────────────────────────── */
.metrics {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin: 20px 0;
}
.metrics div {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px; box-shadow: var(--shadow);
}
.metrics span { font-size: 32px; font-weight: 900; letter-spacing: -.5px; display: block; }
.metrics p { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }

/* ── Forms ─────────────────────────────────────────────────────── */
input, select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 15px; font-family: inherit; color: var(--ink);
  background: #fff; transition: all .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(8,145,178,.1); }
form p { margin-bottom: 16px; }
form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink); }

/* ── Question / Practice ───────────────────────────────────────── */
.question-shell { max-width: 860px; margin: 0 auto; }
.question { position: relative; overflow: hidden; }
.question p { font-size: 18px; line-height: 1.75; }
.question .eyebrow, .meta {
  color: var(--muted); text-transform: uppercase; font-size: 12px;
  font-weight: 700; letter-spacing: .5px; margin-bottom: 12px;
}
.option {
  display: block; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin: 10px 0; cursor: pointer; transition: all .15s;
  background: #fff;
}
.option:hover { border-color: var(--accent); background: #f0f9ff; }
.option input[type="radio"] { width: auto; margin-right: 10px; accent-color: var(--accent); }

.watermark {
  position: absolute; inset: auto 24px 24px auto;
  opacity: .04; font-size: 24px; font-weight: 900;
  transform: rotate(-18deg); pointer-events: none; color: var(--ink);
}

.result { padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-weight: 700; }
.result.ok { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.result.bad { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

.notice {
  background: #ecfeff; border: 1px solid #a5f3fc; padding: 14px 18px;
  border-radius: 10px; margin-bottom: 20px; font-size: 14px;
}

/* ── Dashboard components ──────────────────────────────────────── */
.heatmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 16px 0; }
.heatmap-cell {
  border: 1px solid var(--line); border-radius: 10px; padding: 14px;
  text-align: center; background: var(--card);
}
.heatmap-cell.locked { background: #f1f5f9 !important; opacity: .5; filter: blur(4px); }
.heatmap-label { display: block; font-size: 13px; font-weight: 600; }
.heatmap-val { display: block; font-size: 28px; font-weight: 900; }
.heatmap-sub { display: block; font-size: 12px; color: var(--muted); }

.trend-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin: 16px 0; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.trend-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.trend-bar { width: 100%; max-width: 20px; background: var(--gradient2); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.trend-day { font-size: 10px; color: var(--muted); position: absolute; bottom: -18px; }

/* ── Misc ──────────────────────────────────────────────────────── */
.filters { display: grid; grid-template-columns: minmax(220px,1fr) 180px auto; gap: 10px; align-items: end; margin: 16px 0 22px; }
.segmented { display: flex; gap: 12px; flex-wrap: wrap; margin: 10px 0 20px; }
.segmented label { border: 1.5px solid var(--line); border-radius: 10px; padding: 14px 18px; background: #fff; cursor: pointer; transition: all .15s; }
.segmented label:hover { border-color: var(--accent); }
.actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.actions.compact { gap: 8px; font-size: 14px; }
.eyebrow { color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: 1px; font-weight: 700; }

.list .row { display: flex; justify-content: space-between; align-items: center; }

/* ── Footer ────────────────────────────────────────────────────── */
footer {
  text-align: center; padding: 40px 20px; color: var(--muted);
  font-size: 13px; border-top: 1px solid var(--line); margin-top: 60px;
}
footer strong { color: var(--ink); }
.footer-logo {
  width: 28px; height: 28px; object-fit: contain;
  vertical-align: middle; margin-right: 8px;
}

/* ── Mobile ────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar {
    padding: 10px 14px; flex-wrap: nowrap; height: auto; min-height: 60px;
    gap: 10px; align-items: center;
  }
  .brand { font-size: 17px; gap: 7px; flex: 0 0 auto; }
  .brand-logo { width: 30px; height: 30px; }
  .brand-sub { display: none; }
  nav {
    flex: 1; min-width: 0; justify-content: flex-end; gap: 4px;
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }
  nav a, nav button { white-space: nowrap; padding: 7px 10px; font-size: 13px; }
  .hero { padding: 48px 18px 56px; min-height: calc(100vh - 60px); }
  .hero-logo { width: 78px; height: 78px; margin-bottom: 12px; }
  .hero-eyebrow { font-size: 11px; letter-spacing: 2px; margin-bottom: 14px; }
  .hero h1 { font-size: 38px; letter-spacing: -.8px; }
  .hero p { font-size: 16px; }
  .hero .actions, .actions { align-items: stretch; }
  .hero .actions .button { width: 100%; justify-content: center; }
  .button.large { padding: 14px 22px; font-size: 16px; border-radius: 12px; }
  main { padding: 20px 16px; }
  .panel, .auth { padding: 24px; }
  .filters { grid-template-columns: 1fr; }
  .trend-chart { height: 80px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .list .row { align-items: flex-start; flex-direction: column; gap: 10px; }
}

@media (max-width: 420px) {
  .topbar { padding-inline: 10px; }
  .brand span:not(.brand-sub) { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  nav a, nav button { padding-inline: 8px; }
  .hero h1 { font-size: 34px; }
}
