/* ============================================================
   EUDUC QUIZ — Design System Académique Premium
   ============================================================ */

:root {
  /* Couleurs charte EUDUC */
  --euduc-navy:        #011D4B;
  --euduc-navy-dark:   #00112E;
  --euduc-navy-light:  #022a6b;
  --euduc-blue:        #6683B2;
  --euduc-blue-soft:   #93A8C8;
  --euduc-gold:        #FFD231;
  --euduc-gold-soft:   #FFE685;

  /* Neutres */
  --white:        #FFFFFF;
  --slate-50:     #F8FAFC;
  --slate-100:    #F4F6FA;
  --slate-200:    #E5E9F0;
  --slate-300:    #D8DEE9;
  --slate-400:    #A7B1C2;
  --slate-500:    #6B7691;
  --slate-700:    #3C4858;
  --slate-900:    #1A2236;

  /* États */
  --success:      #1E8A5F;
  --success-soft: #E6F4EE;
  --danger:       #B23A48;
  --danger-soft:  #FCEAEC;
  --warning:      #D89B1F;

  /* Typographie */
  --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Ombres */
  --shadow-xs:    0 1px 2px rgba(1,29,75,0.05);
  --shadow-sm:    0 1px 3px rgba(1,29,75,0.08), 0 1px 2px rgba(1,29,75,0.04);
  --shadow-md:    0 4px 12px rgba(1,29,75,0.08);
  --shadow-lg:    0 12px 32px rgba(1,29,75,0.10);
  --shadow-xl:    0 24px 48px rgba(1,29,75,0.12);

  /* Rayons */
  --radius-sm:    4px;
  --radius:       8px;
  --radius-lg:    12px;
  --radius-xl:    20px;

  /* Transitions */
  --tr-fast:      150ms cubic-bezier(0.4, 0, 0.2, 1);
  --tr:           220ms cubic-bezier(0.4, 0, 0.2, 1);
  --tr-slow:      400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--slate-700);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--euduc-navy);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

a {
  color: var(--euduc-navy);
  text-decoration: none;
  transition: color var(--tr-fast);
}
a:hover { color: var(--euduc-blue); }

.lead {
  font-size: 1.125rem;
  color: var(--slate-500);
  line-height: 1.65;
}

.text-navy { color: var(--euduc-navy) !important; }
.text-blue { color: var(--euduc-blue) !important; }
.text-gold { color: var(--euduc-gold) !important; }
.text-muted-2 { color: var(--slate-500) !important; }

.bg-navy { background: var(--euduc-navy) !important; }
.bg-soft { background: var(--slate-100) !important; }

/* Numbers tabulaires */
.tabular { font-variant-numeric: tabular-nums; }

/* ============================================================
   BOUTONS
   ============================================================ */

.btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  transition: all var(--tr);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary-euduc {
  background: var(--euduc-navy);
  color: var(--white);
  border-color: var(--euduc-navy);
}
.btn-primary-euduc:hover {
  background: var(--euduc-navy-light);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-euduc {
  background: var(--white);
  color: var(--euduc-navy);
  border-color: var(--euduc-navy);
}
.btn-outline-euduc:hover {
  background: var(--euduc-navy);
  color: var(--white);
}

/* État SÉLECTIONNÉ explicite pour les bascules (btn-check) et boutons actifs.
   Sans cela, un toggle sélectionné ne se distinguait pas visuellement. */
.btn-check:checked + .btn-outline-euduc,
.btn-check:active + .btn-outline-euduc,
.btn-outline-euduc.active,
.btn-outline-euduc:active {
  background: var(--euduc-navy);
  color: var(--white);
  border-color: var(--euduc-navy);
  box-shadow: inset 0 0 0 2px rgba(255, 210, 49, 0.55);
}
.btn-check:checked + .btn-gold,
.btn-gold.active {
  box-shadow: inset 0 0 0 2px var(--euduc-navy);
}
.btn-check:focus-visible + .btn-outline-euduc {
  outline: 2px solid var(--euduc-blue);
  outline-offset: 2px;
}

/* Puces de thème cliquables (page Référentiels → banque de questions) */
.theme-chip { transition: transform .12s, box-shadow .12s; }
.theme-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(1, 29, 75, .18);
  filter: brightness(1.05);
}

