/* ============================================================
   THÈME v2 « Nuit & Orange » — commun aux sites candidatures et
   entretiens, aligné sur ms-procedures.com (septembre 2026).
   Chargé APRÈS style.css : il ne fait que surcharger l'apparence,
   aucun identifiant ni comportement n'est modifié.
   ============================================================ */

@font-face { font-family: 'Poppins'; font-weight: 400; font-display: swap; src: url(fonts/poppins-400.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url(fonts/poppins-500.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 600; font-display: swap; src: url(fonts/poppins-600.woff2) format('woff2'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url(fonts/poppins-700.woff2) format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-weight: 500 800; font-display: swap; src: url(fonts/bricolage-grotesque.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url(fonts/instrument-serif-italic.woff2) format('woff2'); }

:root {
  --brand-primary: #00513F;
  --brand-dark: #003D32;
  --brand-accent: #F58200;
  --brand-light: #F3F8F6;
  --night: #061C17;
  --ink: #08251F;
  --cream: #FBF7F0;
  --text: #08251F;
  --muted: rgba(8, 37, 31, .6);
  --border: rgba(0, 81, 63, .12);
  --radius: 26px;
  --shadow: 0 24px 70px rgba(0, 61, 50, .12);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}
::selection { background: rgba(245, 130, 0, .22); }

/* Halos de couleur qui dérivent lentement derrière la page */
body::before, body::after {
  content: ''; position: fixed; z-index: -1; border-radius: 50%;
  filter: blur(110px); pointer-events: none;
  animation: v2-drift 22s ease-in-out infinite;
}
body::before { width: 34rem; height: 34rem; left: -12rem; top: 30vh; background: rgba(45, 172, 149, .22); }
body::after { width: 30rem; height: 30rem; right: -10rem; bottom: -8rem; background: rgba(245, 130, 0, .2); animation-direction: reverse; animation-duration: 28s; }
@keyframes v2-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, 40px) scale(1.12); }
  66% { transform: translate(-40px, 70px) scale(.94); }
}

h1, h2, h3, .choice-title, .big-score, .timer, .question-prompt {
  font-family: 'Bricolage Grotesque', 'Poppins', sans-serif;
  letter-spacing: -.02em;
}
h1 { color: var(--ink); font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; line-height: 1.05; }
h2 { color: var(--ink); font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 700; line-height: 1.1; }
h3 { color: var(--ink); font-weight: 600; }
.accent-word {
  font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-weight: 400;
  color: var(--brand-accent); letter-spacing: -.01em;
}

/* ---- Menu : pilule flottante translucide ---- */
.topbar {
  position: sticky; top: 12px; z-index: 50;
  max-width: 1100px; margin: 12px auto 0; width: calc(100% - 24px);
  justify-content: center;
  padding: 8px 22px;
  background: rgba(255, 255, 255, .75);
  -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
  border: 1px solid var(--border); border-radius: 999px;
  box-shadow: 0 10px 40px rgba(0, 61, 50, .10);
}
.topbar img { height: 76px; }

/* ---- Bandeau d'en-tête nuit ---- */
.v2-hero {
  position: relative; isolation: isolate; overflow: hidden;
  max-width: 1100px; width: calc(100% - 24px); margin: 16px auto 0;
  padding: clamp(40px, 7vw, 76px) clamp(24px, 6vw, 64px) clamp(80px, 10vw, 110px);
  border-radius: 40px; background: var(--night); color: #fff;
}
.v2-hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%); mask-image: radial-gradient(ellipse at 30% 40%, #000 30%, transparent 75%);
}
.v2-hero .halo { position: absolute; z-index: -1; border-radius: 50%; filter: blur(120px); animation: v2-drift 18s ease-in-out infinite; }
.v2-hero .halo-1 { width: 32rem; height: 32rem; left: -10rem; top: -14rem; background: rgba(45, 172, 149, .35); }
.v2-hero .halo-2 { width: 30rem; height: 30rem; right: -6rem; bottom: -18rem; background: rgba(245, 130, 0, .32); animation-duration: 24s; animation-direction: reverse; }
.v2-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .15);
  font-size: .75rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: rgba(255, 255, 255, .85);
}
.v2-eyebrow .point { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-accent); box-shadow: 0 0 0 0 rgba(245,130,0,.6); animation: v2-ping 2s infinite; }
@keyframes v2-ping { 0% { box-shadow: 0 0 0 0 rgba(245,130,0,.6); } 80%, 100% { box-shadow: 0 0 0 10px rgba(245,130,0,0); } }
.v2-hero h1 { color: #fff; font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: 1; letter-spacing: -.035em; margin: 22px 0 16px; max-width: 16ch; }
.v2-hero p { margin: 0; max-width: 40rem; font-size: 1.1rem; line-height: 1.7; color: rgba(255, 255, 255, .72); }
.v2-hero > * { animation: v2-rise .9s var(--ease) both; }
.v2-hero > h1 { animation-delay: .08s; }
.v2-hero > p { animation-delay: .16s; }
@keyframes v2-rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* La carte vient chevaucher le bandeau */
#app { max-width: 920px; padding: 0 16px 80px; margin-top: -64px; position: relative; z-index: 1; }

/* ---- Cartes ---- */
.card {
  border: 1px solid var(--border); border-radius: 32px;
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 44px);
  background: #fff;
}
.screen { animation: v2-rise .6s var(--ease); }
.lead { font-size: 1.12rem; line-height: 1.7; }

