/* ── Reset & variables ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bleu:        #0f3460;
  --bleu-mid:    #16213e;
  --accent:      #e94560;
  --accent2:     #0f3460;
  --or:          #f5a623;
  --gris-bg:     #f0f2f7;
  --gris-card:   #ffffff;
  --gris-bord:   #e2e8f0;
  --texte:       #1a202c;
  --texte-doux:  #64748b;
  --danger:      #e53e3e;
  --succes:      #38a169;
  --radius-sm:   8px;
  --radius:      16px;
  --radius-lg:   24px;
  --ombre:       0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -1px rgba(0,0,0,.04);
  --ombre-lg:    0 20px 40px -8px rgba(15,52,96,.18);
  --transition:  .25s cubic-bezier(.4,0,.2,1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--gris-bg);
  color: var(--texte);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Header ────────────────────────────────────────────────── */
header {
  background: linear-gradient(135deg, #0f3460 0%, #16213e 60%, #0f3460 100%);
  color: #fff;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(15,52,96,.4);
}

.logo-badge {
  background: linear-gradient(135deg, var(--or), #e8941a);
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(245,166,35,.35);
  letter-spacing: .5px;
}

.header-text .logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -.2px;
}
.header-text .subtitle {
  font-size: .78rem;
  opacity: .65;
  margin-top: 2px;
  font-weight: 400;
}

/* ── Conteneur ─────────────────────────────────────────────── */
.container {
  max-width: 620px;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

/* ── Indicateur d'étapes ───────────────────────────────────── */
.steps-wrapper {
  background: var(--gris-card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--ombre);
  display: flex;
  align-items: center;
  gap: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  gap: 6px;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 17px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 2px;
  background: var(--gris-bord);
  transition: background var(--transition);
}
.step.done:not(:last-child)::after { background: var(--bleu); }

.step-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gris-bord);
  background: var(--gris-bg);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .82rem;
  color: var(--texte-doux);
  z-index: 1;
  transition: all var(--transition);
  position: relative;
}

.step.active .step-circle {
  border-color: var(--bleu);
  background: var(--bleu);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(15,52,96,.15);
}

.step.done .step-circle {
  border-color: var(--succes);
  background: var(--succes);
  color: #fff;
}
.step.done .step-circle::after {
  content: '✓';
  font-size: .85rem;
}
.step.done .step-circle span { display: none; }

.step-label {
  font-size: .7rem;
  color: var(--texte-doux);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}
.step.active .step-label { color: var(--bleu); font-weight: 700; }
.step.done  .step-label  { color: var(--succes); }

/* ── Carte ─────────────────────────────────────────────────── */
.card {
  background: var(--gris-card);
  border-radius: var(--radius);
  box-shadow: var(--ombre);
  padding: 2rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255,255,255,.8);
  animation: slideUp .3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bleu);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--gris-bord);
}
.card-title .icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
}

/* ── Champs ────────────────────────────────────────────────── */
.field { margin-bottom: 1.25rem; }

.field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--texte-doux);
  margin-bottom: .45rem;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.field label .req { color: var(--accent); margin-left: 2px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--gris-bord);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  color: var(--texte);
  background: #fafbfd;
  transition: all var(--transition);
  font-family: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--bleu);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15,52,96,.1);
}

.field input.error { border-color: var(--danger); background: #fff5f5; }
.field textarea { resize: vertical; min-height: 80px; }

.field .err-msg {
  font-size: .76rem;
  color: var(--danger);
  margin-top: .3rem;
  display: none;
  font-weight: 500;
}
.field.has-error .err-msg { display: block; }

/* ── Radio pills ───────────────────────────────────────────── */
.pills-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .4rem; }