.btn-gold {
  background: var(--euduc-gold);
  color: var(--euduc-navy);
  border-color: var(--euduc-gold);
  font-weight: 600;
}
.btn-gold:hover {
  background: var(--euduc-gold-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--euduc-navy);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--slate-100); }

.btn-lg { padding: 0.95rem 2rem; font-size: 1rem; }

/* ============================================================
   NAVBAR PUBLIQUE
   ============================================================ */

.navbar-euduc {
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--slate-200);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--tr);
}
.navbar-euduc.scrolled { box-shadow: var(--shadow-sm); }

.navbar-euduc .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--euduc-navy);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  line-height: 1;
}
.navbar-euduc .navbar-brand img { height: 38px; width: auto; }
.navbar-euduc .navbar-brand > div {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
}
.navbar-euduc .navbar-brand span:first-child {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 1px;
  line-height: 1;
}
.navbar-euduc .navbar-brand .brand-sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--slate-500);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 0;
  line-height: 1;
}

.navbar-euduc .nav-link {
  color: var(--slate-700);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.5rem 1rem !important;
  position: relative;
}
.navbar-euduc .nav-link:hover,
.navbar-euduc .nav-link.active {
  color: var(--euduc-navy);
}
.navbar-euduc .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--euduc-gold);
  border-radius: 2px;
}

/* ============================================================
   HERO PREMIUM
   ============================================================ */

.hero-euduc {
  position: relative;
  background: linear-gradient(135deg, #011D4B 0%, #032b6b 55%, #08407A 100%);
  color: var(--white);
  overflow: hidden;
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(5rem, 10vw, 8rem);
  isolation: isolate;
}

/* Image de fond superposée (à remplacer par une vraie photo HD) */
.hero-euduc::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 30%, rgba(255,210,49,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(102,131,178,0.18) 0%, transparent 55%);
  z-index: -1;
}

/* Image hero principale */
.hero-image-wrap {
  position: absolute;
  right: -5%;
  top: 50%;
  transform: translateY(-50%);
  width: 55%;
  height: 90%;
  z-index: -1;
  opacity: 0.35;
  background-image: url('https://images.unsplash.com/photo-1556761175-5973dc0f32e7?auto=format&fit=crop&w=1600&q=80');
  background-size: cover;
  background-position: center;
  mask-image: linear-gradient(to left, black 35%, transparent 95%);
  -webkit-mask-image: linear-gradient(to left, black 35%, transparent 95%);
}

/* Grille décorative légère */
.hero-grid-deco {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: -1;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(255,210,49,0.12);
  border: 1px solid rgba(255,210,49,0.35);
  color: var(--euduc-gold);
  padding: 0.45rem 1rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  animation: fadeInUp 0.7s ease-out;
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  background: var(--euduc-gold);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255,210,49,0.7);
  animation: pulse 2.2s infinite;
}

.hero-euduc h1 {
  color: var(--white);
  font-weight: 700;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  animation: fadeInUp 0.9s ease-out 0.1s both;
}
.hero-euduc h1 .accent {
  background: linear-gradient(90deg, var(--euduc-gold) 0%, var(--euduc-gold-soft) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-euduc .hero-sub {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: rgba(255,255,255,0.82);
  margin-bottom: 2.5rem;
  max-width: 38rem;
  line-height: 1.6;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 1.1s ease-out 0.3s both;
}

.btn-hero-primary {
  background: var(--euduc-gold);
  color: var(--euduc-navy);
  border: none;
  padding: 1rem 2rem;
  font-weight: 600;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all var(--tr);
  text-decoration: none;
}
.btn-hero-primary:hover {
  background: #FFDB52;
  color: var(--euduc-navy);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255,210,49,0.35);
}

.btn-hero-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.25);
  padding: 1rem 2rem;
  font-weight: 500;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all var(--tr);
  text-decoration: none;
  backdrop-filter: blur(8px);
}
.btn-hero-secondary:hover {
  background: rgba(255,255,255,0.15);
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}

