/* ==========================================================================
   Passeport de Marque — intelcia
   Un livret de passeport en 3D (à gauche) et les missions du voyage (à droite).
   La charte reprend les variables du nouveau site corporate : modifier le bloc
   « Marque » suffit à faire évoluer les couleurs, les dégradés et les polices.
   ========================================================================== */

:root {
  /* ---- Marque : palette (nouveau site corporate) ------------------------- */
  --brand-orange: #eb5d0f;
  --brand-magenta: #e92b7f;
  --brand-violet: #443482;
  --brand-indigo: #463996;
  --brand-pink: #d60084;
  --brand-pink-deep: #b3005f;
  --pastel-yellow: #fdcd5a;
  --pastel-coral: #e94f5b;
  --pastel-blush: #fac3cb;
  --pastel-lilac: #d0b6d5;
  --pastel-sky: #9ad2e4;

  /* ---- Marque : rôles ---------------------------------------------------- */
  --gradient-brand: linear-gradient(33deg, var(--brand-orange) 1.67%, var(--brand-magenta) 41.38%, var(--brand-violet) 100%);
  --gradient-heading: var(--gradient-brand);
  --gradient-chip: linear-gradient(45deg, var(--brand-pink) 0%, var(--brand-indigo) 100%);
  --gradient-foil: linear-gradient(105deg, #fdcd5a 0%, #fff3cc 16%, #fac3cb 32%, #9ad2e4 50%, #d0b6d5 64%, #fdcd5a 80%, #fff3cc 100%);

  --text-strong: #000000;
  --text: #444444;
  --text-muted: #6b6b6b;
  --surface-soft: #f6f6f6;
  --line: #e5e3ec;
  --paper: #fdfcf9;
  --ink-blue: #1f2d6e;
  --success: #1d8a5a;
  --danger: #cf3434;
  --shadow-soft: 0 0 7px 0 rgba(0, 0, 0, 0.05);
  --shadow-card: 0 0 7px 0 rgba(0, 0, 0, 0.05), 0 28px 60px -30px rgba(68, 52, 130, 0.45);

  --font-sans: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-text: Manrope, Inter, system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --font-hand: Caveat, 'Segoe Script', cursive;
  --radius-card: 30px;
  --radius-button: 5px;

  --topbar-h: 64px;
  color-scheme: light;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text-strong);
  background: #f3f2f6;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

svg {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.file-input {
  display: none;
}

kbd {
  padding: 0.05em 0.4em;
  border: 1px solid #d4d2dc;
  border-radius: 4px;
  background: #fff;
  font: inherit;
  font-size: 0.92em;
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand-pink) 55%, transparent);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Briques communes
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: 44px;
  padding: 0 1.4em;
  border: 0;
  border-radius: var(--radius-button);
  color: inherit;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.12s ease, box-shadow 0.25s ease, background-color 0.2s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--brand-magenta) 85%, transparent);
}

.btn--primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn--light {
  color: var(--brand-violet);
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 6px 16px -12px rgba(0, 0, 0, 0.35);
}

.btn--light:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-pink) 45%, transparent), 0 8px 18px -12px rgba(0, 0, 0, 0.4);
}

.btn--ghost {
  padding-inline: 0.6em;
  color: var(--brand-violet);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

.btn--on-dark {
  color: #fff;
}

.btn--lg {
  min-height: 52px;
  padding: 0 1.8em;
  font-size: 16px;
  font-weight: 600;
}

.btn--sm {
  min-height: 38px;
  padding: 0 1em;
  font-size: 14px;
}

.icon-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--brand-violet);
  background: #fff;
  box-shadow: var(--shadow-soft), 0 4px 12px -6px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.chip {
  align-self: flex-start;
  display: inline-block;
  padding: 5px 16px 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  color: var(--text-strong);
  background: linear-gradient(#fff, #fff) padding-box, var(--gradient-chip) border-box;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}

.h-gradient {
  font-weight: 600;
  letter-spacing: -0.015em;
  color: transparent;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  background-clip: text;
}

/* --------------------------------------------------------------------------
   Ciel : dégradés de la marque, carte du monde et route de l'avion
   -------------------------------------------------------------------------- */

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(60% 55% at 0% 0%, rgba(250, 195, 203, 0.8), transparent 70%),
    radial-gradient(55% 60% at 100% 8%, rgba(154, 210, 228, 0.85), transparent 70%),
    radial-gradient(60% 50% at 55% 110%, rgba(253, 205, 90, 0.4), transparent 70%),
    #f3f2f6;
}

.sky__map {
  position: absolute;
  left: 50%;
  top: 54%;
  width: min(92vw, 1500px);
  height: auto;
  max-width: none;
  opacity: 0.11;
  transform: translate(-50%, -50%);
}

.sky__route {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.route__base {
  fill: none;
  stroke: rgba(68, 52, 130, 0.3);
  stroke-width: 2;
  stroke-dasharray: 1 11;
  stroke-linecap: round;
}

.route__trail {
  fill: none;
  stroke: var(--brand-magenta);
  stroke-width: 2.5;
  stroke-linecap: round;
  opacity: 0.55;
}

.route__plane {
  fill: var(--brand-violet);
  stroke: #fff;
  stroke-width: 1;
}

/* --------------------------------------------------------------------------
   Barre du haut et étapes
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 clamp(16px, 3.5vw, 48px);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.topbar__brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  color: var(--text-strong);
  text-decoration: none;
  border-radius: 6px;
}

.topbar__brand img {
  display: block;
  width: auto;
  height: 24px;
}

.topbar__title {
  padding-left: 12px;
  border-left: 1px solid #dedde4;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.stepper {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stepper__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 5px;
  border: 0;
  border-radius: 999px;
  color: var(--text-muted);
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.stepper__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #dcdbe3;
  font-size: 12px;
  transition: background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.stepper__num svg {
  width: 15px;
  height: 15px;
}

.stepper__item.is-current {
  color: var(--text-strong);
  background: #fff;
  box-shadow: var(--shadow-soft), 0 4px 14px -8px rgba(0, 0, 0, 0.25);
}

.stepper__item.is-current .stepper__num {
  color: var(--brand-violet);
  box-shadow: inset 0 0 0 2px var(--brand-violet);
}

.stepper__item.is-done .stepper__num {
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: none;
}

.stepper__item[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
}

.sound-toggle[aria-pressed='true'] .sound-toggle__off,
.sound-toggle[aria-pressed='false'] .sound-toggle__on {
  display: none;
}

@media (max-width: 1180px) {
  .stepper__label {
    display: none;
  }

  .stepper__item {
    padding: 5px;
  }
}

@media (max-width: 600px) {
  .topbar {
    gap: 10px;
  }

  .topbar__title {
    display: none;
  }

  .topbar__brand img {
    height: 20px;
  }

  .stepper {
    gap: 2px;
  }

  .stepper__num {
    width: 26px;
    height: 26px;
  }

  .icon-btn.sound-toggle {
    width: 36px;
    height: 36px;
  }
}

/* --------------------------------------------------------------------------
   Scène : le passeport à gauche, la mission à droite
   -------------------------------------------------------------------------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(400px, 38vw, 580px);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
  max-width: 1640px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px) clamp(16px, 3.5vw, 48px) 32px;
}

.book-zone {
  position: sticky;
  top: calc(var(--topbar-h) + 28px);
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  --page-w: min(47cqi, calc((100vh - var(--topbar-h) - 150px) * 0.7), 450px);
  --page-h: calc(var(--page-w) / 0.7);
}

/* ---- Le livret en 3D (ordinateur) ---- */

.book {
  position: relative;
  width: calc(var(--page-w) * 2);
  height: var(--page-h);
  perspective: 2400px;
  transition: transform 1s cubic-bezier(0.45, 0.05, 0.25, 1);
}

.book[data-spread='0'] {
  transform: translateX(calc(var(--page-w) * -0.5));
}

.book[data-spread='0'] .page--cover {
  cursor: pointer;
}

.leaf,
.book__base {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
}

.leaf {
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform 1.15s cubic-bezier(0.45, 0.05, 0.25, 1);
}

.leaf.is-turned {
  transform: rotateY(-180deg);
}

#leaf-0 {
  z-index: 3;
}

#leaf-1 {
  z-index: 2;
}