/* ---- Choix (postes, mode chrono, suite) ---- */
.choices { gap: 12px; }
.choice {
  text-align: left; align-items: flex-start;
  padding: 18px 22px; border: 1px solid var(--border); border-radius: 22px;
  background: #fff; color: var(--ink);
  transition: transform .9s var(--ease), box-shadow .6s var(--ease), background .5s var(--ease), border-color .5s;
}
.choice:hover { background: #fff; color: var(--ink); transform: scale(1.02); border-color: rgba(245, 130, 0, .45); box-shadow: 0 18px 45px rgba(0, 61, 50, .10); }
.choice-title { font-size: 1.12rem; font-weight: 600; }
.choice-desc { color: var(--muted); opacity: 1; font-size: .9rem; line-height: 1.5; }
.choice.selected, .choice.selected:hover {
  background: var(--night); color: #fff; border-color: var(--night);
  box-shadow: 0 0 0 3px rgba(245, 130, 0, .55), 0 20px 50px rgba(6, 28, 23, .25);
}
.choice.selected .choice-desc { color: rgba(255, 255, 255, .72); }

/* ---- Formulaires ---- */
label { font-weight: 600; font-size: .9rem; color: var(--ink); }
input, select, textarea {
  border: 1px solid var(--border); border-radius: 16px; padding: 13px 16px;
  background: #fff; transition: border-color .3s, box-shadow .3s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 4px rgba(245, 130, 0, .15);
}
input[type="file"] { padding: 10px; border-style: dashed; background: var(--brand-light); }

/* ---- Boutons ---- */
.btn-primary, .btn-ghost, .btn-download, .btn-ghost-link, .btn-video, .btn-rec, .btn-eval, .btn-son, .btn-passer-question {
  font-family: inherit; border-radius: 999px;
  transition: transform .6s var(--ease), background .4s, color .4s, box-shadow .4s, border-color .4s;
}
.btn-primary {
  background: var(--brand-accent); color: #fff; padding: 15px 28px; font-weight: 700;
  box-shadow: 0 0 0 1px rgba(245, 130, 0, .25), 0 18px 45px rgba(245, 130, 0, .28);
}
.btn-primary:hover:not(:disabled) { background: #ff8f0f; transform: scale(1.04); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid rgba(8, 37, 31, .2); padding: 15px 26px; }
.btn-ghost:hover { background: var(--ink); color: #fff; transform: scale(1.03); }
.btn-download, .btn-video { background: var(--ink); color: #fff; padding: 12px 22px; }
.btn-download:hover, .btn-video:hover:not(:disabled) { background: var(--brand-primary); transform: scale(1.04); }
.btn-ghost-link { border-radius: 999px; border: 1px solid rgba(8, 37, 31, .2); color: var(--ink); padding: 12px 22px; }
.btn-ghost-link:hover { background: var(--ink); color: #fff; }
.btn-rec { border: 1px solid rgba(8, 37, 31, .2); color: var(--ink); padding: 12px 20px; }
.btn-rec:hover { background: var(--ink); color: #fff; }
.btn-rec.recording { background: #d93a2b; border-color: #d93a2b; color: #fff; box-shadow: 0 0 0 6px rgba(217, 58, 43, .18); }
.btn-eval { border-radius: 20px; }
.btn-eval.oui { border-color: var(--brand-primary); color: var(--brand-primary); }
.btn-eval.oui:hover, .btn-eval.oui.actif { background: var(--brand-primary); color: #fff; }
.btn-son { border-color: var(--ink); color: var(--ink); }

/* ---- Pastilles, encadrés ---- */
.badge { background: rgba(245, 130, 0, .12); color: var(--brand-accent); letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; padding: 6px 14px; }
.score { background: var(--night); color: #fff; }
.notice, .consigne, .doc-secours, .video-secours {
  background: rgba(245, 130, 0, .08); border-left: none; border-radius: 18px; color: #6b4a14;
  box-shadow: inset 0 0 0 1px rgba(245, 130, 0, .18);
}
.rgpd { border-radius: 20px; background: #fff; border-color: var(--border); }
.rgpd summary { padding: 14px 18px; color: var(--muted); }
.video-bloc, .guide-bloc, .contact-bloc, .recap-bloc, .rec-box {
  border-radius: 24px; border: 1px solid var(--border); background: var(--brand-light);
}
.autoeval { border-radius: 24px; background: rgba(245, 130, 0, .07); border: 1px solid rgba(245, 130, 0, .2); }
.box { border-radius: 18px; border-left: none; padding: 16px 20px; }
.box-neutral { background: #f4f6f5; }
.box-attente { background: rgba(245, 130, 0, .08); padding-left: 38px; }
.box-modele { background: var(--brand-light); box-shadow: inset 4px 0 0 var(--brand-primary); }
.verdict { border-radius: 18px; }
.formation { border-radius: 20px; border: 1px dashed rgba(0, 81, 63, .22); background: #fff; }
.reprise { border-radius: 20px; background: var(--brand-light); border-color: var(--border); }

/* ---- Test : chronomètre ---- */
.timer { color: var(--ink); font-size: 1.5rem; }
.timer.danger { color: #d93a2b; }
.timer-bar { height: 10px; background: rgba(0, 81, 63, .08); }
#timerFill { background: linear-gradient(90deg, var(--brand-accent), #FFB347); border-radius: 99px; }
#timerFill.danger { background: #d93a2b; }
.question-prompt { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 600; line-height: 1.3; color: var(--ink); }
.big-score { color: var(--brand-accent); font-size: clamp(3rem, 8vw, 4.5rem); }
#screen-feedback h3 { color: var(--brand-accent); letter-spacing: .14em; font-size: .78rem; font-family: 'Poppins', sans-serif; font-weight: 700; }

/* ---- Envoi / merci ---- */
.spinner { border-color: rgba(0, 81, 63, .1); border-top-color: var(--brand-accent); }
.checkmark {
  background: linear-gradient(135deg, var(--brand-accent), #FFB347); color: #fff;
  box-shadow: 0 18px 45px rgba(245, 130, 0, .35);
  animation: v2-pop .8s var(--ease) both;
}
@keyframes v2-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- Bouton des sons ---- */
.v2-son {
  position: fixed; left: 18px; bottom: 18px; z-index: 60;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
  background: rgba(255, 255, 255, .8); color: var(--brand-primary); cursor: pointer;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: 0 18px 45px rgba(0, 61, 50, .10);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .5s var(--ease), color .3s;
}
.v2-son:hover { transform: scale(1.1); color: var(--brand-accent); }
.v2-son svg { width: 20px; height: 20px; }

/* ---- Bandeau compact dès qu'on quitte l'écran d'accueil ---- */
body:has(#screen-welcome:not(.active)) .v2-hero {
  padding-top: 28px; padding-bottom: 84px;
}
body:has(#screen-welcome:not(.active)) .v2-hero h1 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 14px 0 0; max-width: none; }
body:has(#screen-welcome:not(.active)) .v2-hero > p:not(.v2-eyebrow) { display: none; }

/* ============================================================
   ACCUEIL v2 : en-tête, étapes, grandes cartes de choix
   ============================================================ */
.v2-ic { width: 20px; height: 20px; flex-shrink: 0; }
.card.v2-accueil { text-align: left; }
.v2-etiquette {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: .72rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--brand-accent);
}
.v2-etiquette::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-accent); }
.card > .v2-etiquette { display: flex; }
.v2-entete { margin-bottom: 28px; }
.v2-entete h2, .card > h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1.05; letter-spacing: -.03em; margin: 0 0 12px; }
.v2-entete .muted { margin: 0; font-size: 1.02rem; line-height: 1.7; max-width: 44rem; }
.v2-sous-titre { font-size: 1.3rem; margin: 0 0 16px; }
.v2-bloc { margin-top: 34px; }

/* Étapes numérotées */
.v2-etapes { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.v2-etapes li {
  position: relative; padding: 22px 20px 20px; border-radius: 24px;
  background: var(--cream); border: 1px solid rgba(8, 37, 31, .06);
  transition: transform .9s var(--ease), box-shadow .6s var(--ease), background .5s;
}
.v2-etapes li:hover { transform: scale(1.03); background: #fff; box-shadow: 0 18px 45px rgba(0, 61, 50, .10); }
.v2-num { position: absolute; right: 18px; top: 12px; font-family: 'Instrument Serif', Georgia, serif; font-style: italic; font-size: 2rem; color: rgba(8, 37, 31, .18); transition: color .5s; }
.v2-etapes li:hover .v2-num { color: var(--brand-accent); }
.v2-etape-ic {
  display: inline-flex; width: 44px; height: 44px; border-radius: 14px; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(45, 172, 149, .18), rgba(245, 130, 0, .12)); color: var(--brand-primary);
}
.v2-etapes h3 { margin: 16px 0 6px; font-size: 1.1rem; }
.v2-etapes p { margin: 0; font-size: .9rem; line-height: 1.6; color: var(--muted); }
.v2-etapes strong { color: var(--ink); }

/* Grandes cartes de choix */
.choices.v2-choix-grille { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 0; }
.v2-choix-grille .choice { position: relative; padding: 22px 56px 22px 22px; gap: 6px; min-height: 100%; }
.choice-icone {
  display: inline-flex; width: 48px; height: 48px; border-radius: 16px; align-items: center; justify-content: center;
  background: rgba(245, 130, 0, .1); color: var(--brand-accent); margin-bottom: 10px;
  transition: background .5s, color .5s, transform .9s var(--ease);
}
.choice-icone .v2-ic { width: 22px; height: 22px; }
.choice:hover .choice-icone { transform: rotate(-6deg) scale(1.06); }
.choice.selected .choice-icone { background: var(--brand-accent); color: #fff; }
.choice-coche {
  position: absolute; right: 18px; top: 18px; width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid rgba(8, 37, 31, .2); transition: background .4s, border-color .4s, transform .5s var(--ease);
}
.choice.selected .choice-coche { background: var(--brand-accent); border-color: var(--brand-accent); transform: scale(1.08); }
.choice.selected .choice-coche::after {
  content: ''; position: absolute; left: 7.5px; top: 4px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.2px 2.2px 0; transform: rotate(45deg);
}
/* Cartes de choix de la page de résultat (sans pastille) */
.suite-options .choice { text-align: left; }

/* Guide */
.v2-guide { display: flex; gap: 18px; align-items: flex-start; padding: 24px; margin-top: 18px; }
.v2-guide h3 { margin: 2px 0 6px; font-size: 1.12rem; }
.v2-guide-ic { display: inline-flex; flex-shrink: 0; width: 52px; height: 52px; border-radius: 16px; align-items: center; justify-content: center; background: var(--night); color: var(--brand-accent); }
.v2-guide-ic .v2-ic { width: 24px; height: 24px; }
.btn-ghost-link, .btn-download { display: inline-flex; align-items: center; gap: 8px; }
.btn-ghost-link .v2-ic, .btn-download .v2-ic, .btn-son .v2-ic { width: 17px; height: 17px; }

/* Encadré d'information */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; line-height: 1.6; }
.notice > .v2-ic { color: var(--brand-accent); margin-top: 2px; }

/* RGPD */
.rgpd summary { display: flex; align-items: center; gap: 10px; }
.rgpd summary .v2-ic { width: 17px; height: 17px; color: var(--brand-primary); }

/* Titres avec icône */
.v2-titre-ic { display: flex; align-items: center; gap: 10px; }
.v2-titre-ic .v2-ic { width: 22px; height: 22px; color: var(--brand-accent); }

/* Règles en coches (écran d'introduction du test) */
.rules { list-style: none; padding: 0; margin: 18px 0; text-align: left; }
.rules li { position: relative; padding: 12px 16px 12px 50px; margin-bottom: 8px; background: var(--cream); border-radius: 16px; line-height: 1.6; }
.rules li::before {
  content: ''; position: absolute; left: 16px; top: 14px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.card.center .rules { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Barre de progression dans le bandeau */
.v2-parcours {
  list-style: none; padding: 0; margin: 30px 0 0; display: flex; flex-wrap: wrap; gap: 8px;
}
.v2-parcours li {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08);
  transition: background .6s var(--ease), color .6s, border-color .6s;
}
.v2-parcours li span {
  display: inline-flex; width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center;
  font-size: .68rem; background: rgba(255, 255, 255, .08);
}
.v2-parcours li.fait { color: rgba(255, 255, 255, .85); }
.v2-parcours li.fait span { background: var(--brand-primary); color: #fff; }
.v2-parcours li.actuel { color: #fff; background: rgba(245, 130, 0, .18); border-color: rgba(245, 130, 0, .5); }
.v2-parcours li.actuel span { background: var(--brand-accent); color: #fff; box-shadow: 0 0 0 4px rgba(245, 130, 0, .25); }
body:has(#screen-welcome:not(.active)) .v2-parcours { margin-top: 18px; }

@media (max-width: 760px) {
  .v2-etapes, .choices.v2-choix-grille { grid-template-columns: 1fr; }
  .v2-guide { flex-direction: column; }
  .v2-parcours li { font-size: 0; padding: 6px; }
  .v2-parcours li span { font-size: .68rem; }
  .v2-parcours li.actuel { font-size: .8rem; padding-right: 14px; }
}

@media (max-width: 620px) {
  .topbar img { height: 60px; }
  .v2-hero { border-radius: 30px; }
  .card { border-radius: 26px; }
  #app { margin-top: -48px; }
}

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .v2-hero .halo, .v2-hero > *, .screen, .checkmark, .v2-eyebrow .point { animation: none !important; }
  .choice, .btn-primary, .btn-ghost { transition: none; }
}
