/* =============================================================
   ENOFOCA, Institut Universitaire
   Feuille de style globale, direction « Atelier »
   L'idée : la formation comme un travail d'atelier. Un fil doré
   cousu relie les éléments, les cartes ressemblent à des étiquettes.
   ============================================================= */

:root {
  /* Couleurs de l'institut : marine et or */
  --encre: #0C1E3D;
  --encre-2: #14305E;
  --or: #C8962A;
  --or-vif: #E8B84B;
  --or-fonce: #8A6418;   /* or lisible sur fond clair */
  --papier: #FAF6EE;
  --sable: #F2EBDD;
  --blanc: #FFFFFF;
  --texte: #2E3A55;
  --texte-doux: #4A5878;
  --sur-encre: #C9D2E6;  /* texte secondaire sur fond marine */
  --filet: rgba(12, 30, 61, 0.14);
  --succes: #1E7A4C;
  --erreur: #B3261E;

  --titres: "Montserrat", "Segoe UI", Arial, sans-serif;
  --corps: "Poppins", "Segoe UI", Arial, sans-serif;

  --rayon: 12px;
  --ombre-etiquette: 4px 5px 0 rgba(12, 30, 61, 0.08);
  --ombre-douce: 0 14px 40px rgba(12, 30, 61, 0.10);
  --entete-h: 76px;
  --rebond: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---------- Base ---------- */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--entete-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--corps);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--texte);
  background: var(--papier);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, h4, h5 {
  margin: 0;
  font-family: var(--titres);
  color: var(--encre);
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4.2rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.7rem, 1.25rem + 1.9vw, 2.6rem); font-weight: 800; }
h3 { font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.45rem); font-weight: 700; }
h4 { font-size: 1.08rem; font-weight: 700; }

p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--or);
  outline-offset: 3px;
  border-radius: 6px;
}

.ico {
  width: 1.25em;
  height: 1.25em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.saut {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--encre);
  color: var(--blanc);
  text-decoration: none;
}
.saut:focus { top: 12px; }

/* ---------- Mise en page ---------- */

.conteneur {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

.section { padding-block: clamp(4rem, 3rem + 4vw, 6.5rem); }
.section-serree { padding-block: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.fond-blanc { background: var(--blanc); }
.fond-sable { background: var(--sable); }
.fond-encre { background: var(--encre); color: var(--sur-encre); }
.fond-encre h2, .fond-encre h3, .fond-encre h4 { color: var(--blanc); }

/* Bloc titre de section : un titre et un court texte, sans fioriture */
.titre-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 640px;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.titre-section p { font-size: 1.05rem; color: var(--texte-doux); }
.fond-encre .titre-section p { color: var(--sur-encre); }
.titre-section.centre { margin-inline: auto; text-align: center; align-items: center; }

.titre-ligne {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
}
.titre-ligne .titre-section { margin-bottom: 0; }

.surtitre {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--or-fonce);
}
.surtitre .ico { color: var(--or); }
.fond-encre .surtitre { color: var(--or-vif); }

/* Un mot souligné d'une couture dorée : réservé aux grands titres */
.cousu {
  border-bottom: 0.08em dashed var(--or);
  padding-bottom: 0.02em;
}

/* La couture elle-même, utilisée comme séparateur */
.couture {
  height: 0;
  border: 0;
  border-top: 2px dashed var(--or);
  margin: 0;
  opacity: 0.8;
}

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 3.25rem;
  padding: 0.85rem 1.6rem;
  border: 0;
  border-radius: 999px;
  font-family: var(--corps);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  transition: transform 0.25s var(--rebond), background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.98); }
.btn .ico { width: 1.1em; height: 1.1em; }

/* Bouton principal : marine, avec une piqûre dorée à l'intérieur */
.btn-plein {
  background: var(--encre);
  color: var(--papier);
  outline: 1.5px dashed var(--or-vif);
  outline-offset: -6px;
}
.btn-plein:hover { background: var(--encre-2); }
.btn-plein:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; }