/* Indicateurs de confiance hero */
.hero-trust {
  margin-top: 3.5rem;
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  animation: fadeInUp 1.2s ease-out 0.4s both;
}
.hero-trust-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
}
.hero-trust-item .icon {
  width: 36px; height: 36px;
  background: rgba(255,210,49,0.15);
  border: 1px solid rgba(255,210,49,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--euduc-gold);
}

/* Carte flottante hero (visualisation analytique) */
.hero-visual {
  position: relative;
  animation: fadeInUp 1.3s ease-out 0.5s both;
}
.hero-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.hero-card-title { color: var(--white); font-weight: 600; font-size: 0.95rem; }
.hero-card-badge {
  background: rgba(30,138,95,0.2);
  color: #5BE0A0;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  font-weight: 500;
}

.hero-kpi-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.hero-kpi {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius);
  padding: 0.9rem;
}
.hero-kpi .label {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.hero-kpi .value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

/* Mini-graphique animé SVG */
.hero-chart {
  height: 90px;
  margin-top: 0.5rem;
}
.hero-chart path.line {
  fill: none;
  stroke: var(--euduc-gold);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: drawLine 2s ease-out 0.8s forwards;
}
.hero-chart path.area {
  fill: url(#hero-gradient);
  opacity: 0;
  animation: fadeIn 1s ease-out 2.5s forwards;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes drawLine {
  to { stroke-dashoffset: 0; }
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,210,49,0.7); }
  70% { box-shadow: 0 0 0 10px rgba(255,210,49,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,210,49,0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.float-anim { animation: float 4s ease-in-out infinite; }

/* Reveal au scroll (déclenché par JS) */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   SECTIONS GÉNÉRIQUES
   ============================================================ */

.section {
  padding: clamp(3.5rem, 7vw, 6rem) 0;
}
.section-soft { background: var(--slate-50); }

.section-eyebrow {
  color: var(--euduc-blue);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.7rem;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--euduc-navy);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section-intro {
  font-size: 1.1rem;
  color: var(--slate-500);
  max-width: 42rem;
  line-height: 1.65;
}

/* ============================================================
   CARTES STATISTIQUES
   ============================================================ */

.stats-bar {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  margin-top: -4rem;
  position: relative;
  z-index: 10;
}

.stat-item {
  text-align: center;
  padding: 0.5rem;
}
.stat-item .value {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--euduc-navy);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  margin-bottom: 0.3rem;
}
.stat-item .label {
  font-size: 0.85rem;
  color: var(--slate-500);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.stat-item .icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.8rem;
  background: var(--slate-100);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--euduc-navy);
}

/* ============================================================
   CARTES "PORTE D'ENTRÉE" (étudiant / enseignant / admin)
   ============================================================ */

.access-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  height: 100%;
  transition: all var(--tr);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.access-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--euduc-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--tr);
}
.access-card:hover {
  border-color: var(--euduc-blue);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.access-card:hover::before { transform: scaleX(1); }

.access-card .icon-wrap {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, var(--slate-100), var(--white));
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--euduc-navy);
  margin-bottom: 1.5rem;
}
.access-card h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}
.access-card p {
  color: var(--slate-500);
  flex: 1;
}
.access-card .arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--euduc-navy);
  font-weight: 600;
  font-size: 0.95rem;
  margin-top: 1rem;
  transition: gap var(--tr);
}
.access-card:hover .arrow-link { gap: 0.7rem; }

/* ============================================================
   CATALOGUE / FILIÈRES
   ============================================================ */

