/* ═══════════════════════════════════════════════════════════════════
   tokens.css — AECJ Les Mureaux
   Source de vérité visuelle unique — toutes les pages importent CE fichier.
   Aucune page ne redéfinit de variables :root.

   Généré le 13/04/2026
   Référence : CHARTE_GRAPHIQUE.md
   ═══════════════════════════════════════════════════════════════════ */

/* ──────────────────────────────────────────────────────────────────
   1. GOOGLE FONTS
   Playfair Display : 400 (body text) + 400 italic (citations)
                      600 (h2) + 700 (h1)
   Inter            : 300 (light) + 400 (body) + 500 (medium) + 600 (bold)
   ────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');


/* ──────────────────────────────────────────────────────────────────
   2. DESIGN TOKENS — variables CSS globales
   ────────────────────────────────────────────────────────────────── */
:root {

  /* ─── Couleurs principale (vert islamique — overridées par header.php selon le tenant) ─── */
  --green:        #1a6b3f;   /* marque — CTA, liens actifs */
  --green-dark:   #0d4f2f;   /* navbar, sidebar, panneaux sombres */

  /* Dérivés automatiques — suivent --green sans config admin (color-mix résolu à l'usage) */
  --green-mid:    color-mix(in srgb, var(--green) 85%, black);  /* hover CTA, eyebrows texte, bordures accent */
  --green-light:  color-mix(in srgb, var(--green) 8%, white);   /* fond badge, fond card formule */
  --green-pale:   color-mix(in srgb, var(--green) 4%, white);   /* fond section alternée, card sélectionnée */

  /* ─── Accent doré — overridé par header.php ─── */
  --gold:         #b8903a;   /* décoration, icônes, bordures premium — PAS comme texte sur fond clair */
  --gold-light:   #fdf6e3;   /* fond citation coranique, fond badge */

  /* ─── Texte ─── */
  --ink:          #1c2e20;   /* texte principal (14.37:1 /blanc ✅) */
  --muted:        #4a6455;   /* texte secondaire, labels, placeholders (6.47:1 /blanc ✅) */
  --soft:         #7a9a86;   /* DÉCORATIF UNIQUEMENT — ornements, séparateurs (3.09:1 /blanc ❌ texte) */

  /* ─── Surfaces & bordures ─── */
  --border:       color-mix(in srgb, var(--green) 14%, white);  /* bordure standard — dérivée auto */
  --cream:        #fdfaf5;   /* fond de page */
  --white:        #ffffff;   /* fond card, modal, input */

  /* ─── États de feedback ─── */
  --red:          #c0392b;              /* erreur — texte et icône (5.44:1 /blanc ✅) */
  --red-light:    #fdf0ee;              /* fond message erreur */
  --red-border:   rgba(192,57,43,.2);   /* bordure champ en erreur */
  --orange:       #d4660a;              /* ICÔNE seulement — PAS comme texte (3.68:1 /blanc ❌) */
  --orange-dark:  #a34e08;              /* texte avertissement accessible (5.75:1 /blanc ✅) */
  --orange-light: #fff4ec;              /* fond toast warning */
  --blue:         #2563eb;              /* information — texte et icône (5.17:1 /blanc ✅) */
  --blue-light:   #eff6ff;              /* fond toast info */

  /* ─── Typographie ─── */
  --font-title:   'Playfair Display', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  /* ─── Border-radius ─── */
  --radius-sm:    8px;    /* boutons, inputs */
  --radius-md:    12px;   /* cards, popovers */
  --radius-lg:    16px;   /* modals, grandes cards */
  --radius-pill:  20px;   /* badges, pills, stepper circles */

  /* ─── Layout admin ─── */
  --sidebar:      220px;  /* largeur sidebar admin (ignorée hors admin) */

  /* ─── Shadows — teinte auto de la couleur primaire ─── */
  --shadow-sm:    0 2px 8px color-mix(in srgb, var(--green) 6%, transparent);
  --shadow-md:    0 4px 20px color-mix(in srgb, var(--green) 10%, transparent);
  --shadow-lg:    0 8px 32px color-mix(in srgb, var(--green) 14%, transparent);
  --shadow-modal: 0 20px 60px rgba(0,0,0,.15);

  /* ─── Transitions ─── */
  --transition:   all 0.2s ease;
}


/* ──────────────────────────────────────────────────────────────────
   3. RESET MINIMAL
   ────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin:  0;
  padding: 0;
}

/* Restaurer [hidden] après le reset — les author stylesheets (display:flex, etc.)
   écrasent le UA stylesheet, donc [hidden] ne cache plus rien sans ce correctif. */
[hidden] { display: none !important; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
  border-radius: 2px;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  line-height: 1.3;
  color: var(--ink);
}


/* ──────────────────────────────────────────────────────────────────
   4. BOUTONS
   ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 24px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  user-select: none;
  -webkit-user-select: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn:active:not(:disabled) {
  transform: scale(.98);
}

/* Bouton primaire — vert plein */
.btn-primary {
  background-color: var(--green);
  color: var(--white);
  border-color: var(--green);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--green-mid);
  border-color: var(--green-mid);
  color: var(--white);
  text-decoration: none;
  filter: brightness(.92);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Bouton secondaire — outline vert */
.btn-secondary {
  background-color: transparent;
  color: var(--green);
  border-color: var(--green);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--green-pale);
  color: var(--green);
  text-decoration: none;
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* Bouton ghost blanc — sur fond sombre uniquement */
.btn-ghost {
  background-color: rgba(255,255,255,.1);
  color: var(--white);
  border-color: rgba(255,255,255,.25);
}