.btn-or { background: var(--or-vif); color: var(--encre); }
.btn-or:hover { background: #F0C55E; }

.btn-ligne {
  background: transparent;
  color: var(--encre);
  box-shadow: inset 0 0 0 1.5px rgba(12, 30, 61, 0.3);
}
.btn-ligne:hover { box-shadow: inset 0 0 0 1.5px var(--encre); background: rgba(12, 30, 61, 0.04); }

.btn-clair {
  background: transparent;
  color: var(--blanc);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.5);
}
.btn-clair:hover { box-shadow: inset 0 0 0 1.5px var(--blanc); background: rgba(255, 255, 255, 0.08); }

.btn-petit { min-height: 2.75rem; padding: 0.6rem 1.15rem; font-size: 0.93rem; }
.btn-bloc { width: 100%; }

.lien-fleche {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--encre);
  text-decoration: none;
}
.lien-fleche .ico { transition: transform 0.25s ease; }
.lien-fleche:hover .ico { transform: translateX(4px); }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Étiquettes (cartes) ---------- */

.etiquette {
  position: relative;
  background: var(--blanc);
  border: 1.5px solid var(--encre);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-etiquette);
}

/* L'œillet de l'étiquette, par où passe le fil */
.oeillet {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--encre);
  background: var(--papier);
}

/* Pastille ronde avec une icône dorée et une piqûre */
.pastille {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: var(--encre);
  color: var(--or-vif);
  outline: 1.5px dashed var(--or-vif);
  outline-offset: -6px;
}
.pastille .ico { width: 1.5rem; height: 1.5rem; }
.pastille-claire { background: var(--sable); color: var(--encre); outline-color: var(--or); }

.puce-info {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--sable);
  color: var(--encre);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}
.puce-info .ico { width: 1em; height: 1em; color: var(--or-fonce); }

.liste-check { display: flex; flex-direction: column; gap: 0.55rem; }
.liste-check li { display: flex; gap: 0.6rem; align-items: flex-start; }
.liste-check .ico { margin-top: 0.25em; color: var(--or-fonce); width: 1.05em; height: 1.05em; }
.fond-encre .liste-check .ico { color: var(--or-vif); }

/* ---------- En-tête ---------- */

.entete {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 246, 238, 0.97);
  border-bottom: 1px solid var(--filet);
}

.entete-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: var(--entete-h);
}

.marque {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  margin-right: auto;
}
.marque img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: contain;
  background: var(--blanc);
  border: 1.5px dashed var(--or);
  padding: 2px;
}
.marque-texte { display: flex; flex-direction: column; line-height: 1.1; }
.marque-texte strong { font-family: var(--titres); font-size: 1.2rem; font-weight: 800; color: var(--encre); letter-spacing: 0.02em; }
.marque-texte small { font-size: 0.75rem; color: var(--texte-doux); }

.nav-principale { display: flex; gap: 0.15rem; }
.nav-principale a {
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--encre);
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.nav-principale a:hover { background: rgba(12, 30, 61, 0.06); }
.nav-principale a.actif { background: var(--encre); color: var(--papier); }

.entete-actions { display: flex; gap: 0.5rem; }

.burger {
  display: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid var(--filet);
  border-radius: 50%;
  background: var(--blanc);
  color: var(--encre);
}
.burger .ico { width: 22px; height: 22px; }

/* Menu mobile plein écran */
.menu-mobile {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) max(20px, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 24px) max(20px, env(safe-area-inset-left, 0px));
  background: var(--encre);
  color: var(--blanc);
  overflow-y: auto;
}
.menu-mobile .marque-texte strong { color: var(--blanc); }
.menu-mobile .marque-texte small { color: var(--sur-encre); }
.menu-mobile-haut { display: flex; align-items: center; justify-content: space-between; }
.menu-fermer {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: transparent;
  color: var(--blanc);
}
.menu-fermer .ico { width: 22px; height: 22px; }
.menu-mobile nav { display: flex; flex-direction: column; border-top: 2px dashed rgba(232, 184, 75, 0.5); }
.menu-mobile nav a {
  padding: 0.95rem 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: var(--titres);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--blanc);
  text-decoration: none;
}
.menu-mobile nav a.actif { color: var(--or-vif); }
.menu-mobile-actions { display: flex; flex-direction: column; gap: 0.75rem; margin-top: auto; }

/* ---------- En-tête des pages intérieures ---------- */

.hero-page {
  position: relative;
  overflow: hidden;
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem) clamp(3rem, 2rem + 3vw, 4.5rem);
  border-bottom: 1px solid var(--filet);
}