.filiere-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: all var(--tr);
  text-decoration: none;
  display: block;
}
.filiere-card:hover {
  border-color: var(--euduc-navy);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.filiere-card .niveau {
  font-size: 0.78rem;
  color: var(--euduc-blue);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.filiere-card .titre {
  color: var(--euduc-navy);
  font-weight: 600;
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}
.filiere-card .meta {
  font-size: 0.85rem;
  color: var(--slate-500);
}

/* ============================================================
   QUIZ CARDS
   ============================================================ */

.quiz-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--tr);
  height: 100%;
  display: flex;
  flex-direction: column;
}
.quiz-card:hover {
  border-color: var(--euduc-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.quiz-card .tag {
  display: inline-block;
  background: var(--slate-100);
  color: var(--euduc-navy);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 100px;
  margin-bottom: 0.8rem;
}
.quiz-card h4 {
  color: var(--euduc-navy);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.quiz-card .matiere {
  color: var(--slate-500);
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
}
.quiz-card .meta-row {
  display: flex;
  gap: 1.2rem;
  font-size: 0.85rem;
  color: var(--slate-500);
  margin-bottom: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-100);
}
.quiz-card .meta-row .item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer-euduc {
  background: var(--euduc-navy);
  color: rgba(255,255,255,0.78);
  padding: 4rem 0 1.5rem;
  margin-top: 5rem;
}
.footer-euduc h5 {
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.footer-euduc a {
  color: rgba(255,255,255,0.7);
  font-size: 0.92rem;
  text-decoration: none;
  display: block;
  padding: 0.3rem 0;
  transition: color var(--tr-fast);
}
.footer-euduc a:hover { color: var(--euduc-gold); }
.footer-euduc .footer-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.footer-euduc .footer-brand img { height: 40px; }
.footer-euduc .footer-brand span {
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.5rem;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.55);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================================
   FORMULAIRES
   ============================================================ */

.form-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.form-label {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--slate-700);
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  border: 1.5px solid var(--slate-300);
  border-radius: var(--radius);
  padding: 0.7rem 0.95rem;
  font-size: 0.95rem;
  height: auto;
  transition: border-color var(--tr-fast), box-shadow var(--tr-fast);
}
.form-control:focus, .form-select:focus {
  border-color: var(--euduc-blue);
  box-shadow: 0 0 0 4px rgba(102,131,178,0.15);
  outline: none;
}

/* ============================================================
   ALERTES
   ============================================================ */

.alert-soft-success {
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid rgba(30,138,95,0.25);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
}
.alert-soft-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(178,58,72,0.25);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  font-size: 0.92rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 991.98px) {
  .hero-image-wrap { opacity: 0.18; width: 75%; }
  .hero-visual { margin-top: 3rem; }
  .stats-bar { margin-top: -2rem; padding: 1.5rem; }
}

@media (max-width: 575.98px) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn-hero-primary,
  .hero-actions .btn-hero-secondary { justify-content: center; }
}

/* Préférence "reduce motion" */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   CERTIFICAT INSTITUTIONNEL EUDUC
   Style diplôme académique premium (inspiration Harvard / HEC)
   ============================================================ */

.certificate-premium {
  background: radial-gradient(ellipse at top, #FDFBF5 0%, #FFFFFF 60%), #FFFFFF;
  border: 1px solid #D8DEE9;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 24px 50px rgba(1,29,75,0.14),
    0 0 0 1px rgba(1,29,75,0.04);
  font-family: 'Cormorant Garamond', Georgia, serif;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 540px;          /* hauteur garantie au lieu d'aspect-ratio */
  display: block;
}

/* Cadre ornemental imbriqué — bordures relatives */
.certificate-premium::before,
.certificate-premium::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.certificate-premium::before {
  inset: 12px;
  border: 1px solid var(--euduc-navy);
  border-radius: 2px;
}
.certificate-premium::after {
  inset: 16px;
  border: 1px solid var(--euduc-gold);
  border-radius: 2px;
}

/* Coins ornementaux — taille réduite et bien positionnés */
.cert-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
  z-index: 2;
}
.cert-corner svg { width: 100%; height: 100%; display: block; }
.cert-corner.tl { top: 10px; left: 10px; }
.cert-corner.tr { top: 10px; right: 10px; transform: scaleX(-1); }
.cert-corner.bl { bottom: 10px; left: 10px; transform: scaleY(-1); }
.cert-corner.br { bottom: 10px; right: 10px; transform: scale(-1, -1); }

/* Corps : empilement vertical, padding suffisant pour ne pas toucher les bordures */
.cert-body {
  position: relative;
  z-index: 1;
  padding: 2.2rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cert-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.cert-header img { height: 32px; }
.cert-ref {
  font-family: 'Inter', sans-serif;
  font-size: .62rem;
  color: var(--slate-500);
  letter-spacing: .08em;
  text-align: right;
  line-height: 1.3;
}
.cert-ref strong { color: var(--euduc-navy); font-weight: 600; }

.cert-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: .62rem;
  color: var(--euduc-blue);
  letter-spacing: .3em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: .3rem;
}