.btn-ghost:hover:not(:disabled) {
  background-color: rgba(255,255,255,.18);
  color: var(--white);
  text-decoration: none;
}

.btn-ghost:focus-visible {
  outline: 2px solid rgba(255,255,255,.6);
  outline-offset: 2px;
}

/* Bouton danger — rouge */
.btn-danger {
  background-color: var(--red);
  color: var(--white);
  border-color: var(--red);
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(.9);
  color: var(--white);
  text-decoration: none;
}

.btn-danger:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* Bouton or — don ⚠️ texte --ink (PAS blanc, ratio blanc/or = 2.96:1 ❌) */
.btn-gold {
  background-color: var(--gold);
  color: var(--ink);       /* 4.85:1 ✅ */
  border-color: var(--gold);
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(.92);
  color: var(--ink);
  text-decoration: none;
}

.btn-gold:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Taille large (hero CTA) */
.btn-lg {
  padding: 14px 32px;
  font-size: 15px;
}

/* Taille petite (admin table) */
.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 6px;
}


/* ──────────────────────────────────────────────────────────────────
   5. BADGES / PILLS
   ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  white-space: nowrap;
}

.badge-green {
  background-color: #e8f5ee;   /* sémantique — ne suit PAS la couleur tenant */
  color: #1a6b3f;              /* vert validé fixe — 5.82:1 ✅ */
}

.badge-gold {
  background-color: var(--gold-light);
  color: var(--ink);      /* 13.32:1 ✅ — or interdit comme texte */
  border-color: color-mix(in srgb, var(--gold) 30%, transparent);
}

.badge-red {
  background-color: var(--red-light);
  color: var(--red);      /* 4.89:1 ✅ */
  border-color: var(--red-border);
}

.badge-orange {
  background-color: var(--orange-light);
  color: var(--orange-dark);  /* 5.32:1 ✅ */
}

.badge-blue {
  background-color: var(--blue-light);
  color: var(--blue);     /* 5.17:1 ✅ */
}

.badge-muted {
  background-color: var(--cream);
  color: var(--muted);    /* 6.22:1 ✅ */
  border-color: var(--border);
}


/* ──────────────────────────────────────────────────────────────────
   6. CARD
   ────────────────────────────────────────────────────────────────── */
.card {
  background-color: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-lg {
  border-radius: var(--radius-lg);
  padding: 32px;
}


/* ──────────────────────────────────────────────────────────────────
   7. CHAMPS DE FORMULAIRE
   ────────────────────────────────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  height: 44px;          /* touch-target minimum */
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  background-color: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.form-field textarea {
  height: auto;
  min-height: 100px;
  padding: 12px 14px;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--muted);   /* 6.47:1 ✅ — PAS --soft */
  opacity: 1;
}

/* Focus */
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--green);
  border-width: 2px;
}

.form-field:focus-within label {
  color: var(--green);
}

/* Erreur */
.form-field.error input,
.form-field.error select,
.form-field.error textarea {
  border-color: var(--red);
  border-width: 2px;
  background-color: var(--red-light);
}

.form-field.error label {
  color: var(--red);
}

.form-field .field-error-msg {
  display: none;
  font-size: 12px;
  color: var(--red);
  font-weight: 500;
  gap: 4px;
  align-items: center;
}

.form-field.error .field-error-msg {
  display: flex;
}

/* Succès */
.form-field.success input,
.form-field.success select,
.form-field.success textarea {
  border-color: var(--green-mid);
  border-width: 2px;
  background-color: var(--green-pale);
}

.form-field.success label {
  color: var(--green-mid);
}

/* Désactivé */
.form-field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled {
  background-color: var(--cream);
  border-color: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

.form-field input:disabled::placeholder,
.form-field textarea:disabled::placeholder {
  color: var(--soft);
}


/* ──────────────────────────────────────────────────────────────────
   8. UTILITAIRES TEXTE
   ────────────────────────────────────────────────────────────────── */
.text-muted  { color: var(--muted) !important; }
.text-soft   { color: var(--soft)  !important; }   /* décoratif uniquement */
.text-green  { color: var(--green) !important; }
.text-red    { color: var(--red)   !important; }
.text-center { text-align: center; }
.text-right  { text-align: right;  }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* ──────────────────────────────────────────────────────────────────
   9. CONTAINER
   ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

@media (max-width: 680px) {
  .container {
    padding: 0 16px;
  }
}


/* ──────────────────────────────────────────────────────────────────
   10. CSS PRINT — récapitulatif d'inscription
   ────────────────────────────────────────────────────────────────── */
@media print {
  /* Page setup */
  @page {
    margin: 1.5cm;
    size: A4;
  }

  /* Masquer les éléments de navigation */
  nav,
  .navbar,
  .sidebar,
  .topbar,
  .progress-steps,
  .btn,
  .step-nav,
  footer,
  .toast,
  .modal {
    display: none !important;
  }

  /* Fond blanc, économiser l'encre */
  body,
  .container,
  .card,
  main {
    background: white !important;
    color: var(--ink) !important;
  }

  /* Ombres et effets coûteux */
  .card,
  * {
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
  }

  /* Couleurs de marque conservées */
  .text-green,
  h2, h3 {
    color: var(--green) !important;
  }

  /* Éviter les coupures maladroites */
  .card,
  .recap-section,
  tr {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Taille de police min print */
  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Liens : afficher l'URL */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: var(--muted);
  }

  a[href^="#"]::after,
  a[href^="javascript"]::after {
    content: "";
  }
}
