/* Formulaire d'inscription : une question par ecran, des champs larges et
   confortables, le ruban d'or comme fil de progression. */

:root {
  --canvas: #0c2017;
  --canvas-deep: #081710;
  --panel: #12291c;
  --panel-2: #173322;
  --line: rgba(217, 169, 78, 0.16);
  --line-strong: rgba(217, 169, 78, 0.45);
  --accent: #d9a94e;
  --accent-hover: #e6bc6a;
  --accent-muted: rgba(217, 169, 78, 0.24);
  --blush: #e8c3b8;
  --error: #f0a48f;
  --text-primary: #f5efe0;
  --text-secondary: #b4c2b2;
  --ease: cubic-bezier(0.22, 0.7, 0.25, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { overflow-x: hidden; overflow-x: clip; }

body {
  background:
    radial-gradient(ellipse 90% 60% at 80% 0%, rgba(217, 169, 78, 0.08), transparent 60%),
    radial-gradient(ellipse 70% 50% at 10% 100%, rgba(232, 195, 184, 0.05), transparent 65%),
    linear-gradient(180deg, var(--canvas-deep), var(--canvas) 45%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: 'Bricolage Grotesque', 'Figtree', sans-serif; }

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

/* ------------------------------------------------ barre de progression */

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 16px clamp(18px, 4vw, 40px) 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(180deg, rgba(8, 23, 16, 0.92), rgba(8, 23, 16, 0));
}

.progress .brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex: none;
}

.progress .brand img {
  height: 30px;
  width: auto;
  display: block;
}

@media (max-width: 560px) { .progress .brand img { height: 24px; } }

.progress .track {
  position: relative;
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(217, 169, 78, 0.14);
  overflow: hidden;
}

.progress .fill {
  position: absolute;
  inset: 0;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width 0.7s var(--ease);
}

.progress .count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  color: var(--text-secondary);
  flex: none;
  min-width: 92px;
  text-align: right;
}

/* ------------------------------------------------ scene des etapes */

.stage {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 110px clamp(20px, 5vw, 48px) 60px;
}

.step {
  width: min(760px, 100%);
  display: none;
}

.step.active { display: block; animation: step-in 0.65s var(--ease-soft) both; }

.step.leaving { animation: step-out 0.3s var(--ease-soft) both; }

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

@keyframes step-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-24px); }
}

.step .eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

.step h1 {
  font-size: clamp(30px, 5.4vw, 50px);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin-bottom: 14px;
}

.step .hint {
  color: var(--text-secondary);
  font-size: clamp(15.5px, 1.9vw, 18px);
  max-width: 56ch;
  margin-bottom: 34px;
}

.step .hint b { color: var(--blush); font-weight: 600; }

/* ------------------------------------------------ champs imposants */

.field {
  width: 100%;
  background: rgba(18, 41, 28, 0.65);
  border: 2px solid var(--line);
  border-radius: 18px;
  color: var(--text-primary);
  font-family: 'Figtree', sans-serif;
  font-size: clamp(22px, 3.4vw, 30px);
  font-weight: 600;
  padding: clamp(18px, 3vw, 26px) clamp(20px, 3vw, 28px);
  transition: border-color 0.3s var(--ease-soft), background 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft);
}

.field::placeholder { color: rgba(184, 198, 182, 0.68); font-weight: 400; }

.field:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(18, 41, 28, 0.9);
  box-shadow: 0 0 0 5px rgba(217, 169, 78, 0.14);
}

textarea.field {
  min-height: 170px;
  resize: vertical;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.5;
  font-weight: 500;
}

.pw-wrap { position: relative; }

.pw-wrap .field { padding-right: 96px; }

.pw-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  cursor: pointer;
  padding: 10px;
}

.pw-toggle:hover { color: var(--accent-hover); }

.error {
  color: var(--error);
  font-size: 15.5px;
  margin-top: 14px;
  min-height: 22px;
}

/* ------------------------------------------------ boutons */

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #221803;
  font-family: 'Figtree', sans-serif;
  font-weight: 700;
  font-size: clamp(17px, 2vw, 19px);
  padding: 18px 38px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s var(--ease-soft), transform 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft);
}

.btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(217, 169, 78, 0.25);
}

.btn:disabled { opacity: 0.55; cursor: wait; }

.btn.ghost {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--line-strong);
}

.btn.ghost:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-hover); box-shadow: none; }

.enter-tip {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  color: rgba(180, 194, 178, 0.6);
}

.enter-tip b { color: var(--text-secondary); }

@media (pointer: coarse) {
  .btn { min-height: 52px; }
  .enter-tip { display: none; }
}

/* ------------------------------------------------ choix en grandes cartes */

.choices { display: grid; gap: 14px; }

