/* === SHARED.CSS — Formation : Renaître ===
   Variables, reset, composants partagés (boutons, toast, modal, utilitaires)
   ========================================================================= */

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --navy:      #173a63;
  --navy-2:    #0f2c4f;
  --navy-3:    #1e3a8a;
  --gold:      #cf982f;
  --gold-soft: #f4e4bc;
  --gold-bg:   #fdf6e8;
  --teal:      #317c78;
  --teal-2:    #1ab8d6;
  --paper:     #fffdf8;
  --white:     #ffffff;
  --ink:       #152338;
  --muted:     #617086;
  --light:     #e8ecf0;
  --light-2:   #f1f5f9;
  --danger:    #dc2626;
  --success:   #16a34a;

  --radius:    10px;
  --radius-lg: 18px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,.18);

  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-head: Georgia, 'Playfair Display', serif;

  --transition: 0.2s ease;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-3); }
a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ── Focus visible ───────────────────────────────────────────────────────── */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  min-height: 44px;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: var(--navy-2); box-shadow: var(--shadow-sm); }

.btn-gold {
  background: var(--gold);
  color: var(--white);
}
.btn-gold:hover { background: #b8841e; box-shadow: var(--shadow-sm); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--light);
}
.btn-ghost:hover { background: var(--light-2); color: var(--ink); }

.btn-danger {
  background: var(--danger);
  color: var(--white);
}
.btn-danger:hover { background: #b91c1c; }

.btn-sm { padding: 7px 14px; font-size: .9rem; min-height: 36px; }
.btn-lg { padding: 14px 32px; font-size: 1.1rem; min-height: 52px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--ink);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 50px;
  font-size: .95rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9000;
  opacity: 0;
  transition: transform .3s ease, opacity .3s ease;
  pointer-events: none;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 44, 79, .55);
  backdrop-filter: blur(3px);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 440px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.modal-box h3 { font-family: var(--font-head); font-size: 1.3rem; color: var(--navy); margin-bottom: 12px; }
.modal-box p  { color: var(--muted); margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Image avec fallback ─────────────────────────────────────────────────── */
.img-wrap { position: relative; }
.img-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  background: var(--light-2);
  border: 2px dashed var(--light);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
  padding: 16px;
}

/* ── Utilitaires ─────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.text-center { text-align: center; }
.text-muted  { color: var(--muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: 16px; }

/* ── Réduction des animations (accessibilité) ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
