/* Mêmes jetons que l'application : lib/core/theme/app_colors.dart. */
@font-face { font-family: Inter; src: url(/fonts/Inter-Regular.ttf); font-weight: 400 500; font-display: swap; }
@font-face { font-family: Inter; src: url(/fonts/Inter-Bold.ttf); font-weight: 600 800; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: #faf9f5; --side: #f3f2ec; --card: #ffffff; --subtle: #f1f5f9;
  --text: #1e293b; --secondary: #64748b; --muted: #94a3b8; --border: #e2e8f0;
  --brand: #1b6b52; --brand-hover: #15533f; --soft: #e6f4ef; --on-brand: #ffffff;
  --ok: #065f46; --ok-bg: #ecfdf5; --warn: #92400e; --warn-bg: #fffbeb; --bad: #991b1b; --bad-bg: #fef2f2;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121316; --side: #16181c; --card: #1c1e22; --subtle: #24272d;
    --text: #f1f3f5; --secondary: #98a0ad; --muted: #636a78; --border: #2c3036;
    --brand: #2a8568; --brand-hover: #35a07e; --soft: #172b23;
    --ok: #4ade80; --ok-bg: #13281e; --warn: #fbbf24; --warn-bg: #2b2111; --bad: #fb7185; --bad-bg: #2b141a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 14px/1.45 Inter, system-ui, sans-serif; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
a { color: var(--brand); font-weight: 600; }
.muted { color: var(--secondary); font-size: 12.5px; }
.amount { font: 800 28px/1.2 "JetBrains Mono", ui-monospace, Consolas, monospace; letter-spacing: -.5px; }
.stack { display: grid; gap: 8px; }
.stack-lg { display: grid; gap: 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }

/* Boutons et champs : cibles tactiles d'au moins 44 px. */
button, input, select { font: inherit; color: inherit; min-height: 46px; border-radius: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px;
  border: 1px solid var(--brand); background: var(--brand); color: var(--on-brand); font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-hover); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border); }
.btn.secondary:hover { background: var(--subtle); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--border); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: progress; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
label.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; }
input, select { width: 100%; border: 1px solid var(--border); background: var(--card); padding: 0 12px; font-size: 16px; font-weight: 400; }

/* Choix à toucher : offres, moyens de paiement, filtres. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.chips legend { font-size: 12.5px; font-weight: 600; margin-bottom: 6px; padding: 0; }
.chip { min-height: 44px; padding: 0 14px; border: 1px solid var(--border); background: var(--card); cursor: pointer; font-weight: 600; }
.chip[aria-pressed="true"] { border-color: var(--brand); background: var(--soft); color: var(--text); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tiles .chip { display: grid; gap: 2px; padding: 14px; text-align: left; border-radius: 10px; border-width: 1.5px; }
.tiles .chip strong { font-size: 18px; }

.badge { flex: none; border-radius: 999px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.bad { color: var(--bad); background: var(--bad-bg); }
.badge.neutral { color: var(--secondary); background: var(--subtle); }

/* Listes : une ligne par élément, le détail s'ouvre au toucher. */
.list { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px;
  border: 0; border-radius: 0; background: transparent; text-align: left; }
button.item { cursor: pointer; }
button.item:hover { background: var(--subtle); }
button.item:focus-visible { outline-offset: -3px; }
.item + .item { border-top: 1px solid var(--border); }
.item .grow > * { display: block; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.code { font: 800 22px ui-monospace, Consolas, monospace; letter-spacing: 3px; user-select: all; }
.notice { border-radius: 8px; padding: 10px 12px; background: var(--soft); }
.error { border-radius: 8px; padding: 10px 12px; color: var(--bad); background: var(--bad-bg); }
.empty { text-align: center; color: var(--secondary); padding: 40px 16px; }

/* Écran de connexion. */
.auth { min-height: 100dvh; display: grid; place-content: center; padding: 24px 16px; }
.auth form { width: min(380px, calc(100vw - 32px)); display: grid; gap: 14px; }
.auth img { width: 56px; height: 56px; }

/* Cadre : barre latérale sur PC, barre en bas sur téléphone. */
.shell { min-height: 100dvh; display: grid; grid-template-columns: 220px 1fr; }
.side { background: var(--side); border-right: 1px solid var(--border); padding: 16px 12px; display: flex;
  flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100dvh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 0 8px 12px; }
.brand img { width: 32px; height: 32px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav button { display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; background: transparent;
  color: var(--secondary); font-weight: 600; cursor: pointer; }
.nav button[aria-current="page"] { background: var(--soft); color: var(--brand); }
.nav svg { width: 20px; height: 20px; flex: none; }
.account { margin-top: auto; text-align: left; }
.page { width: 100%; max-width: 760px; padding: 20px 24px 40px; display: grid; gap: 14px; align-content: start; }
.mobile-account { display: none; }

@media (max-width: 760px) {
  .shell { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .side { position: fixed; inset: auto 0 0; height: auto; z-index: 2; border: 0; border-top: 1px solid var(--border);
    background: var(--card); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .brand, .account { display: none; }
  .nav { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .nav button { flex-direction: column; justify-content: center; gap: 2px; min-height: 54px; padding: 0; font-size: 11.5px; }
  .page { padding: 14px 12px 24px; }
  .mobile-account { display: inline-flex; }
}

/* Feuille d'action : en bas sur téléphone, au centre sur PC. */
dialog { width: min(480px, 100vw); max-height: calc(100dvh - 24px); overflow-y: auto; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card); color: var(--text); padding: 18px; }
dialog::backdrop { background: rgb(0 0 0 / .45); }
@media (max-width: 760px) {
  dialog { margin: auto 0 0; max-width: 100vw; width: 100vw; border-radius: 16px 16px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
#toast { position: fixed; left: 12px; right: 12px; bottom: calc(86px + env(safe-area-inset-bottom)); max-width: 460px;
  margin: 0 auto; background: var(--text); color: var(--bg); border-radius: 8px; padding: 12px 16px; z-index: 3; }
