/* FlowState design system — Quiet Luxury, Champagne & Espresso. */
:root {
  --bg: #F6F2EC; --surface: #FBF8F3; --field: #FFFFFF; --ink: #1E1B18; --line: #E3DBCF; --tint: #EFE8DD;
  --sand: #D8CBB8; --muted: #6E655A; --faint: #8F867B; --accent: #A47E45; --accent-ink: #8C6B3C; --gold: #E3C58F;
  --nav: #1E1B18; --nav-off: #BDB2A4; --danger: #94573F;
  --protein: #A47E45; --carbs: #7E8C6E; --fat: #B9826A;
  --serif: 'DM Serif Display', Georgia, serif; --sans: Manrope, system-ui, -apple-system, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #141210; --surface: #1E1B18; --field: #24201C; --ink: #F3EDE4; --line: #332D27; --tint: #2A2520;
  --sand: #4A433C; --muted: #A89E91; --faint: #8F867B; --accent-ink: #E3C58F; --danger: #E0A58C;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --bg: #141210; --surface: #1E1B18; --field: #24201C; --ink: #F3EDE4; --line: #332D27; --tint: #2A2520;
    --sand: #4A433C; --muted: #A89E91; --faint: #8F867B; --accent-ink: #E3C58F; --danger: #E0A58C;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }

.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.logo { font-family: var(--serif); font-size: 30px; letter-spacing: .2px; }
.logo span { color: var(--accent); }

/* Phone-width column, centred on desktop. */
.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; padding: 0 16px calc(110px + env(safe-area-inset-bottom)); }
.topbar { height: 64px; display: flex; align-items: center; justify-content: space-between; padding-left: 6px; }
h1:focus { outline: none; }
.h1 { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 0; line-height: 1.1; }
.h2 { font-family: var(--serif); font-weight: 400; font-size: 22px; margin: 0; }
.kicker { font-size: 11px; font-weight: 800; letter-spacing: 1.3px; color: var(--faint); text-transform: uppercase; }
.muted { color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px; }
.card.dark { background: #1E1B18; border-color: #1E1B18; color: #F6F2EC; }
.card.dark .muted { color: #BDB2A4; }

.btn { height: 50px; padding: 0 22px; border-radius: 25px; border: 0; font-weight: 800; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.primary { background: #1E1B18; color: var(--gold); }
.btn.gold { background: var(--gold); color: #1E1B18; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--sand); color: var(--ink); }
.btn.block { width: 100%; }
.btn:disabled { background: var(--line); color: var(--muted); cursor: default; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; color: var(--faint); padding: 0 4px; text-transform: uppercase; }
.input { height: 52px; border-radius: 18px; border: 1px solid var(--line); background: var(--field); padding: 0 16px; font-size: 15px; width: 100%; outline: none; }
.input:focus { border-color: var(--accent); }
.error { color: var(--danger); font-size: 13px; font-weight: 700; padding: 0 4px; }

.chip { flex: none; height: 38px; padding: 0 16px; border-radius: 19px; border: 1px solid var(--sand); background: transparent; font-weight: 700; font-size: 13px; cursor: pointer; }
.chip.on { background: #1E1B18; color: #F6F2EC; border-color: #1E1B18; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; background: var(--tint); border-radius: 22px; padding: 4px; }
.seg button { height: 40px; border: 0; border-radius: 18px; background: transparent; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); font-weight: 800; box-shadow: 0 2px 6px rgba(30,27,24,.08); }
.badge { height: 26px; padding: 0 10px; border-radius: 13px; display: inline-flex; align-items: center; font-size: 10px; font-weight: 800; letter-spacing: .6px; background: #1E1B18; color: var(--gold); }
.pill { height: 26px; padding: 0 10px; border-radius: 13px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; background: var(--tint); color: var(--muted); }
.avatar { border-radius: 50%; background: var(--sand); flex: none; }

/* Floating pill navigation. */
.nav { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom)); width: min(440px, calc(100% - 40px)); height: 66px; border-radius: 33px; background: var(--nav); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center; box-shadow: 0 14px 30px rgba(30,27,24,.25); z-index: 20; }
.nav a { display: flex; justify-content: center; color: var(--nav-off); }
.nav a.active { color: var(--gold); }
.nav .plus { width: 46px; height: 46px; border-radius: 23px; background: var(--gold); color: #1E1B18; display: flex; align-items: center; justify-content: center; }

.auth { max-width: 420px; margin: 0 auto; min-height: 100vh; padding: 48px 20px 40px; display: flex; flex-direction: column; gap: 22px; }
.hero { border-radius: 30px; background: #1E1B18; color: #F6F2EC; padding: 28px 24px; display: flex; flex-direction: column; gap: 10px; }
.hero .logo { font-size: 34px; }
.hero p { margin: 0; color: #BDB2A4; line-height: 1.5; }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px; background: #94573F; color: #fff; z-index: 1000; }
#blazor-error-ui .reload { color: #fff; font-weight: 800; margin-left: 8px; }
