/* ════════════════════════════════════════════════════════════════════
   MyCivi — charte partagée des pages servies (GÉNÉRÉ, NE PAS ÉDITER)
   Copyright © 2026 Christophe Corvaisier. Tous droits réservés.

   Produit par tools/gen-public-css.mjs depuis les sources de l'app :
     src/client/styles/tokens.css  (jetons de marque)
     src/client/styles/app.css     (couche sémantique + thèmes + composants
                                    génériques republiés tels quels)

   Pour changer la charte : modifier les SOURCES, puis relancer
     node tools/gen-public-css.mjs
   ════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════
   MyCivi — Tokens de la charte graphique (« Le Tampon », juin 2026)
   Copyright © 2026 Christophe Corvaisier. Tous droits réservés.

   Source unique des couleurs, rayons, ombres et transitions de la marque.
   Les variables sémantiques (--brand-*, --bg, --surface…) consommées par
   app.css et le reste du code pointent vers ces jetons bruts.
   Pour faire évoluer la marque : changer une valeur ICI suffit.
   ════════════════════════════════════════════════════════════════════ */
:root {
  /* ---- Palette de marque ---- */
  --mc-bleu-civique: #1B3A6B;     /* Primaire — confiance, institution */
  --mc-bleu-civique-700: #16305a;
  --mc-bleu-civique-800: #112545;
  --mc-bleu-civique-900: #0c1a30;
  --mc-sable-brule: #E07A47;      /* Accent chaud — max 15 % par écran */
  --mc-sable-brule-600: #c9663a;
  --mc-lin: #F6F1E8;              /* Fond chaud */
  --mc-lin-200: #efe8da;
  --mc-bleu-lagon: #4A8FB5;       /* Secondaire — fraîcheur, lien */
  --mc-bleu-lagon-600: #3d7a9d;

  /* ---- Neutres (gris 50 → 900) ---- */
  --mc-gris-50:  #F8FAFC;
  --mc-gris-100: #F1F4F8;
  --mc-gris-200: #E2E8F0;
  --mc-gris-300: #CBD5E1;
  --mc-gris-400: #94A3B8;
  --mc-gris-500: #64748B;
  --mc-gris-600: #475569;
  --mc-gris-700: #334155;
  --mc-gris-800: #1E293B;
  --mc-gris-900: #0F172A;

  /* ---- Sémantiques ---- */
  --mc-success: #2F8F6B;          /* Vert sobre, lisible sur lin */
  --mc-warning: #D97706;          /* Ambre, distinct du sable accent */
  --mc-error:   #D64545;          /* Rouge sobre */

  /* ---- Rayons (6 / 10 / 16 / 24) ---- */
  --mc-radius-sm: 6px;
  --mc-radius-md: 10px;
  --mc-radius-lg: 16px;
  --mc-radius-xl: 24px;

  /* ---- Ombres subtiles ---- */
  --mc-shadow-sm: 0 1px 2px rgba(27, 58, 107, .06);
  --mc-shadow-md: 0 1px 3px rgba(27, 58, 107, .06), 0 4px 12px rgba(27, 58, 107, .05);
  --mc-shadow-lg: 0 8px 24px rgba(27, 58, 107, .14);

  /* ---- Transitions ---- */
  --mc-transition: 180ms;
  --mc-ease: cubic-bezier(.4, 0, .2, 1);

  /* ---- Typo : échelle ratio 1.25, base 16 px ---- */
  --mc-font-title: "Marianne", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mc-font-body:  "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --mc-text-xs:   0.64rem;
  --mc-text-sm:   0.8rem;
  --mc-text-base: 1rem;
  --mc-text-lg:   1.25rem;
  --mc-text-xl:   1.5625rem;
  --mc-text-2xl:  1.953rem;
  --mc-text-3xl:  2.441rem;
}