.hero-page-grille {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 4vw, 4.5rem);
  align-items: center;
}

.hero-page-texte { display: flex; flex-direction: column; gap: 1.25rem; }
.hero-page h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); }
.hero-page-texte > p { max-width: 560px; font-size: 1.1rem; color: var(--texte-doux); }

.ariane {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--texte-doux);
}
.ariane a { color: var(--encre); font-weight: 500; text-decoration: none; }
.ariane a:hover { text-decoration: underline; }
.ariane span[aria-hidden] { color: var(--or); }

/* Étiquette de faits clés à droite de l'en-tête */
.hero-page-etiquette {
  padding: 1.6rem 1.6rem 1.6rem 3rem;
  transform: rotate(1.5deg);
}
.hero-page-etiquette .oeillet { left: 1.1rem; top: 1.75rem; }
.hero-page-etiquette dl { margin: 0; display: grid; gap: 1rem; }
.hero-page-etiquette dl > div { display: flex; flex-direction: column; gap: 0.1rem; padding-bottom: 1rem; border-bottom: 1.5px dashed var(--filet); }
.hero-page-etiquette dl > div:last-child { padding-bottom: 0; border-bottom: 0; }
.hero-page-etiquette dt { font-size: 0.82rem; color: var(--texte-doux); }
.hero-page-etiquette dd { margin: 0; font-family: var(--titres); font-weight: 700; font-size: 1.15rem; color: var(--encre); }

/* ---------- Bande de chiffres ---------- */

.chiffres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.75rem 2rem;
}
.chiffre { display: flex; flex-direction: column; gap: 0.2rem; }
.chiffre strong {
  font-family: var(--titres);
  font-size: clamp(2rem, 1.6rem + 1.4vw, 2.8rem);
  font-weight: 800;
  line-height: 1;
  color: var(--or-vif);
  font-variant-numeric: tabular-nums;
}
.chiffre span { font-size: 0.92rem; line-height: 1.4; color: var(--sur-encre); }

/* ---------- Appel à l'action de fin de page ---------- */

.appel {
  position: relative;
  overflow: hidden;
  background: var(--encre);
  color: var(--sur-encre);
}
.appel-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto;
  gap: 2rem 3rem;
  align-items: center;
}
.appel h2 { color: var(--blanc); }
.appel p { margin-top: 1rem; max-width: 620px; font-size: 1.05rem; }
.appel .citation { font-style: italic; color: var(--blanc); }
.appel .actions { justify-content: flex-end; }
.appel-fil {
  position: absolute;
  left: 0;
  right: 0;
  top: 18px;
  border-top: 2px dashed rgba(232, 184, 75, 0.55);
}
.appel-fil-bas { top: auto; bottom: 18px; }

/* ---------- Formulaires ---------- */