.book__base {
  z-index: 1;
}

.leaf__front,
.leaf__back {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.leaf__back {
  transform: rotateY(180deg);
}

.book-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.book-nav__label {
  min-width: 13em;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Pages du passeport (dimensions en cqw : 1cqw = 1 % de la largeur de page)
   -------------------------------------------------------------------------- */

.page {
  container-type: size;
  width: var(--page-w);
  height: var(--page-h);
  overflow: hidden;
  border-radius: 0 3.6cqw 3.6cqw 0;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 22px 44px -24px rgba(40, 30, 80, 0.55);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.leaf__back {
  border-radius: 3.6cqw 0 0 3.6cqw;
}

/* ombre de la reliure */
.page::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(40, 30, 80, 0.16), rgba(40, 30, 80, 0.04) 6%, transparent 12%);
}

.leaf__back::after {
  background: linear-gradient(270deg, rgba(40, 30, 80, 0.16), rgba(40, 30, 80, 0.04) 6%, transparent 12%);
}

.page--cover::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent 7%);
}

.paper {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 7.5cqw 7.5cqw 6cqw;
  color: var(--text-strong);
}

.paper--secure {
  background:
    var(--guilloche, none) 0 0 / 48cqw auto repeat,
    linear-gradient(170deg, #fdf2f5 0%, var(--paper) 42%, var(--paper) 58%, #eef5f9 100%);
}

/* micro-texte de sécurité au pied de la page */
.paper--secure::after {
  content: 'INTELCIA · TRUSTED INTELLIGENT OPERATIONS · BRAND PASSPORT · INTELCIA · TRUSTED INTELLIGENT OPERATIONS · BRAND PASSPORT · INTELCIA · TRUSTED INTELLIGENT OPERATIONS';
  position: absolute;
  left: 4cqw;
  right: 4cqw;
  bottom: 1.2cqw;
  overflow: hidden;
  color: rgba(68, 52, 130, 0.32);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  font-family: var(--font-mono);
  font-size: 1.35cqw;
  font-weight: 600;
  letter-spacing: 0.22em;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
}

.page-kicker {
  margin: 0;
  color: var(--brand-pink-deep);
  font-size: 2.6cqw;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.page-num {
  position: absolute;
  bottom: 3.4cqw;
  right: 7.5cqw;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 2.4cqw;
}

.leaf__back .page-num {
  right: auto;
  left: 7.5cqw;
}

/* ---- Couverture ---- */

.page--cover {
  background: #2b2157;
}

.cover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 11cqw 9cqw 9cqw;
  color: #fff;
  text-align: center;
  background:
    var(--grain, none),
    radial-gradient(120% 70% at 25% 0%, rgba(233, 43, 127, 0.28) 0%, transparent 60%),
    radial-gradient(90% 60% at 100% 100%, rgba(235, 93, 15, 0.18) 0%, transparent 60%),
    linear-gradient(160deg, #4b3891 0%, #372a72 46%, #221a4b 100%);
  background-blend-mode: soft-light, normal, normal, normal;
}

.cover::before {
  content: '';
  position: absolute;
  inset: 4.5cqw;
  border: 0.45cqw solid rgba(253, 205, 90, 0.38);
  border-radius: 2.4cqw;
  pointer-events: none;
}

.cover__logo {
  position: relative;
  display: block;
  width: 33cqw;
  height: auto;
  filter: drop-shadow(0 0.4cqw 0.6cqw rgba(0, 0, 0, 0.3));
}

.cover__emblem {
  position: relative;
  width: 30cqw;
  aspect-ratio: 1;
  margin-top: 13cqw;
  padding: 2cqw;
  border-radius: 31%;
  background: var(--gradient-foil);
  background-size: 260% 100%;
  background-position: calc(var(--mx, 0.5) * 100%) 50%;
  box-shadow: 0 1.6cqw 4cqw rgba(0, 0, 0, 0.45);
}

.cover__emblem img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 28%;
}

.cover__title {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.6cqw;
  margin: 10cqw 0 0;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.foil {
  display: block;
  color: transparent;
  background: var(--gradient-foil);
  background-size: 260% 100%;
  background-position: calc(var(--mx, 0.5) * 100%) 50%;
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0.3cqw 0 rgba(0, 0, 0, 0.35));
}

.cover__title .foil {
  font-size: 9.6cqw;
  letter-spacing: 0.26em;
  padding-left: 0.26em;
}

.cover__title .foil--small {
  font-size: 4.6cqw;
  letter-spacing: 0.55em;
  padding-left: 0.55em;
}

.cover__holder {
  position: relative;
  align-self: stretch;
  min-height: 1.3em;
  margin: 5cqw 0 0;
  overflow: hidden;
  font-size: 4.2cqw;
  font-weight: 700;
  letter-spacing: 0.22em;
  white-space: nowrap;
  text-transform: uppercase;
}

.cover__holder.is-wrapped {
  overflow-wrap: anywhere;
  line-height: 1.3;
  white-space: normal;
}

.cover__chip {
  position: relative;
  width: 14cqw;
  height: auto;
  margin-top: auto;
  stroke: rgba(253, 205, 90, 0.75);
  stroke-width: 1.6;
}

.cover__tagline {
  position: relative;
  margin: 3.4cqw 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 2.7cqw;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.cover__seal {
  position: absolute;
  top: 46cqw;
  right: 7cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.8cqw;
  width: 24cqw;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #2b2157;
  background: var(--gradient-foil);
  background-size: 260% 100%;
  background-position: calc(var(--mx, 0.5) * 100%) 50%;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.45), inset 0 0 0 1cqw rgba(255, 255, 255, 0.35);
  transform: rotate(-12deg);
}

.cover__seal span {
  font-size: 2.6cqw;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.cover__seal strong {
  font-family: var(--font-mono);
  font-size: 2.6cqw;
}

/* ---- Reflet holographique (suit la souris) ---- */

.holo {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.55;
  mix-blend-mode: color-dodge;
  background:
    radial-gradient(circle at calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.35) * 100%), rgba(255, 255, 255, 0.5), transparent 38%),
    linear-gradient(115deg, transparent 22%, rgba(154, 210, 228, 0.5) 36%, rgba(250, 195, 203, 0.5) 45%, rgba(253, 205, 90, 0.45) 54%, transparent 68%);
  background-size: 100% 100%, 240% 240%;
  background-position: 0 0, calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.35) * 100%);
}