.pill {
  flex: 1; min-width: 120px;
  position: relative;
  cursor: pointer;
}
.pill input[type=radio] {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.pill-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .7rem 1rem;
  border: 1.5px solid var(--gris-bord);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  color: var(--texte-doux);
  background: #fafbfd;
  transition: all var(--transition);
  user-select: none;
  text-align: center;
}
.pill input:checked + .pill-body {
  border-color: var(--bleu);
  background: linear-gradient(135deg, #e8f0fe, #d2e3fc);
  color: var(--bleu);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(15,52,96,.1);
}
.pill:hover .pill-body { border-color: #a8c0e8; background: #f5f8ff; }

/* ── Type de place (grand) ─────────────────────────────────── */
.type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .4rem; }

.type-card {
  position: relative;
  cursor: pointer;
}
.type-card input[type=radio] { position: absolute; opacity: 0; }
.type-card-body {
  border: 2px solid var(--gris-bord);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all var(--transition);
  background: #fafbfd;
}
.type-card-body .tc-icon { font-size: 2rem; margin-bottom: .5rem; }
.type-card-body .tc-label { font-weight: 700; font-size: .9rem; color: var(--texte); }
.type-card-body .tc-sub { font-size: .75rem; color: var(--texte-doux); margin-top: 3px; }

.type-card input:checked + .type-card-body {
  border-color: var(--bleu);
  background: linear-gradient(135deg, #f0f5ff, #e8f0fe);
  box-shadow: 0 0 0 3px rgba(15,52,96,.12);
}
.type-card input:checked + .type-card-body .tc-label { color: var(--bleu); }

/* ── Créneaux groupe ───────────────────────────────────────── */
.creneaux-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .65rem; margin-top: .4rem; }

.creneau-card {
  position: relative;
  cursor: pointer;
}
.creneau-card input[type=radio] { position: absolute; opacity: 0; }
.creneau-body {
  border: 2px solid var(--gris-bord);
  border-radius: var(--radius-sm);
  padding: .9rem .5rem;
  text-align: center;
  transition: all var(--transition);
  background: #fafbfd;
}
.creneau-body .heure { font-weight: 700; font-size: .85rem; color: var(--bleu); }
.creneau-body .dispo { font-size: .7rem; color: var(--texte-doux); margin-top: 4px; }

.creneau-card input:checked + .creneau-body {
  border-color: var(--bleu);
  background: linear-gradient(135deg, #f0f5ff, #e8f0fe);
  box-shadow: 0 0 0 3px rgba(15,52,96,.12);
}
.creneau-card.complet .creneau-body {
  opacity: .4; cursor: not-allowed;
  background: #f5f5f5;
}
.creneau-card.complet .heure { color: var(--texte-doux); }

/* ── Boutons ───────────────────────────────────────────────── */
.btn-row { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.75rem; }

.btn {
  padding: .8rem 1.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: inherit;
  display: flex; align-items: center; gap: .5rem;
  letter-spacing: .2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--bleu) 0%, #1a4a7a 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(15,52,96,.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15,52,96,.45);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--texte-doux);
  border: 1.5px solid var(--gris-bord);
}
.btn-ghost:hover { background: var(--gris-bg); color: var(--texte); }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Alertes ───────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .88rem;
  font-weight: 500;
  display: none;
  align-items: flex-start;
  gap: .6rem;
  animation: slideUp .2s ease;
}
.alert.show { display: flex; }
.alert-success { background: #f0fff4; border: 1.5px solid #9ae6b4; color: #276749; }
.alert-error   { background: #fff5f5; border: 1.5px solid #feb2b2; color: #9b2c2c; }
.alert-info    { background: #ebf8ff; border: 1.5px solid #90cdf4; color: #2a4365; }

/* ── Dispo badge ───────────────────────────────────────────── */
.dispo-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: linear-gradient(135deg, #f0fff4, #c6f6d5);
  border: 1px solid #9ae6b4;
  color: #276749;
  font-size: .78rem;
  font-weight: 700;
  padding: .3rem .75rem;
  border-radius: 20px;
  margin-bottom: 1rem;
}
.dispo-badge::before { content: '●'; font-size: .55rem; }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Récap ─────────────────────────────────────────────────── */
.recap-banner {
  background: linear-gradient(135deg, var(--bleu) 0%, #1a4a7a 100%);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .75rem;
  box-shadow: 0 4px 14px rgba(15,52,96,.3);
}
.recap-banner .recap-icon { font-size: 1.5rem; }
.recap-banner .recap-date { font-weight: 700; font-size: .95rem; }
.recap-banner .recap-type { font-size: .8rem; opacity: .8; margin-top: 2px; }

/* ── Confirmation ──────────────────────────────────────────── */
.confirmation {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
}

.conf-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f0fff4, #c6f6d5);
  border: 3px solid #68d391;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 1.5rem;
  animation: pop .4s cubic-bezier(.17,.67,.4,1.3);
}
@keyframes pop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.confirmation h2 { font-size: 1.5rem; color: var(--succes); margin-bottom: .5rem; }
.confirmation .conf-sub { color: var(--texte-doux); font-size: .9rem; margin-bottom: 1.5rem; }

.conf-details {
  background: var(--gris-bg);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  text-align: left;
}
.conf-row { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; }
.conf-row:not(:last-child) { border-bottom: 1px solid var(--gris-bord); }
.conf-row .conf-key { font-size: .78rem; color: var(--texte-doux); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.conf-row .conf-val { font-size: .88rem; font-weight: 700; color: var(--texte); }

.ref-box {
  background: linear-gradient(135deg, #ebf8ff, #bee3f8);
  border: 1.5px solid #90cdf4;
  border-radius: var(--radius-sm);
  padding: .75rem 1.25rem;
  font-family: 'Courier New', monospace;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--bleu);
  letter-spacing: 1px;
  margin-bottom: 1rem;
}

.email-notice {
  font-size: .82rem;
  color: var(--texte-doux);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  margin-bottom: 1.5rem;
}

/* ── Section cachée ────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 500px) {
  .container { padding: 1rem .75rem 3rem; }
  .card { padding: 1.25rem; }
  .btn-row { flex-direction: column-reverse; }
  .btn { width: 100%; justify-content: center; }
  .type-grid { grid-template-columns: 1fr; }
  .creneaux-grid { grid-template-columns: 1fr; }
  .pills-row { flex-direction: column; }
}