/* ---- Marianne self-hostée (typo de l'État français, DSFR) ---- */
@font-face {
  font-family: "Marianne";
  src: url("/fonts/Marianne-Regular.lat.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Marianne";
  src: url("/fonts/Marianne-Medium.lat.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Marianne";
  src: url("/fonts/Marianne-Bold.lat.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ========== Brand tokens (MyCivi charte « Le Tampon ») ==========
   Les couleurs brutes vivent dans tokens.css (--mc-*). Ici on mappe les
   variables sémantiques héritées vers la nouvelle palette de charte. */
:root {
  --brand-primary: var(--mc-bleu-civique);   /* Bleu Civique */
  --brand-accent: var(--mc-sable-brule);     /* Sable brûlé (accent chaud) */
  --brand-secondary: var(--mc-bleu-lagon);   /* Bleu Lagon (secondaire) */
  --brand-secondary-soft: rgba(74, 143, 181, .15);
  --success: var(--mc-success);
  --warning: var(--mc-warning);
  --alert: var(--mc-error);
  --radius: var(--mc-radius-lg);
  --radius-lg: var(--mc-radius-xl);
}
/* Thème LIGHT — charte officielle, PAR DÉFAUT (fond Lin chaud) */
body, body[data-theme="light"] {
  --bg: var(--mc-lin);
  --surface: #ffffff;
  --surface-elev: #ffffff;
  --surface-hover: var(--mc-lin-200);
  --border: rgba(27, 58, 107, .10);
  --border-strong: rgba(27, 58, 107, .18);
  --text: var(--mc-gris-900);
  --text-soft: var(--mc-gris-700);
  --text-muted: var(--mc-gris-500);
  --brand-primary-soft: rgba(27, 58, 107, .10);
  --brand-accent-soft: rgba(224, 122, 71, .14);
  --success-soft: rgba(47, 143, 107, .12);
  --warning-soft: rgba(217, 119, 6, .14);
  --alert-soft: rgba(214, 69, 69, .12);
  --shadow-sm: var(--mc-shadow-sm);
  --shadow: var(--mc-shadow-md);
  --shadow-lg: var(--mc-shadow-lg);
}
/* Thème DARK (option utilisateur) — bleu nuit civique, plus chaud que l'ancien #050810 */
body[data-theme="dark"] {
  --bg: var(--mc-bleu-civique-900);
  --surface: var(--mc-bleu-civique-800);
  --surface-elev: #16284a;
  --surface-hover: #1d3357;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .14);
  --text: #f5f7fb;
  --text-soft: #c3cee0;
  --text-muted: #8294b3;
  --brand-primary-soft: rgba(74, 143, 181, .18);
  --brand-accent-soft: rgba(224, 122, 71, .18);
  --success-soft: rgba(47, 143, 107, .18);
  --warning-soft: rgba(217, 119, 6, .18);
  --alert-soft: rgba(214, 69, 69, .18);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 12px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 32px rgba(12, 26, 48, .5);
}


/* ========== Cards ========== */
.card {
  background: var(--surface-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  transition: transform .18s ease, border-color .18s ease;
}
.card:active { transform: scale(.98); }

.celebration {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(224, 122, 71, .08) 0%, rgba(224, 122, 71, .03) 100%);
  border-color: rgba(224, 122, 71, .25);
}
.celebration .icon {
  font-size: 26px;
  width: 48px; height: 48px;
  background: var(--brand-accent-soft);
  border: 1px solid rgba(224, 122, 71, .3);
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.celebration .text { flex: 1; min-width: 0; }
.celebration .title { font-weight: 700; font-size: 15px; color: var(--text); }
.celebration .subtitle { font-size: 13px; color: var(--text-soft); margin-top: 2px; }

.action-card {
  background: linear-gradient(135deg, rgba(27, 58, 107, .15) 0%, rgba(27, 58, 107, .05) 100%);
  border-color: rgba(27, 58, 107, .35);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}
.action-card .icon {
  font-size: 22px;
  width: 48px; height: 48px;
  background: var(--brand-primary);
  color: white;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.action-card .text { flex: 1; min-width: 0; }
.action-card .title { font-weight: 700; font-size: 15px; color: var(--text); }
.action-card .subtitle { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.action-card .badge {
  background: var(--brand-primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 100px;
  margin-left: 8px;
}
.action-card .arrow { color: var(--brand-primary); font-size: 24px; font-weight: 300; }

.alert-card {
  background: var(--alert-soft);
  border-left: 4px solid var(--alert);
  padding: 14px 16px;
}
.alert-card.warn { background: var(--warning-soft); border-left-color: var(--warning); }
.alert-card .title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.alert-card .subtitle { color: var(--text-soft); font-size: 13px; margin-top: 4px; }
.alert-card .actions { margin-top: 10px; display: flex; gap: 8px; }
.alert-card button {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.alert-card button.primary {
  background: var(--alert);
  color: white;
  border-color: var(--alert);
}