.cert-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  color: var(--euduc-navy);
  font-size: 1.7rem;
  letter-spacing: .02em;
  line-height: 1.15;
  margin: 0 0 .3rem;
}
.cert-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--euduc-gold);
}

.cert-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin: .6rem auto;
}
.cert-divider .line {
  flex: 0 1 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--euduc-gold), transparent);
}
.cert-divider .diamond {
  width: 6px; height: 6px;
  background: var(--euduc-gold);
  transform: rotate(45deg);
}

.cert-preamble {
  font-family: 'Inter', sans-serif;
  font-size: .72rem;
  color: var(--slate-500);
  letter-spacing: .04em;
  margin: .2rem 0;
}

.cert-name {
  font-family: 'Great Vibes', 'Cormorant Garamond', cursive, serif;
  font-size: 2.2rem;
  color: var(--euduc-navy);
  line-height: 1.1;
  margin: .3rem 0 .5rem;
  font-weight: 400;
  word-wrap: break-word;
}

.cert-mention {
  font-family: 'Cormorant Garamond', serif;
  font-size: .95rem;
  color: var(--slate-700);
  line-height: 1.5;
  margin: .3rem auto;
  max-width: 90%;
}

.cert-quiz-name {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 600;
  color: var(--euduc-navy);
  font-size: 1.05rem;
  font-style: italic;
  margin: .2rem auto .4rem;
  line-height: 1.3;
  max-width: 90%;
}

.cert-meta {
  font-family: 'Inter', sans-serif;
  font-size: .68rem;
  color: var(--euduc-blue);
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Pied de certificat : 3 colonnes équilibrées */
.cert-foot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: .5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed #D8DEE9;
}

.cert-col {
  text-align: center;
  min-width: 0;     /* ✅ empêche l'overflow grid */
}

.cert-signature svg {
  display: block;
  margin: 0 auto .2rem;
  max-width: 100%;
  height: auto;
}
.cert-line {
  width: 80%;
  max-width: 110px;
  height: 1px;
  background: var(--slate-400);
  margin: .1rem auto .2rem;
}
.cert-label {
  font-family: 'Inter', sans-serif;
  font-size: .58rem;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
}
.cert-sub {
  font-family: 'Cormorant Garamond', serif;
  font-size: .8rem;
  color: var(--euduc-navy);
  font-style: italic;
  line-height: 1.2;
}
.cert-date {
  font-family: 'Cormorant Garamond', serif;
  font-size: .92rem;
  color: var(--euduc-navy);
  font-weight: 600;
  font-style: italic;
  line-height: 1.2;
}

.cert-qr {
  width: 48px; height: 48px;
  background: white;
  border: 1.5px solid var(--euduc-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  margin: 0 auto .2rem;
}
.cert-qr i { font-size: 1.8rem; color: var(--euduc-navy); }
.cert-code {
  font-family: 'Inter', monospace;
  font-size: .6rem;
  color: var(--slate-500);
  letter-spacing: .05em;
}

.cert-ribbon {
  position: absolute;
  top: -12px;
  right: 24px;
  background: linear-gradient(135deg, var(--euduc-gold) 0%, #F4C014 100%);
  color: var(--euduc-navy);
  font-family: 'Inter', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  padding: .4rem .9rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  border-radius: 100px;
  box-shadow: 0 6px 14px rgba(255,210,49,0.4);
  z-index: 3;
  white-space: nowrap;
}

/* Sceau en filigrane (caché par défaut, visible sur desktop large) */
.cert-seal {
  display: none;
}
@media (min-width: 1200px) {
  .cert-seal {
    display: block;
    position: absolute;
    bottom: 38%;
    right: 8%;
    width: 70px;
    height: 70px;
    z-index: 0;
    opacity: 0.08;
    pointer-events: none;
  }
}

/* Responsive : empiler le pied sur mobile */
@media (max-width: 575.98px) {
  .cert-foot { grid-template-columns: 1fr; gap: 1rem; padding-top: 1rem; }
  .certificate-premium { aspect-ratio: auto; }
  .cert-body { padding: 1.5rem 1.2rem; }
}
