/* ============================================================
   FitEarn — design tokens
   Palette: late-evening indigo (people train at home, after work),
   jeepney-gold for coins, mint for a confirmed rep, coral for form
   corrections. Gold is reserved exclusively for earned value; it never
   appears as decoration.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400;12..96,600;12..96,800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink:      #12101B;
  --surface:  #1C1928;
  --raised:   #262236;
  --line:     #35304A;

  --gold:     #F5B72F;
  --gold-dim: #8A6716;
  --mint:     #5CE1A6;
  --coral:    #FF6B5B;

  --text:     #F2EFE9;
  --muted:    #9A94AD;

  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body:    'Inter', system-ui, -apple-system, sans-serif;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
}

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

html, body {
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { display: flex; flex-direction: column; }

h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; }

.num { font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 20px 96px;
  flex: 1;
}

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; }

/* ---------- type ---------- */
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.title { font-size: 30px; line-height: 1.1; }
.sub { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
}

.card-gold {
  background: linear-gradient(150deg, #2A2010, var(--surface) 60%);
  border-color: var(--gold-dim);
}

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 18px;
  font-family: var(--body); font-size: 15px; font-weight: 600;
  color: var(--ink); background: var(--gold);
  border: none; border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line);
}
.btn-danger { background: var(--coral); color: #2A0D09; }

:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }

/* ---------- forms ---------- */
label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
input {
  width: 100%; padding: 14px;
  font-family: var(--body); font-size: 16px;   /* 16px stops iOS zoom-on-focus */
  color: var(--text); background: var(--raised);
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
input:focus { outline: none; border-color: var(--gold); }

.error {
  padding: 12px 14px; border-radius: var(--r-sm);
  background: rgba(255,107,91,.12); border: 1px solid rgba(255,107,91,.35);
  color: var(--coral); font-size: 13px;
}

/* ---------- coin readouts ---------- */
.coin-big {
  font-family: var(--display); font-weight: 800;
  font-size: 46px; line-height: 1; color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.tabs { display: flex; gap: 8px; }
.tab {
  flex: 1; padding: 10px; text-align: center; font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  cursor: pointer;
}
.tab[aria-selected="true"] { color: var(--ink); background: var(--gold); border-color: var(--gold); }

/* ---------- bottom nav ---------- */
.nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center; gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(18,16,27,.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 20;
}
.nav a {
  flex: 1; max-width: 140px; padding: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.nav a[aria-current="page"] { color: var(--gold); }
.nav svg { width: 20px; height: 20px; }

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
