/* Vibeathon design system — clean professional white with deep blue accents.
   Light/dark via [data-theme]; mobile-first; prices are unbreakable tokens. */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f7fc;
  --surface: #ffffff;
  --surface-2: #eef3fb;
  --border: #d9e2f2;
  --text: #10203f;
  --text-soft: #4b5b78;
  --brand: #1e3a8a;
  --brand-2: #1d4ed8;
  --brand-soft: #dbe7ff;
  --accent: #0ea5e9;
  --ok: #0f766e;
  --ok-soft: #d5f0ec;
  --warn: #b45309;
  --warn-soft: #fdeed3;
  --bad: #b91c1c;
  --bad-soft: #fde3e3;
  --shadow: 0 10px 30px rgba(16, 32, 63, 0.08);
  --radius: 14px;
}
[data-theme="dark"] {
  --bg: #0b1220;
  --bg-soft: #0e1729;
  --surface: #121d33;
  --surface-2: #18263f;
  --border: #24344f;
  --text: #e8eefb;
  --text-soft: #9fb0cc;
  --brand: #7aa2ff;
  --brand-2: #5b8cff;
  --brand-soft: #1c2b4d;
  --ok: #34d399;
  --ok-soft: #123a30;
  --warn: #fbbf24;
  --warn-soft: #3a2c10;
  --bad: #f87171;
  --bad-soft: #3d1717;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--brand-2); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ── Top navigation ─────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; gap: 10px; min-height: 64px; flex-wrap: wrap; padding: 8px 0; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: 0.4px; min-height: 44px; }
.brand img { height: 34px; width: auto; display: block; }
.brand .surface-tag { font-size: 0.72rem; font-weight: 700; color: var(--brand-2); background: var(--brand-soft); border-radius: 999px; padding: 3px 10px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a, .nav button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px; padding: 8px 14px;
  border-radius: 10px; border: none; background: none;
  color: var(--text-soft); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--brand-soft); color: var(--brand); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 12px;
  border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: none; transition: transform 0.06s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .nav a:focus-visible, .nav button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.btn-primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface); color: var(--brand); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-sm { min-height: 44px; padding: 6px 14px; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ── Hero ───────────────────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 480px at 85% -10%, color-mix(in srgb, var(--brand-2) 22%, transparent), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--bg-soft);
  border-bottom: 1px solid var(--border);
}
.hero-inner { padding: 72px 0 56px; position: relative; }
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 18px; max-width: 15ch;
}
.hero h1 .u { color: var(--brand-2); }
.hero p.lede { font-size: 1.15rem; color: var(--text-soft); max-width: 56ch; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 40px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.5rem; letter-spacing: -0.01em; }
.stat span { color: var(--text-soft); font-size: 0.88rem; }

/* ── Sections & cards ───────────────────────────────────────────── */
.section { padding: 56px 0; }
.section-head { margin: 0 0 26px; }
.section-head h2 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); letter-spacing: -0.01em; margin: 0 0 6px; }
.section-head p { color: var(--text-soft); margin: 0; max-width: 62ch; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.card h3 { margin: 0; font-size: 1.08rem; }
.card .muted, .muted { color: var(--text-soft); font-size: 0.92rem; }
.card-kicker { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand-2); }

/* Prices: one unbreakable, tabular token — never wraps mid-digits. */
.price { white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 800; }
.price-xl { font-size: 2rem; letter-spacing: -0.01em; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 11px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
.badge-blue { background: var(--brand-soft); color: var(--brand); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-plain { background: var(--surface-2); color: var(--text-soft); }

/* ── Stage tracker ──────────────────────────────────────────────── */
.stage-track { display: flex; gap: 6px; flex-wrap: wrap; }
.stage-pill {
  flex: 1 1 90px; text-align: center; padding: 10px 8px; border-radius: 10px;
  background: var(--surface-2); color: var(--text-soft); font-size: 0.82rem; font-weight: 700; border: 1px solid var(--border); min-width: 0;
}
.stage-pill.done { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.stage-pill.current { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; border-color: transparent; }

/* ── Forms ──────────────────────────────────────────────────────── */
label.field { display: block; margin: 0 0 14px; font-weight: 600; font-size: 0.92rem; }
label.field > span { display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text); font: inherit;
}
textarea { min-height: 96px; resize: vertical; }
.check-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.check-row:hover { background: var(--surface-2); }
.check-row input { width: 22px; height: 22px; min-height: 22px; margin-top: 2px; flex: none; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.error-note { color: var(--bad); background: var(--bad-soft); border-radius: 10px; padding: 10px 14px; font-weight: 600; }
.ok-note { color: var(--ok); background: var(--ok-soft); border-radius: 10px; padding: 10px 14px; font-weight: 600; }

/* ── Tables ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 0.92rem; vertical-align: top; }
th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; }

/* ── Journey / timeline ─────────────────────────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 22px; border-left: 2px solid var(--border); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-2); }
.timeline .muted { display: block; }

/* ── Coach chat ─────────────────────────────────────────────────── */
.coach-box { display: flex; flex-direction: column; gap: 10px; }
.coach-log { display: flex; flex-direction: column; gap: 10px; max-height: 320px; overflow-y: auto; }
.bubble { padding: 10px 14px; border-radius: 14px; max-width: 85%; }
.bubble.me { align-self: flex-end; background: var(--brand-soft); color: var(--text); }
.bubble.coach { align-self: flex-start; background: var(--surface-2); }
.coach-row { display: flex; gap: 8px; }
.coach-row input { flex: 1; }

/* ── Admin layout ───────────────────────────────────────────────── */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side {
  background: linear-gradient(180deg, var(--brand) 0%, #14275c 100%);
  color: #dbe7ff; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px;
}
[data-theme="dark"] .admin-side { background: linear-gradient(180deg, #101c38 0%, #0b1220 100%); }
.admin-side .brand { color: #fff; margin-bottom: 14px; }
.admin-side a {
  display: flex; align-items: center; gap: 8px; color: #c6d6f7; text-decoration: none;
  padding: 11px 12px; min-height: 44px; border-radius: 10px; font-weight: 600; font-size: 0.95rem;
}
.admin-side a:hover { background: rgba(255, 255, 255, 0.09); color: #fff; }
.admin-side a.active { background: rgba(255, 255, 255, 0.16); color: #fff; }
.admin-side .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.admin-main { padding: 26px clamp(16px, 3vw, 36px); min-width: 0; background: var(--bg-soft); }
.admin-main h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 4px; letter-spacing: -0.01em; }
.admin-sub { color: var(--text-soft); margin: 0 0 22px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }

@media (max-width: 860px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { position: sticky; top: 0; z-index: 40; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px; }
  .admin-side .brand { margin: 0 8px 0 0; }
  .admin-side a { padding: 9px 10px; font-size: 0.85rem; }
  .admin-side .side-foot { margin: 0 0 0 auto; flex-direction: row; }
}

/* ── Footer ─────────────────────────────────────────────────────── */
.footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 40px 0 48px; margin-top: 40px; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.footer h4 { margin: 0 0 8px; font-size: 0.95rem; }
.footer p, .footer li { color: var(--text-soft); font-size: 0.9rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.trust-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* ── Toast ──────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 12px;
  font-weight: 700; z-index: 100; box-shadow: var(--shadow); max-width: min(92vw, 480px); text-align: center;
}

.divider { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.hidden { display: none !important; }

@media (max-width: 480px) {
  .hero-inner { padding: 48px 0 40px; }
  .section { padding: 40px 0; }
  .nav a, .nav button { padding: 8px 10px; font-size: 0.9rem; }
}