.form-grille {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem 1.25rem;
}
.champ { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.champ-large { grid-column: 1 / -1; }
.champ label { font-size: 0.9rem; font-weight: 600; color: var(--encre); }
.champ .requis { color: var(--erreur); }
.champ input,
.champ select,
.champ textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.95rem;
  border: 1.5px solid rgba(12, 30, 61, 0.22);
  border-radius: 10px;
  background: var(--blanc);
  color: var(--encre);
  font-family: var(--corps);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.champ textarea { min-height: 8rem; resize: vertical; }
.champ input:focus,
.champ select:focus,
.champ textarea:focus {
  outline: none;
  border-color: var(--encre);
  box-shadow: 0 0 0 3px rgba(200, 150, 42, 0.3);
}
.champ input:disabled,
.champ select:disabled { background: var(--sable); color: var(--texte-doux); cursor: not-allowed; }
.champ .invalide { border-color: var(--erreur); }
.champ .aide { display: flex; gap: 0.4rem; align-items: center; font-size: 0.82rem; color: var(--texte-doux); }
.champ .aide .ico { width: 1em; height: 1em; }

.msg-form {
  display: none;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border-radius: 10px;
  font-size: 0.95rem;
}
.msg-form .ico { margin-top: 0.15em; }
.msg-form.succes { display: flex; background: #E6F3EC; color: var(--succes); border: 1.5px solid #9CCFB3; }
.msg-form.erreur { display: flex; background: #FBEAE8; color: var(--erreur); border: 1.5px solid #EDB1AB; }

.chargement { display: none; align-items: center; gap: 0.75rem; color: var(--texte-doux); font-size: 0.95rem; }
.chargement.actif { display: flex; }
.roue {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid var(--sable);
  border-top-color: var(--or);
  animation: tourner 0.8s linear infinite;
}

/* ---------- Pied de page ---------- */

.pied {
  position: relative;
  padding-top: clamp(3.5rem, 3rem + 2vw, 4.5rem);
  background: var(--encre);
  color: var(--sur-encre);
  font-size: 0.93rem;
}
.pied::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 14px;
  border-top: 2px dashed rgba(232, 184, 75, 0.5);
}

.pied-grille {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}
.pied-logo { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.pied-logo img { width: 52px; height: 52px; border-radius: 50%; background: var(--blanc); object-fit: contain; padding: 2px; }
.pied-logo strong { font-family: var(--titres); font-size: 1.05rem; color: var(--blanc); line-height: 1.25; }
.pied-marque p { max-width: 380px; }
.pied-marque em { color: var(--or-vif); font-style: normal; font-weight: 500; }
.pied-reseaux { display: flex; gap: 0.6rem; margin-top: 1.25rem; }
.pied-reseaux a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: var(--blanc);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.pied-reseaux a:hover { background: var(--or-vif); color: var(--encre); border-color: var(--or-vif); }

.pied-col h2 { margin-bottom: 1rem; font-size: 0.95rem; font-weight: 700; color: var(--blanc); letter-spacing: 0.02em; }
.pied-col ul { display: flex; flex-direction: column; gap: 0.5rem; }
.pied-col a { color: var(--sur-encre); text-decoration: none; }
.pied-col a:hover { color: var(--or-vif); }
.pied-contact li { display: flex; gap: 0.65rem; align-items: flex-start; }
.pied-contact .ico { margin-top: 0.2em; color: var(--or-vif); }
.pied-horaires li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed rgba(255, 255, 255, 0.14); padding-bottom: 0.45rem; }
.pied-horaires li span:last-child { color: var(--blanc); white-space: nowrap; }

.pied-bas {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: 3rem;
  padding-block: 1.5rem calc(env(safe-area-inset-bottom, 0px) + 1.5rem);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.85rem;
}
.pied-bas a { color: var(--sur-encre); }
.pied-bas a:hover { color: var(--or-vif); }

/* Bouton WhatsApp flottant */
.whatsapp-flottant {
  position: fixed;
  right: calc(env(safe-area-inset-right, 0px) + 20px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 40;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #1F9D55;
  color: var(--blanc);
  box-shadow: 0 10px 26px rgba(12, 30, 61, 0.25);
  transition: transform 0.25s var(--rebond);
}
.whatsapp-flottant:hover { transform: scale(1.08); }
.whatsapp-flottant .ico { width: 28px; height: 28px; stroke-width: 1.8; }

/* ---------- Animations ---------- */

@keyframes tourner { to { transform: rotate(360deg); } }
@keyframes coudre { to { stroke-dashoffset: -36; } }
@keyframes clignoter { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Écrans ---------- */

@media (max-width: 1280px) {
  .entete-inner { gap: 1rem; }
  .nav-principale a { padding-inline: 0.55rem; font-size: 0.9rem; }
  .entete-actions .btn-ligne { display: none; }
}

@media (max-width: 1180px) {
  .nav-principale, .entete-actions { display: none; }
  .burger { display: grid; }
}

@media (max-width: 960px) {
  .hero-page-grille { grid-template-columns: minmax(0, 1fr); }
  .hero-page-etiquette { transform: none; max-width: 520px; }
  .appel-inner { grid-template-columns: minmax(0, 1fr); }
  .appel .actions { justify-content: flex-start; }
  .pied-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pied-marque { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
  :root { --entete-h: 68px; }
  .marque img { width: 42px; height: 42px; }
  .form-grille { grid-template-columns: minmax(0, 1fr); }
  .pied-grille { grid-template-columns: minmax(0, 1fr); }
  .actions .btn { flex: 1 1 100%; }
  .whatsapp-flottant { width: 52px; height: 52px; }
}
