/* Citadel Account: the web home for a Citadel account while the app is in
 * development. Spec: docs/account-portal.md.
 *
 * It speaks the app's design language, not the marketing site's: the app's
 * own tokens (src/theme/tokens.ts), light or dark with the system, white or
 * ink cards on 20px corners, near-black buttons that invert in the dark,
 * gradient icon wells, and the system font on the app's type scale. It is
 * not the app: nothing here logs a workout. App features are shown, locked,
 * and each one opens the live demo. */
:root {
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --border: #D8DCE4;
  --text: #0B0E14;
  --text-2: #4A5468;
  --muted: #8A93A6;
  --primary: #FF5A36;
  --cta: #0B0E14;
  --cta-text: #FFFFFF;
  --success: #2FB380;
  --danger: #E24C4C;
  --violet: #8B5CF6;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius: 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0E14;
    --surface: #1C2230;
    --border: #2A3140;
    --text: #FFFFFF;
    --text-2: #D8DCE4;
    --muted: #8A93A6;
    --cta: #F5F6F8;
    --cta-text: #0B0E14;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }

.beta {
  margin: 0;
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-2);
  background: rgba(139, 92, 246, 0.12);
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}
.beta b { color: var(--text); }

.screen { max-width: 560px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 16px; }

/* The app's header: a large title, the account's avatar on the right. */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0 4px; }
.top-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.top-brand img { width: 30px; height: 30px; border-radius: 50%; display: block; }
.top h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: #FFFFFF;
  background: linear-gradient(135deg, #FF5A36, #FF3D81);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow);
}

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.title { font-size: 20px; font-weight: 600; margin: 0; }
.subheading { font-size: 16px; font-weight: 600; margin: 0; }
.caption { font-size: 13px; color: var(--text-2); margin: 0; }
.muted { font-size: 13px; color: var(--muted); margin: 0; }
.body { font-size: 15px; color: var(--text-2); margin: 0; }
.section-label {
  margin: 8px 4px -4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Icon wells: a gradient disc, a white glyph, half its diameter. */
.well {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  background: linear-gradient(135deg, var(--a, #FF5A36), var(--b, #FF3D81));
}
.well svg { width: 22px; height: 22px; }
.well--ember { --a: #FF5A36; --b: #FF3D81; }
.well--violet { --a: #8B5CF6; --b: #FF5A36; }
.well--azure { --a: #3B82F6; --b: #22D3EE; }
.well--mint { --a: #34D399; --b: #22D3EE; }
.well--gold { --a: #FFC837; --b: #F5A623; }
.well--amber { --a: #F5A623; --b: #FF5A36; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: var(--cta);
  color: var(--cta-text);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-outline { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn-small { min-height: 40px; width: auto; font-size: 14px; padding: 0 14px; border-radius: 12px; }
.actions { display: grid; gap: 10px; }
.actions-inline { display: flex; flex-wrap: wrap; gap: 8px; }
.link { color: var(--primary); font-weight: 600; text-decoration: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 90, 54, 0.12);
  color: var(--primary);
}
.chip--good { background: rgba(47, 179, 128, 0.14); color: var(--success); }
.chip--wait { background: rgba(245, 166, 35, 0.16); color: #C98410; }
.chip--lock { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

/* App features, shown and locked: each opens the live demo. */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
}
.tile .well { width: 36px; height: 36px; }
.tile .well svg { width: 18px; height: 18px; }
.tile b { font-size: 15px; }

.input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.code { text-align: center; font-size: 22px; letter-spacing: 6px; font-weight: 700; }
/* The spacing is for the four digits; the hint has to fit a phone. */
.code::placeholder { font-size: 15px; letter-spacing: 0; font-weight: 600; }
label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.status { min-height: 1.3em; font-size: 13px; color: var(--text-2); margin: 0; }
.status.is-error { color: var(--danger); }

.private { padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); font-size: 14px; color: var(--text); }
.lead-code { font-size: 34px; font-weight: 800; letter-spacing: 8px; }
.still-out { color: var(--danger); font-weight: 600; }

.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.setting:first-of-type { border-top: 0; }
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; inset: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background 0.2s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(20px); }

.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.news li { border-left: 3px solid var(--violet); padding-left: 10px; }
.news b { display: block; font-size: 15px; }

/* Run Club: the buddy system's two questions. */
.prefs { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.prefs-company { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer; }
.prefs-company input { width: 18px; height: 18px; flex: none; accent-color: var(--primary); }

/* ---- the account area on a desktop ----
   A product page, not a phone screen stretched wide: who you are, the app
   and your plan in a column that stays put, and the things you act on
   beside it. On a phone the columns dissolve and each group's order keeps
   the single-column order. */
.account-col { display: contents; }
.group { display: grid; gap: 12px; }
@media (min-width: 960px) {
  .screen.account-layout {
    max-width: 1120px;
    grid-template-columns: 360px minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
    padding: 28px 32px 64px;
  }
  .account-layout .top { grid-column: 1 / -1; }
  .account-col { display: grid; gap: 16px; align-content: start; }
  .account-col > .group { order: 0 !important; }
  .account-side { position: sticky; top: 20px; }
  .account-main .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Sign-in */
.signin { max-width: 420px; margin: 8vh auto 0; }
.signin .brand-mark { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 6px; display: block; }
.center { text-align: center; }
