/* ============================================================
   demande.css — la demande de réservation en étapes (demande.js).
   Chargé après styles.css, qu'il ne modifie pas.
   ============================================================ */

.modal.wz { width: min(560px, calc(100vw - 32px)); }
.modal.wz form { padding: 22px 22px 18px; }
.modal.wz h2 { margin-bottom: 4px; }

.wz-tete { margin: 6px 0 18px; }
.wz-etape {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.wz-barre {
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.wz-barre span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .2s ease;
}
.wz-question { margin: 16px 0 0; font-size: 19px; font-weight: 600; line-height: 1.3; }

/* Présentation de la salle choisie : la coche apparaît, le nom monte. */
.wz-intro {
  min-height: 150px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  text-align: center;
}
/* `display: grid` l'emporterait sur l'attribut `hidden` sans cette règle. */
.wz-intro[hidden] { display: none; }
.wz-intro-coche {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--free);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.wz-intro-titre {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.wz-intro-nom { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: .02em; }
.wz-intro-sous { margin: 0; font-size: 13px; color: var(--text-soft); }
.wz-intro-sous:empty { display: none; }

.wz-intro.joue .wz-intro-coche { animation: wz-coche .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.wz-intro.joue .wz-intro-titre { animation: wz-monte .35s ease-out .1s both; }
.wz-intro.joue .wz-intro-nom   { animation: wz-monte .4s ease-out .2s both; }
.wz-intro.joue .wz-intro-sous  { animation: wz-monte .4s ease-out .3s both; }

@keyframes wz-coche {
  from { transform: scale(.3); opacity: 0; }
  to   { transform: scale(1);  opacity: 1; }
}
@keyframes wz-monte {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: none;             opacity: 1; }
}

/* « Suivant » qui s'enfonce tout seul à la fin de la présentation. */
#wz-suivant.wz-appui { transform: scale(.94); filter: brightness(.9); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
#wz-suivant { transition: transform .12s ease, filter .12s ease, box-shadow .12s ease; }

@media (prefers-reduced-motion: reduce) {
  .wz-intro.joue * { animation: none !important; }
}

/* Journée de la salle, à droite de la date et des horaires. */
.modal.wz.wz-large { width: min(780px, calc(100vw - 32px)); }
.wz-page.avec-journee {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 20px;
  align-items: start;
}
.wz-page.avec-journee[hidden] { display: none; }
.wz-page.avec-journee .field-row { grid-template-columns: 1fr 1fr; }

.wz-journee {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 10px 12px;
  background: var(--surface);
}
/* Encadré de la salle, en tête de la journée : on peut en changer ici. */
.wz-salle-choix {
  display: block;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
}
.wz-salle-choix span {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.wz-salle-choix select {
  width: 100%;
  margin-top: 2px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  color-scheme: light dark;
}
.wz-salle-choix select:focus { outline: none; }
.wz-salle-choix:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.wz-journee-tete { margin: 0 0 8px; display: flex; flex-direction: column; font-size: 13px; }
.wz-journee-tete span { color: var(--text-soft); font-size: 12px; }
.wz-journee-tete span::first-letter { text-transform: uppercase; }

.wz-journee-grille {
  position: relative;
  margin-left: 40px;
  border-left: 1px solid var(--border);
  cursor: crosshair;
  background-image: repeating-linear-gradient(to bottom,
    var(--border) 0, var(--border) 1px, transparent 1px, transparent 26px);
}
.wz-j-heure {
  position: absolute;
  left: -44px;
  width: 38px;
  transform: translateY(-50%);
  text-align: right;
  font-size: 10.5px;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.wz-j-bloc, .wz-j-demande {
  position: absolute;
  left: 4px;
  right: 4px;
  overflow: hidden;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.wz-j-bloc.pris { background: color-mix(in srgb, var(--busy) 18%, var(--surface)); color: var(--busy); border: 1px solid color-mix(in srgb, var(--busy) 45%, transparent); cursor: not-allowed; }
.wz-j-bloc.attente { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--soon) 30%, var(--surface)) 0 5px, var(--surface) 5px 10px); color: var(--text); border: 1px dashed var(--soon); }
.wz-j-demande { left: 18px; right: 0; font-weight: 700; color: #fff; z-index: 1; box-shadow: 0 2px 8px rgba(0,0,0,.15); pointer-events: none; }
.wz-j-demande.libre { background: var(--free); }
.wz-j-demande.conflit { background: var(--busy); }

.wz-journee-alerte { margin: 10px 0 0; font-size: 12px; line-height: 1.4; padding: 7px 9px; border-radius: 8px;
  background: color-mix(in srgb, var(--soon) 16%, var(--surface)); }
.wz-journee-alerte.conflit { background: color-mix(in srgb, var(--busy) 14%, var(--surface)); color: var(--busy); font-weight: 600; }

/* Calendrier du mois pour choisir la date (étape Date et horaires). */
.wz-mois { margin-bottom: 12px; }
.wz-mois-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.wz-mois-tete strong { font-size: 15px; }
.wz-mois-tete strong::first-letter { text-transform: uppercase; }
.wz-mois-tete .btn.icon { padding: 4px 10px; }
.wz-mois-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wz-m-dow { font-size: 11px; text-align: center; color: var(--text-soft); line-height: 1.8; }
.wz-m-jour {
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.wz-m-jour:hover:not(:disabled) { border-color: var(--accent); }
.wz-m-jour.n1 { background: color-mix(in srgb, var(--busy) 10%, var(--surface)); }
.wz-m-jour.n2 { background: color-mix(in srgb, var(--busy) 22%, var(--surface)); }
.wz-m-jour.n3 { background: color-mix(in srgb, var(--busy) 38%, var(--surface)); }
.wz-m-jour.n4 { background: color-mix(in srgb, var(--busy) 58%, var(--surface)); color: #fff; }
.wz-m-jour.is-today { font-weight: 700; border-color: var(--text-soft); }
.wz-m-jour.is-choisi { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.wz-m-jour.is-passe { opacity: .35; cursor: default; }
.wz-mois-legende { margin: 8px 0 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-soft); }
.wz-mois-legende span { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--border); margin-left: 6px; }
.wz-mois-legende span:first-child { margin-left: 0; }
.wz-mois-legende .n0 { background: var(--surface); }
.wz-mois-legende .n2 { background: color-mix(in srgb, var(--busy) 22%, var(--surface)); }
.wz-mois-legende .n4 { background: color-mix(in srgb, var(--busy) 58%, var(--surface)); }
/* Le calendrier remplace le champ date, qui reste pour app.js. */
.wz-page .wz-mois + label.field { display: none; }

/* Champ en conflit : la case passe en rouge. */
.wz-page .field input.wz-en-conflit, .wz-page .field select.wz-en-conflit {
  border-color: var(--busy);
  background: color-mix(in srgb, var(--busy) 8%, var(--bg));
  color: var(--busy);
}
#wz-suivant:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }

@media (max-width: 620px) {
  .wz-page.avec-journee { grid-template-columns: 1fr; }
}

/* Une étape tient sur un écran : champs larges, texte lisible au doigt. */
.wz-page { min-height: 150px; }
.wz-page .field input, .wz-page .field select { font-size: 16px; padding: 11px 13px; }
.wz-page .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Logistique : une case, un libellé, une quantité qui s'allume quand on coche. */
.wz-page .checks { grid-template-columns: 1fr; gap: 6px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.wz-page .check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 76px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.wz-page .check:has(input[type=checkbox]:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}
.wz-page .check .wz-qte {
  width: 100%;
  height: auto;
  font: inherit;
  font-size: 15px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  text-align: right;
  color-scheme: light dark;
}
.wz-page .check .wz-qte:disabled { opacity: .35; }

.wz-nav { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.wz-espace { flex: 1; }
.wz-nav [hidden] { display: none; }

@media (max-width: 520px) {
  .wz-page .field-row { grid-template-columns: 1fr; }
  /* Le bouton principal passe sur sa propre ligne, pleine largeur. */
  .wz-nav { flex-wrap: wrap; }
  .wz-nav .btn-primary { flex: 1 1 100%; order: 3; }
}