.holo--soft {
  opacity: 0.22;
  mix-blend-mode: multiply;
  background:
    linear-gradient(115deg, transparent 25%, rgba(154, 210, 228, 0.55) 38%, rgba(250, 195, 203, 0.55) 46%, rgba(253, 205, 90, 0.5) 54%, transparent 66%);
  background-size: 260% 260%;
  background-position: calc(var(--mx, 0.5) * 100%) calc(var(--my, 0.35) * 100%);
}

@media (hover: none) {
  .holo {
    animation: holo-drift 7s ease-in-out infinite alternate;
  }
}

@keyframes holo-drift {
  from { background-position: 0 0, 10% 20%; }
  to { background-position: 0 0, 90% 80%; }
}

/* ---- Page 1 : bienvenue ---- */

.welcome__title {
  margin: 3cqw 0 0;
  font-size: 8.4cqw;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: transparent;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  background-clip: text;
}

.welcome__text {
  margin: 3cqw 0 0;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 3.4cqw;
  line-height: 1.45;
}

.itinerary {
  display: grid;
  gap: 2.8cqw;
  margin: 5.5cqw 0 0;
  padding: 0;
  list-style: none;
}

.itinerary li {
  display: flex;
  align-items: center;
  gap: 3cqw;
}

.itinerary__dot {
  display: grid;
  flex: none;
  place-items: center;
  width: 7.4cqw;
  height: 7.4cqw;
  border-radius: 50%;
  color: var(--brand-violet);
  box-shadow: inset 0 0 0 0.45cqw var(--brand-violet);
  font-size: 3.2cqw;
  font-weight: 700;
  transition: background 0.4s ease, color 0.4s ease;
}

.itinerary li.is-done .itinerary__dot {
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: none;
}

.itinerary strong {
  display: block;
  font-size: 3.5cqw;
}

.itinerary small {
  display: block;
  margin-top: 0.4cqw;
  color: var(--text-muted);
  font-family: var(--font-text);
  font-size: 2.8cqw;
}

.mini-map {
  position: relative;
  margin-top: auto;
}

.mini-map img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0.3;
}

.mini-map span {
  position: absolute;
  width: 1.5cqw;
  height: 1.5cqw;
  border-radius: 50%;
  background: var(--brand-pink);
  box-shadow: 0 0 0 0.7cqw rgba(233, 43, 127, 0.16), 0 0 2.4cqw rgba(233, 43, 127, 0.45);
  transform: translate(-50%, -50%);
}