.choice {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  text-align: left;
  background: rgba(18, 41, 28, 0.65);
  border: 2px solid var(--line);
  border-radius: 18px;
  color: var(--text-primary);
  font-family: 'Figtree', sans-serif;
  font-size: clamp(17px, 2.3vw, 21px);
  font-weight: 600;
  padding: clamp(18px, 2.6vw, 24px) clamp(20px, 3vw, 26px);
  cursor: pointer;
  transition: border-color 0.25s var(--ease-soft), background 0.25s var(--ease-soft), transform 0.25s var(--ease-soft);
}

.choice:hover { border-color: var(--line-strong); transform: translateX(4px); }

.choice.selected { border-color: var(--accent); background: rgba(217, 169, 78, 0.12); }

.choice .key {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  border: 1px solid var(--line-strong);
}

.choice small {
  display: block;
  font-weight: 400;
  font-size: 14.5px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ------------------------------------------------ photo */

.photo-guide {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.photo-guide span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--text-secondary);
}

.photo-zone {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
}

.photo-preview {
  position: relative;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 2px dashed var(--line-strong);
  background: rgba(18, 41, 28, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--text-secondary);
  flex: none;
  transition: border-color 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft);
}

.photo-preview.filled,
.photo-preview.live { border-style: solid; border-color: var(--accent); }

.photo-preview.live { box-shadow: 0 0 0 6px rgba(217, 169, 78, 0.12); }

.photo-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.photo-preview.filled img { display: block; }

.photo-done { display: none; }

.photo-preview.done .photo-done { display: block; }

.photo-preview.done img,
.photo-preview.done .photo-placeholder { display: none; }

.photo-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  transform: scaleX(-1); /* effet miroir, comme un vrai miroir */
}

.photo-preview.live video { display: block; }

.photo-preview.live .photo-placeholder,
.photo-preview.filled .photo-placeholder { display: none; }

.photo-preview.live img { display: none; }

/* la capture flashe brievement, comme un declencheur d'appareil photo */
.photo-preview.flash::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  animation: shutter-flash 0.45s var(--ease-soft);
}

@keyframes shutter-flash {
  from { opacity: 0.9; }
  to { opacity: 0; }
}

.photo-actions { display: grid; gap: 12px; }

.photo-actions .btn { justify-content: flex-start; }

.shutter {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: currentColor;
  flex: none;
}

input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* le champ fichier est masque : son focus clavier se voit sur le bouton qui le declenche */
.photo-actions:has(input[type="file"]:focus-visible) label.btn {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ------------------------------------------------ ecran final */

.congrats-badge {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 26px;
  animation: badge-pop 0.8s var(--ease) both 0.2s;
}

@keyframes badge-pop {
  0% { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.recap {
  background: rgba(18, 41, 28, 0.65);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 26px;
  margin: 30px 0;
  display: grid;
  gap: 12px;
}

.recap div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  font-size: 15.5px;
  align-items: baseline;
}

.recap dt { color: var(--text-secondary); }

.recap dd { font-weight: 600; text-align: right; }

.pay-card {
  border: 2px solid var(--line-strong);
  background: linear-gradient(160deg, rgba(217, 169, 78, 0.16), rgba(18, 41, 28, 0.7) 60%);
  border-radius: 20px;
  padding: 28px;
  margin-top: 8px;
}

.pay-card h2 { font-size: clamp(20px, 3vw, 26px); margin-bottom: 8px; }

.pay-card p { color: var(--text-secondary); font-size: 15.5px; margin-bottom: 20px; max-width: 52ch; }

.whats-next {
  margin-top: 26px;
  color: var(--text-secondary);
  font-size: 14.5px;
  max-width: 56ch;
}

/* ------------------------------------------------ indicateur de sauvegarde */

.save-indicator {
  position: fixed;
  bottom: 18px;
  right: 22px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(8, 23, 16, 0.8);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s var(--ease-soft), transform 0.4s var(--ease-soft);
  pointer-events: none;
}

.save-indicator.show { opacity: 1; transform: none; }

/* ------------------------------------------------ modale mot de passe (reprise) */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 12, 8, 0.75);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}

.modal-backdrop.open { display: flex; }

.modal {
  width: min(520px, 100%);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 34px 30px;
  animation: step-in 0.45s var(--ease-soft) both;
}

.modal-icone {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-muted);
  border: 2px solid var(--accent);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.modal h2 { font-size: 24px; margin-bottom: 10px; }

.modal-rappel {
  display: grid;
  gap: 10px;
  justify-items: start;
  background: rgba(217, 169, 78, 0.12);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.modal-rappel strong { font-size: 15px; color: var(--accent-hover); }

.modal-rappel span { font-size: 14px; color: var(--text-secondary); }

.modal p { color: var(--text-secondary); font-size: 15px; margin-bottom: 22px; }

.modal .field { font-size: 20px; }

.modal .actions { margin-top: 20px; }

.modal .alt {
  margin-top: 18px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.modal .alt a { color: var(--blush); }

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