/* Culture G — styles. Clair ou sombre selon le réglage de l'iPhone. Aucune police externe. */

:root {
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --ink: #0E1220;
  --muted: #6B7080;
  --line: #E6E8EF;
  --accent: #3B5BFD;       /* bleu électrique : actions */
  --accent-ink: #FFFFFF;
  --amber: #F5A524;        /* séries, alertes douces */
  --red: #E5484D;
  --green: #12A150;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(14, 18, 32, .04), 0 8px 24px rgba(14, 18, 32, .06);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B0D14;
    --surface: #161925;
    --ink: #F2F3F7;
    --muted: #9095A6;
    --line: #262A38;
    --accent: #6F86FF;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
body[data-page="login"], body[data-page="enroll"] { padding-bottom: 0; }

h1, h2, p { margin: 0; }
h1 { font-size: 30px; letter-spacing: -.02em; font-weight: 700; }
h2 { font-size: 21px; letter-spacing: -.01em; font-weight: 650; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; color: var(--muted); }

.muted { color: var(--muted); font-weight: 500; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.big { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.note { font-size: 13px; color: var(--muted); text-align: center; margin: 8px 0; }

/* --- Mise en page --- */
.screen { max-width: 560px; margin: 0 auto; padding: calc(20px + env(safe-area-inset-top)) 16px 24px; display: grid; gap: 14px; }
.top { padding: 8px 4px 6px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 10px; }
.card.link { color: inherit; text-decoration: none; }
.card.hero { gap: 8px; padding: 22px 18px; }
.card.hero .btn-primary { margin-top: 10px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; }
.card > .row + .row { border-top: 1px solid var(--line); padding-top: 10px; }

/* --- Boutons --- */
button { font: inherit; }
.btn-primary {
  appearance: none; border: 0; width: 100%; min-height: 52px; border-radius: 16px;
  background: var(--accent); color: var(--accent-ink); font-size: 17px; font-weight: 600;
  transition: transform .12s ease, opacity .2s ease;
}
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { opacity: .45; }
.btn-quiet {
  appearance: none; border: 1px solid var(--line); background: transparent; color: var(--ink);
  min-height: 46px; border-radius: 14px; font-size: 15px; font-weight: 550; width: 100%;
}
.btn-quiet:disabled { opacity: .5; }

.pill { font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.pill.mode-normal { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.pill.mode-econome { background: color-mix(in srgb, var(--amber) 18%, transparent); color: #B87400; }
.pill.mode-arret { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }

/* --- Jauge du budget --- */
.gauge { position: relative; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.gauge-fill { height: 100%; width: 0; border-radius: inherit; transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.gauge-fill.mode-normal { background: var(--accent); }
.gauge-fill.mode-econome { background: var(--amber); }
.gauge-fill.mode-arret { background: var(--red); }
.tick { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--surface); }
.legend { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.legend b { color: var(--ink); font-weight: 600; }

/* --- Barre d'onglets --- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 8px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1; max-width: 160px; display: grid; justify-items: center; gap: 2px; padding: 6px 0;
  font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.tabbar a .ico { font-size: 20px; line-height: 1; }
.tabbar a.on { color: var(--accent); }

/* --- Connexion --- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 14px; text-align: center; }
.auth-logo { justify-self: center; border-radius: 18px; }
.wordmark { font-size: 32px; }
.subline { color: var(--muted); margin-bottom: 18px; }
.lead { color: var(--muted); }
.field { display: grid; gap: 6px; text-align: left; font-size: 14px; color: var(--muted); }
.field input {
  font: inherit; font-size: 17px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
}
.status { min-height: 20px; font-size: 14px; color: var(--muted); }
.status.error { color: var(--red); }