/* le pays du titulaire */
.mini-map span.is-home {
  z-index: 1;
  width: 2.2cqw;
  height: 2.2cqw;
  border: 0.45cqw solid #fff;
  background: var(--brand-violet);
  box-shadow: 0 0 0 0.9cqw rgba(68, 52, 130, 0.22), 0 0 2.6cqw rgba(68, 52, 130, 0.5);
}

.welcome__stats {
  margin: 2.4cqw 0 0;
  color: var(--text);
  font-size: 3cqw;
  text-align: center;
}

.welcome__stats strong {
  color: var(--brand-pink-deep);
}

/* ---- Page 2 : identité ---- */

.id-page {
  padding: 6.5cqw 6.5cqw 0;
}

.id-page__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4cqw;
}

.id-page__name {
  color: var(--brand-violet);
  font-size: 2.8cqw;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.id-page__name em {
  display: block;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
}

.id-page__head img {
  width: 22cqw;
  height: auto;
}

.id-page__codes {
  display: flex;
  gap: 7cqw;
  margin-top: 4.5cqw;
}

.id-page__codes span {
  display: flex;
  flex-direction: column;
  gap: 0.6cqw;
  font-family: var(--font-mono);
  font-size: 3.4cqw;
  font-weight: 600;
}

.id-page__codes em,
.id-fields dt,
.id-autograph span {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 2.1cqw;
  font-style: normal;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.id-fields dt em,
.id-autograph em {
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.id-page__body {
  display: grid;
  grid-template-columns: 34cqw minmax(0, 1fr);
  gap: 5cqw;
  margin-top: 4.5cqw;
}

.id-photo {
  position: relative;
  align-self: start;
  aspect-ratio: 35 / 45;
  overflow: hidden;
  border-radius: 1.6cqw;
  box-shadow: inset 0 0 0 0.3cqw rgba(68, 52, 130, 0.14);
}

.id-photo:not(.has-photo) .id-photo__holo {
  display: none;
}

body[data-view='identity'] .id-photo {
  cursor: pointer;
}

/* Emplacement photo vide : repères de cadrage et initiales du titulaire */
.photo-empty {
  --mark: rgba(68, 52, 130, 0.5);
  --mark-size: 2px;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6%;
  color: var(--brand-violet);
  background: linear-gradient(165deg, #f7eff5 0%, #efecf6 55%, #e7f1f6 100%);
}

.photo-empty::before {
  content: '';
  position: absolute;
  inset: 9%;
  background:
    linear-gradient(var(--mark) 0 0) left top / 22% var(--mark-size),
    linear-gradient(var(--mark) 0 0) left top / var(--mark-size) 17%,
    linear-gradient(var(--mark) 0 0) right top / 22% var(--mark-size),
    linear-gradient(var(--mark) 0 0) right top / var(--mark-size) 17%,
    linear-gradient(var(--mark) 0 0) left bottom / 22% var(--mark-size),
    linear-gradient(var(--mark) 0 0) left bottom / var(--mark-size) 17%,
    linear-gradient(var(--mark) 0 0) right bottom / 22% var(--mark-size),
    linear-gradient(var(--mark) 0 0) right bottom / var(--mark-size) 17%;
  background-repeat: no-repeat;
}

.photo-empty__icon {
  width: 30%;
  height: auto;
  opacity: 0.55;
}

.photo-empty__initials {
  display: none;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: transparent;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  background-clip: text;
}

.photo-empty.has-initials .photo-empty__icon {
  display: none;
}

.photo-empty.has-initials .photo-empty__initials {
  display: block;
}

.photo-empty__label {
  color: rgba(68, 52, 130, 0.55);
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.id-photo .photo-empty {
  --mark-size: 0.45cqw;
}

.id-photo .photo-empty__initials {
  font-size: 12cqw;
}

.id-photo .photo-empty__label {
  font-size: 1.9cqw;
}

.id-photo__img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.id-photo__holo {
  position: absolute;
  right: 5%;
  bottom: 5%;
  width: 36%;
  aspect-ratio: 1;
  border-radius: 30%;
  background: url('../assets/brand/icon.png') center / contain no-repeat;
  opacity: 0.38;
  mix-blend-mode: screen;
}

.id-fields {
  display: grid;
  align-content: start;
  gap: 2.5cqw;
  margin: 0;
}

.id-fields div {
  min-width: 0;
}

.id-fields dd {
  margin: 0.5cqw 0 0;
  overflow: hidden;
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 3.4cqw;
  font-weight: 600;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.id-fields dd.is-wrapped {
  overflow-wrap: anywhere;
  line-height: 1.15;
  text-overflow: clip;
  white-space: normal;
}

.id-fields dd.is-empty {
  color: #c4c0cf;
}

.id-autograph {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3cqw;
  min-height: 11cqw;
  margin-top: 3.5cqw;
  padding-bottom: 1cqw;
  border-bottom: 0.25cqw solid rgba(68, 52, 130, 0.2);
}

.id-autograph span {
  flex: none;
  max-width: 34cqw;
  line-height: 1.3;
}

.id-autograph strong {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-blue);
  font-family: var(--font-hand);
  font-size: 8cqw;
  font-weight: 600;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  transform: rotate(-4deg);
  transform-origin: right bottom;
}

.id-autograph strong.is-wrapped {
  overflow-wrap: anywhere;
  line-height: 0.95;
  white-space: normal;
}

.mrz {
  margin: auto -6.5cqw 0;
  padding: 3cqw 6.5cqw 4.4cqw;
  color: #1b1b1b;
  background: rgba(255, 255, 255, 0.9);
  font-family: var(--font-mono);
  font-size: calc(87cqw / 26.6);
  font-weight: 500;
  line-height: 1.45;
  white-space: pre;
}

.mrz span {
  display: block;
  overflow: hidden;
}

/* ---- Pages 3 et 4 : visas ---- */

.visa-page {
  gap: 4.5cqw;
}

.visa {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.visa__label {
  margin: 0 0 2.2cqw;
  font-size: 3.3cqw;
  font-weight: 700;
}

.visa__label span {
  display: block;
  margin-bottom: 0.6cqw;
  color: var(--brand-pink-deep);
  font-size: 2.3cqw;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.visa__slot {
  position: relative;
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 0;
  border: 0.35cqw dashed rgba(68, 52, 130, 0.25);
  border-radius: 2.8cqw;
}

.visa.is-done .visa__slot {
  border-color: transparent;
}

.visa__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6cqw;
  margin: 0;
  padding: 0 6cqw;
  color: var(--text-muted);
  font-size: 2.7cqw;
  text-align: center;
}

.visa__empty svg {
  width: 6cqw;
  height: 6cqw;
}

.visa__content--signature {
  width: 90%;
  padding: 3.4cqw 3.8cqw;
  border-radius: 2.4cqw;
  background: #fff;
  box-shadow: 0 1cqw 3.4cqw rgba(0, 0, 0, 0.1);
  transform: rotate(-1.5deg);
}

.mini-sig img {
  display: block;
  width: 22cqw;
  height: auto;
}

.mini-sig strong {
  display: block;
  margin-top: 2cqw;
  color: var(--brand-violet);
  font-size: 3.2cqw;
}

.mini-sig span {
  display: block;
  margin-top: 0.6cqw;
  color: var(--text);
  font-size: 2.4cqw;
}

.mini-sig i {
  display: block;
  height: 0.6cqw;
  margin-top: 2cqw;
  border-radius: 0.3cqw;
  background: var(--gradient-brand);
}

.mini-sig em {
  display: block;
  margin-top: 1.2cqw;
  color: var(--brand-magenta);
  font-size: 2.2cqw;
  font-style: normal;
  font-weight: 700;
}

.polaroid {
  position: relative;
  width: 44%;
  margin: 0;
  padding: 2.2cqw 2.2cqw 7cqw;
  background: #fff;
  box-shadow: 0 1.2cqw 3.4cqw rgba(0, 0, 0, 0.18);
  transform: rotate(3deg);
}

.polaroid::before {
  content: '';
  position: absolute;
  top: -2.6cqw;
  left: 50%;
  width: 18cqw;
  height: 5cqw;
  background: rgba(253, 205, 90, 0.55);
  transform: translateX(-50%) rotate(-4deg);
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.visa__content--quiz {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1cqw;
  width: 100%;
  padding: 0 6cqw;
}

.visa__content--quiz strong {
  font-size: 12cqw;
  font-weight: 800;
  line-height: 1;
  color: transparent;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  background-clip: text;
}

.visa__content--quiz span {
  color: var(--text);
  font-size: 2.8cqw;
}

.quiz-dots {
  display: flex;
  gap: 1.4cqw;
  margin-top: 1.6cqw;
}

.quiz-dots i {
  width: 3.4cqw;
  height: 3.4cqw;
  border-radius: 50%;
  background: var(--gradient-brand);
}

.seal-block {
  display: flex;
  align-items: center;
  gap: 4cqw;
  width: 100%;
  padding: 0 5cqw;
}

.seal {
  flex: none;
  width: 26cqw;
  aspect-ratio: 1;
  padding: 2.4cqw;
  border-radius: 50%;
  background: var(--gradient-foil);
  background-size: 260% 100%;
  background-position: calc(var(--mx, 0.5) * 100%) 50%;
  box-shadow: 0 1cqw 3cqw rgba(0, 0, 0, 0.2), inset 0 0 0 0.8cqw rgba(255, 255, 255, 0.45);
}

.seal img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 30%;
}

.seal-block__text {
  margin: 0;
  color: var(--text);
  font-size: 2.8cqw;
  line-height: 1.4;
}

.seal-block__text strong {
  display: block;
  margin: 0.6cqw 0;
  color: var(--text-strong);
  font-size: 3.8cqw;
  text-transform: uppercase;
}

/* ---- Tampons ---- */

.stamp {
  --ink: var(--brand-violet);
  --rot: -10deg;
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9cqw;
  color: var(--ink);
  border: 0.7cqw solid currentColor;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  opacity: 0.88;
  mix-blend-mode: multiply;
  filter: url(#ink);
  transform: rotate(var(--rot));
  pointer-events: none;
}

.stamp::before {
  content: '';
  position: absolute;
  inset: 1cqw;
  border: 0.25cqw solid currentColor;
  border-radius: inherit;
}

.stamp--round {
  width: 29cqw;
  aspect-ratio: 1;
  border-radius: 50%;
}

.stamp--rect {
  padding: 2.4cqw 3.8cqw;
  border-radius: 1.6cqw;
}

.stamp__top {
  font-size: 2.2cqw;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.stamp__main {
  padding: 0.7cqw 1.4cqw;
  border-top: 0.3cqw solid currentColor;
  border-bottom: 0.3cqw solid currentColor;
  font-size: 5.2cqw;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.stamp--round .stamp__main {
  font-size: 4.2cqw;
}

.stamp__date {
  font-size: 2.3cqw;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.stamp--violet { --ink: var(--brand-violet); }
.stamp--orange { --ink: var(--brand-orange); }
.stamp--pink { --ink: var(--brand-pink-deep); }
.stamp--magenta { --ink: var(--brand-magenta); }

.stamp--checkin {
  --rot: -7deg;
  top: 98cqw;
  right: 8cqw;
}

[data-stamp='signature'] {
  --rot: -9deg;
  right: 0;
  bottom: 2cqw;
}

[data-stamp='selfie'] {
  --rot: 12deg;
  right: 1cqw;
  bottom: 1cqw;
}

[data-stamp='quiz'] {
  --rot: -11deg;
  right: 2cqw;
  top: 50%;
  margin-top: -14cqw;
}

.stamp.is-new {
  animation: stamp-in 0.55s cubic-bezier(0.2, 0.8, 0.3, 1.15) both;
}

@keyframes stamp-in {
  0% { opacity: 0; transform: rotate(var(--rot)) scale(2.4); }
  65% { opacity: 0.95; transform: rotate(var(--rot)) scale(0.93); }
  100% { opacity: 0.88; transform: rotate(var(--rot)) scale(1); }
}

.page.is-thump .paper {
  animation: thump 0.32s ease-out;
}

@keyframes thump {
  0% { transform: translateY(0); }
  30% { transform: translateY(0.6cqw) scale(0.995); }
  100% { transform: none; }
}

/* --------------------------------------------------------------------------
   Panneau des missions
   -------------------------------------------------------------------------- */

.panel {
  container-type: inline-size;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card);
}

/* ---- Tableau des départs ---- */

.board {
  --cell: calc((100cqi - 96px) / 31);
  padding: 14px 22px 16px;
  color: #fdcd5a;
  background: #1c1718;
}

.board__labels,
.board__row {
  display: flex;
  gap: 12px;
}

.board__labels {
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.board__labels .board__vol { width: calc(var(--cell) * 5); }
.board__labels .board__dest { width: calc(var(--cell) * 14); }
.board__labels .board__gate { width: calc(var(--cell) * 3); }
.board__labels .board__status { width: calc(var(--cell) * 9); }

.flap {
  display: flex;
  gap: 2px;
}

.flap__cell {
  position: relative;
  display: grid;
  place-items: center;
  width: calc(var(--cell) - 2px);
  height: calc(var(--cell) * 1.5);
  border-radius: 3px;
  color: #fdcd5a;
  background: linear-gradient(#2d2627 50%, #252021 50%);
  font-family: var(--font-mono);
  font-size: calc(var(--cell) * 0.92);
  font-weight: 600;
  line-height: 1;
}

.flap__cell::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.7);
}

.flap__cell.is-flipping {
  animation: flap 0.12s ease-in;
}

@keyframes flap {
  from { transform: perspective(200px) rotateX(-75deg); opacity: 0.55; }
  to { transform: none; opacity: 1; }
}

.board[data-status='done'] .board__status .flap__cell {
  color: #7be3a9;
}

.board[data-status='live'] .board__status .flap__cell {
  animation: blink 1.6s steps(2, jump-none) infinite;
}

@keyframes blink {
  50% { color: #fff3cc; }
}

@container (max-width: 470px) {
  .board {
    --cell: calc((100cqi - 56px) / 23);
    padding-inline: 16px;
  }

  .board .board__vol,
  .board .board__gate {
    display: none;
  }
}

/* ---- Missions ---- */

.missions {
  padding: clamp(22px, 5cqi, 38px);
}

.mission,
.granted {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: mission-in 0.45s ease both;
}

@keyframes mission-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.mission__title {
  margin: 0;
  font-size: clamp(26px, 6cqi, 38px);
  line-height: 1.1;
  outline: none;
}

.mission__lead {
  margin: 0;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
}

.mission__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
}

.mission__actions--inline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.mission__hint,
.mission__note {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-text);
  font-size: 13.5px;
}

.hero {
  position: relative;
  margin: 0 0 4px;
  overflow: hidden;
  border-radius: 24px;
  aspect-ratio: 16 / 8;
  background: #2b2157;
}

.hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 35%;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(28, 23, 24, 0.55));
}

.hero__tag {
  position: absolute;
  left: 20px;
  bottom: 16px;
  z-index: 1;
  color: #fff;
  font-size: clamp(16px, 4cqi, 22px);
  font-weight: 600;
}

.escales {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.escales li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.escales__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: var(--gradient-brand);
}

.escales__icon svg {
  width: 21px;
  height: 21px;
}

.escales strong {
  display: block;
  font-size: 15px;
}

.escales small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-family: var(--font-text);
  font-size: 13.5px;
}

/* ---- Visa obtenu ---- */

.granted {
  align-items: flex-start;
  padding: 26px;
  border-radius: 24px;
  background:
    radial-gradient(80% 90% at 100% 0%, rgba(154, 210, 228, 0.55), transparent 70%),
    radial-gradient(80% 90% at 0% 100%, rgba(250, 195, 203, 0.6), transparent 70%),
    #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.granted__title {
  margin: 0;
  font-size: clamp(28px, 6.6cqi, 40px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: transparent;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  background-clip: text;
  outline: none;
}

.granted__stamp {
  container-type: inline-size;
  width: min(420px, 86%);
  margin: 0 0 4px 8px;
}

.granted__stamp:empty {
  display: none;
}

.granted .stamp {
  position: relative;
  inset: auto;
  display: inline-flex;
  margin: 0;
}

.granted__text {
  margin: 0;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
}

/* ---- Enregistrement ---- */

.photo-field {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface-soft);
}

.photo-field__preview {
  position: relative;
  flex: none;
  width: 74px;
  aspect-ratio: 35 / 45;
  overflow: hidden;
  border-radius: 10px;
}

.photo-field__preview .photo-empty__initials {
  font-size: 25px;
}

.photo-field__preview .photo-empty__label {
  font-size: 7.5px;
}

.photo-field__preview img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-field__body strong {
  display: block;
  font-size: 15px;
}

.photo-field__body small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-family: var(--font-text);
  font-size: 13.5px;
}

.photo-field__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.input--wide {
  grid-column: 1 / -1;
}

@container (max-width: 430px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.input > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.input em {
  color: var(--text-muted);
  font-style: normal;
  font-weight: 400;
}

.input input,
.input select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid #e2e0e8;
  border-radius: 12px;
  color: var(--text-strong);
  background: #fff;
  font: inherit;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23d60084' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px auto;
  cursor: pointer;
}

.input input::placeholder {
  color: #b3b0bd;
}

.input input:focus,
.input select:focus {
  outline: none;
  border-color: var(--brand-pink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-pink) 14%, transparent);
}

.input.is-invalid input,
.input.is-invalid select {
  border-color: var(--danger);
}

/* ---- Escale 1 : signature ---- */

.mailbox {
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px #ebeaf1, 0 16px 32px -22px rgba(0, 0, 0, 0.35);
}

.mailbox__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #f3f2f6;
}

.mailbox__bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff6058;
}

.mailbox__bar i:nth-child(2) { background: #ffbd2e; }
.mailbox__bar i:nth-child(3) { background: #28ca42; }

.mailbox__bar span {
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.mailbox__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 18px;
  border-bottom: 1px solid #f0eff4;
  color: var(--text-muted);
  font-size: 13px;
}

.mailbox__body {
  padding: 16px 18px 20px;
  color: #222;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.mailbox__body p {
  margin: 0 0 14px;
}

.copy-status {
  margin: 0;
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
}

.copy-status.is-error {
  color: var(--danger);
}

.howto {
  padding: 16px 18px 18px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.howto__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tabs__tab {
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tabs__tab[aria-selected='true'] {
  color: #fff;
  background: var(--brand-violet);
}

.howto__steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 14.5px;
  line-height: 1.5;
}

/* ---- Photomaton ---- */

.booth {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.booth__screen {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 24px;
  background: radial-gradient(circle at 30% 20%, #3b2d74, #1c1718 72%);
}

.booth--photo .booth__screen {
  max-width: 300px;
  aspect-ratio: 35 / 45;
}

.booth__screen video,
.booth__overlay,
.booth__result {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.booth__screen video {
  object-fit: cover;
  transform: scaleX(-1);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.booth[data-state='live'] video,
.booth[data-state='countdown'] video {
  opacity: 1;
}

.booth__overlay {
  pointer-events: none;
}

.booth__result {
  object-fit: cover;
}

.booth__idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  color: #fff;
  text-align: center;
}

.booth__idle-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: 6px;
  border-radius: 30%;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.booth__idle-icon svg {
  width: 36px;
  height: 36px;
}

.booth:not([data-state='idle']) .booth__idle {
  display: none;
}

.booth__countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(90px, 30cqi, 150px);
  font-weight: 800;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.booth__countdown.is-tick {
  animation: count 0.9s ease-out both;
}

@keyframes count {
  from { opacity: 0; transform: scale(1.6); }
  25% { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.8); }
}

.booth__flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

.booth__flash.is-flash {
  animation: flash 0.55s ease-out;
}

@keyframes flash {
  from { opacity: 1; }
  to { opacity: 0; }
}

.booth__message {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
}

.booth__message:empty {
  display: none;
}

.booth__controls {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.booth__controls > :first-child {
  justify-self: start;
}

.booth__controls > :last-child {
  justify-self: end;
}

.shutter {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 5px solid #fff;
  border-radius: 50%;
  background: var(--gradient-brand);
  box-shadow: 0 0 0 3px rgba(68, 52, 130, 0.25), 0 12px 24px -10px rgba(214, 0, 132, 0.7);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.2s ease;
}

.shutter:active {
  transform: scale(0.93);
}

.shutter:disabled {
  opacity: 0.3;
  cursor: default;
}

.booth [data-booth='retake'],
.booth [data-booth='use'] {
  visibility: hidden;
}

.booth[data-state='preview'] [data-booth='retake'],
.booth[data-state='preview'] [data-booth='use'],
.booth[data-state='done'] [data-booth='retake'] {
  visibility: visible;
}

.booth[data-state='preview'] .shutter,
.booth[data-state='done'] .shutter {
  visibility: hidden;
}

.frames {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.frames__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 4px 9px;
  border: 2px solid transparent;
  border-radius: 14px;
  color: var(--text);
  background: var(--surface-soft);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.frames__item[aria-checked='true'] {
  border-color: var(--brand-pink);
  background: #fff;
}

.frames__swatch {
  position: relative;
  width: 100%;
  max-width: 52px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(160deg, #d9cfe6, #b7c9e0);
}

.frames__swatch--neon {
  border: 4px solid transparent;
  background: linear-gradient(160deg, #d9cfe6, #b7c9e0) padding-box, var(--gradient-brand) border-box;
}

.frames__swatch--neon::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22%;
  background: var(--gradient-brand);
}

.frames__swatch--holo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 20%, rgba(154, 210, 228, 0.9) 38%, rgba(250, 195, 203, 0.9) 48%, rgba(253, 205, 90, 0.85) 58%, transparent 75%);
}

.frames__swatch--visa::after {
  content: '';
  position: absolute;
  right: 10%;
  bottom: 10%;
  width: 46%;
  aspect-ratio: 1;
  border: 2px solid var(--brand-magenta);
  border-radius: 50%;
  transform: rotate(-12deg);
}

/* ---- Escale 3 : quiz ---- */

.quiz__run,
.quiz__result {
  display: none;
}

.quiz[data-view='run'] .quiz__intro,
.quiz[data-view='result'] .quiz__intro {
  display: none;
}

.quiz[data-view='run'] .quiz__run,
.quiz[data-view='result'] .quiz__result {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz__intro {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quiz__track {
  display: flex;
  gap: 6px;
}

.quiz__track i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #ecebf2;
  transition: background 0.3s ease;
}

.quiz__track i.is-current { background: #c9c5d8; }
.quiz__track i.is-ok { background: var(--gradient-brand); }
.quiz__track i.is-ko { background: #f3a9bd; }

.quiz__count {
  margin: 0;
  color: var(--brand-pink-deep);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quiz__question {
  margin: 0;
  font-size: clamp(20px, 4.6cqi, 24px);
  font-weight: 700;
  line-height: 1.3;
  outline: none;
}

.quiz__answers {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.answer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--text-strong);
  background: #fff;
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease, opacity 0.2s ease;
  animation: answer-in 0.35s ease both;
}

.quiz__answers li:nth-child(2) .answer { animation-delay: 0.05s; }
.quiz__answers li:nth-child(3) .answer { animation-delay: 0.1s; }
.quiz__answers li:nth-child(4) .answer { animation-delay: 0.15s; }

@keyframes answer-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.answer:hover:not(:disabled) {
  border-color: var(--brand-pink);
  transform: translateY(-1px);
}

.answer:disabled {
  cursor: default;
}

.answer:disabled:not(.is-correct):not(.is-wrong) {
  opacity: 0.5;
}

.answer__key {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--brand-violet);
  background: #f1eff6;
  font-size: 14px;
  font-weight: 800;
}

.answer__key svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.8;
}

.answer.is-correct {
  border-color: var(--success);
  background: #ebf7f1;
}

.answer.is-correct .answer__key {
  color: #fff;
  background: var(--success);
}

.answer.is-wrong {
  border-color: var(--danger);
  background: #fdeeee;
  animation: shake 0.4s ease;
}

.answer.is-wrong .answer__key {
  color: #fff;
  background: var(--danger);
}

@keyframes shake {
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.quiz__feedback {
  margin: 0;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--surface-soft);
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.5;
}

.quiz__feedback strong {
  display: block;
  margin-bottom: 2px;
}

.quiz__feedback.is-correct strong { color: var(--success); }
.quiz__feedback.is-wrong strong { color: var(--danger); }

.quiz__result {
  align-items: center;
  text-align: center;
}

.quiz__result .mission__actions {
  align-items: center;
}

.quiz__score {
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  margin: 6px 0 0;
  border-radius: 50%;
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: 0 16px 30px -14px rgba(214, 0, 132, 0.7);
  font-size: 34px;
  font-weight: 800;
}

.quiz__result-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  outline: none;
}

.quiz__result-text {
  max-width: 30em;
  margin: 0;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
}

/* ---- Décollage ---- */

.share-card {
  align-self: center;
  width: min(100%, 360px);
  margin: 4px 0;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 30px 60px -28px rgba(68, 52, 130, 0.6);
  transform: rotate(-1.5deg);
}

.share-card img {
  display: block;
  width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Pied de page, notifications, confettis
   -------------------------------------------------------------------------- */

.foot {
  padding: 8px 16px calc(36px + env(safe-area-inset-bottom));
  color: var(--text-muted);
  font-family: var(--font-text);
  font-size: 13px;
  text-align: center;
}

.foot p {
  margin: 0 0 6px;
}

.foot__reset {
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  color: var(--brand-violet);
  background: none;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: min(92vw, 460px);
  padding: 13px 18px;
  border-radius: 14px;
  color: #fff;
  background: rgba(28, 23, 24, 0.94);
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, 0.5);
  font-size: 14.5px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 90;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.noscript {
  max-width: 520px;
  margin: 24px auto;
  padding: 14px 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--brand-violet);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Tablette et mobile : les pages du passeport défilent au doigt
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
  .stage {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    padding-top: 16px;
  }

  .book-zone {
    position: static;
    gap: 14px;
    width: 100%;
    --page-w: min(70cqi, 340px);
  }

  .book {
    display: flex;
    gap: 16px;
    width: 100%;
    height: auto;
    padding: 6px calc((100% - var(--page-w)) / 2) 24px;
    overflow-x: auto;
    perspective: none;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    transform: none !important;
    transition: none;
  }

  .book::-webkit-scrollbar {
    display: none;
  }

  .leaf {
    display: contents;
  }

  .page,
  .leaf__front,
  .leaf__back,
  .book__base {
    position: relative;
    inset: auto;
    flex: 0 0 var(--page-w);
    left: auto;
    border-radius: 3.6cqw;
    transform: none !important;
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    scroll-snap-align: center;
  }

  .page::after {
    display: none;
  }

  .panel {
    border-radius: 26px;
  }
}

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

/* --------------------------------------------------------------------------
   Impression / PDF : les pages du passeport, une par feuille A6
   -------------------------------------------------------------------------- */

@page {
  size: 105mm 148mm;
  margin: 0;
}

@media print {
  html,
  body {
    background: #fff !important;
  }

  .sky,
  .topbar,
  .panel,
  .book-nav,
  .foot,
  .toast,
  .confetti,
  .noscript,
  .holo {
    display: none !important;
  }

  .stage,
  .book-zone {
    display: block;
    position: static;
    margin: 0;
    padding: 0;
  }

  .book-zone {
    --page-w: 105mm;
    --page-h: 148mm;
  }

  .book {
    display: block;
    width: auto;
    height: auto;
    padding: 0;
    overflow: visible;
    perspective: none;
    transform: none !important;
  }

  .leaf {
    display: contents;
  }

  .page,
  .leaf__front,
  .leaf__back,
  .book__base {
    position: relative;
    inset: auto;
    left: auto;
    width: 105mm;
    height: 148mm;
    border-radius: 0;
    box-shadow: none;
    transform: none !important;
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
    break-after: page;
    break-inside: avoid;
  }

  .book__base {
    break-after: auto;
  }

  .page::after {
    display: none;
  }

  .stamp {
    animation: none !important;
  }

  .welcome__title,
  .visa__content--quiz strong,
  .photo-empty__initials {
    color: var(--brand-magenta);
    background: none;
  }
}
