/* ==========================================================================
   Spid Resto — page publique d'inscription (/register).

   Complement de ../css/style.css, jamais son remplacant : les jetons de
   couleur, `.btn`, `.input`, `.ico` et `.spinner` viennent de la feuille du
   portail. Ce fichier ne decrit que ce qui n'existe nulle part ailleurs — fil
   des etapes, carte, depot de photo, ecran de confirmation.

   Les trois regles du systeme visuel du portail tiennent ici aussi :
   une seule couleur de marque et elle designe l'action ; jamais de lisere d'un
   seul cote, un etat se dit par une bordure complete et une surface teintee ;
   aucun emoji, les icones sont le sprite SVG en tete de page.
   ========================================================================== */

.reg-body {
  /* Le portail verrouille le defilement (c'est une application). Cette page-ci
     est un document : elle doit defiler normalement, et rebondir comme le reste
     du web sur telephone. */
  overscroll-behavior-y: auto;
}

#reg {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------------ En-tete */

.reg-header {
  position: sticky;
  top: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.reg-brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.reg-brand:hover { text-decoration: none; }

.reg-brand-mark {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: var(--brand-500);
  color: #fff;
}

.reg-brand-name { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.reg-brand-name em { font-style: normal; color: var(--brand-600); }

.reg-header-link { font-size: 14px; font-weight: 600; }

/* -------------------------------------------------------------------- Corps */

.reg-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.reg-intro { margin-bottom: 24px; }
.reg-intro h1 { font-size: 27px; margin-bottom: 8px; }
.reg-intro p { color: var(--text-2); max-width: 56ch; }

.reg-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg, 14px);
  box-shadow: var(--sh-xs);
  padding: 24px;
}

.reg-card-narrow { max-width: 560px; margin: 0 auto; }

.reg-muted { color: var(--text-3); font-size: 14px; }

.reg-center { display: grid; place-items: center; gap: 12px; padding: 40px 0; }

/* ------------------------------------------------------------- Fil d'etapes */

.reg-steps {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.reg-step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  text-align: left;
  color: var(--text-3);
}

.reg-step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--n-100);
  color: var(--text-3);
  font-size: 13px;
  font-weight: 700;
}

.reg-step-label { display: flex; flex-direction: column; min-width: 0; }
.reg-step-label strong { font-size: 14px; font-weight: 650; color: var(--text-2); }
.reg-step-label em {
  font-style: normal;
  font-size: 12.5px;
  color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Etape courante : bordure COMPLETE et surface teintee, pas un trait lateral. */
.reg-step.is-current {
  border-color: var(--brand-300);
  background: var(--brand-50);
}
.reg-step.is-current .reg-step-num { background: var(--brand-500); color: #fff; }
.reg-step.is-current .reg-step-label strong { color: var(--brand-800); }

.reg-step.is-done { border-color: var(--ok-200); background: var(--ok-50); }
.reg-step.is-done .reg-step-num { background: var(--ok-500); color: #fff; }
.reg-step.is-done .reg-step-label strong { color: var(--ok-700); }

.reg-step-bar { flex: none; width: 22px; height: 2px; background: var(--n-200); border-radius: 2px; }
.reg-step-bar.is-done { background: var(--ok-500); }

/* ------------------------------------------------------------------- Champs */

.reg-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-3);
}
.reg-legend:first-child { margin-top: 0; }
.reg-legend .ico { color: var(--brand-500); }

.reg-field { margin-bottom: 16px; }

.reg-field > label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
}

.reg-req { color: var(--err-500); }

.reg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.reg-field .input::placeholder { color: var(--n-400); }
.reg-field .input:hover { border-color: var(--n-400); }
.reg-field .input:focus { border-color: var(--brand-400); box-shadow: var(--ring); }

/* Un champ en erreur porte sa bordure entiere en rouge et un fond tres pale :
   il reste identifiable une fois l'aide sous le champ lue et oubliee. */
.input.is-invalid {
  border-color: var(--err-500);
  background: var(--err-50);
}
.input.is-invalid:focus { box-shadow: 0 0 0 3px var(--err-200); }

.reg-hint { margin-top: 6px; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.reg-hint-block { margin: -6px 0 16px; max-width: 60ch; }

.reg-err {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--err-700);
}

.reg-suffix { display: flex; align-items: center; gap: 10px; }
.reg-suffix .input { max-width: 110px; }
.reg-suffix span { font-size: 14px; color: var(--text-3); }

/* Mot de passe : l'oeil est DANS le champ, pas a cote — a cote, il passe a la
   ligne sur telephone et se retrouve sous un champ qu'il ne designe plus. */
.reg-pass { position: relative; }
.reg-pass .input { padding-right: 44px; }
.reg-pass-toggle {
  position: absolute;
  top: 0; right: 0;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  color: var(--text-3);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.reg-pass-toggle:hover { color: var(--text); }

.reg-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
  cursor: pointer;
}
.reg-check input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--brand-500); flex: none; }

/* Piege a robots : sorti de l'ecran, jamais `display:none` — un robot qui
   respecte l'un ignore souvent l'autre. Aucun humain ne peut l'atteindre
   (hors flux, taille nulle, tabindex -1 dans le balisage). */
.reg-hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------------------- Alerte */

.reg-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 550;
  line-height: 1.45;
}
.reg-alert.is-error {
  border: 1px solid var(--err-200);
  background: var(--err-50);
  color: var(--err-700);
}
.reg-alert .ico { flex: none; margin-top: 1px; }

/* -------------------------------------------------------------------- Carte */

.reg-locate {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.reg-locate-state {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
}
.reg-locate-state.is-set { color: var(--ok-700); }

.reg-map-wrap { margin-bottom: 4px; }

.reg-map {
  height: 260px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--n-100);
  /* Leaflet pose ses tuiles en absolu : sans z-index maitrise ici, elles
     passent au-dessus de l'en-tete collant au defilement. */
  z-index: 0;
}

.reg-map-hint { margin-top: 6px; font-size: 12.5px; color: var(--text-3); }

/* Repere dessine en CSS plutot qu'avec les PNG de Leaflet : deux fichiers de
   moins a deployer, et il prend la couleur de la marque. */
.reg-pin {
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: var(--brand-500);
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(19,26,38,.35);
}

/* -------------------------------------------------------------- Photo */

.reg-drop {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  padding: 20px;
  border: 1.5px dashed var(--n-300);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--text-3);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.reg-drop:hover, .reg-drop.is-over { border-color: var(--brand-400); background: var(--brand-50); color: var(--brand-700); }
.reg-drop span { font-size: 14px; font-weight: 600; }
.reg-drop em { font-style: normal; font-size: 12.5px; }
.reg-drop.has-image { padding: 0; border-style: solid; overflow: hidden; min-height: 0; }
.reg-drop img { display: block; width: 100%; max-height: 220px; object-fit: cover; }

.reg-drop-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--err-700);
}

/* ------------------------------------------------------------------ Actions */

.reg-actions { display: flex; justify-content: flex-end; margin-top: 24px; }
.reg-actions-split { justify-content: space-between; gap: 12px; }

/* ------------------------------------------------- Confirmation et suivi */

.reg-status-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.reg-status-head h1 { font-size: 21px; }
.reg-status-head .ico { flex: none; width: 32px; height: 32px; }

.reg-status-head.is-approved .ico { color: var(--ok-500); }
.reg-status-head.is-pending  .ico { color: var(--warn-500); }
.reg-status-head.is-rejected .ico { color: var(--err-500); }

.reg-status-text { color: var(--text-2); line-height: 1.6; margin-bottom: 18px; }

.reg-reason {
  padding: 14px;
  margin-bottom: 18px;
  border: 1px solid var(--err-200);
  border-radius: var(--r-md);
  background: var(--err-50);
}
.reg-reason strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--err-700);
}
.reg-reason p { color: var(--text); line-height: 1.5; }

.reg-recap {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 8px;
}
.reg-recap > div {
  display: flex;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.reg-recap > div:last-child { border-bottom: none; }
.reg-recap > div:nth-child(odd) { background: var(--surface-2); }
.reg-recap dt { flex: none; width: 120px; color: var(--text-3); font-weight: 600; }
.reg-recap dd { color: var(--text); min-width: 0; word-break: break-word; }

.reg-recap-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-700);
}

.reg-track-box {
  padding: 14px;
  margin-bottom: 20px;
  border: 1px solid var(--warn-200);
  border-radius: var(--r-md);
  background: var(--warn-50);
}
.reg-track-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--warn-700);
}
.reg-track-row { display: flex; gap: 8px; }
.reg-track-row .input { font-size: 13px; background: var(--surface); }

.reg-next {
  margin: 0;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}
.reg-next li { margin-bottom: 8px; }
.reg-next strong { color: var(--text); }

/* -------------------------------------------------------------- Pied de page */

.reg-footer {
  padding: 24px 20px 32px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}
.reg-footer p + p { margin-top: 4px; }

/* ------------------------------------------------------- Fenetre d'erreur */

/* Le squelette (.modal-overlay / .modal-content / .modal-actions) vient de la
   feuille du portail ; il ne reste ici que la tete rouge et la liste. */

.reg-modal { max-width: 460px; }

.reg-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.reg-modal-icon {
  flex: none;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--err-50);
  color: var(--err-500);
}

.reg-modal-list {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
}
.reg-modal-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  background: var(--n-50);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-2);
}
.reg-modal-list .ico { flex: none; margin-top: 2px; color: var(--err-500); }
/* Le libelle du champ sur sa propre ligne : « Quartier » puis la consigne, ce
   qui se lit comme le formulaire lui-meme. */
.reg-modal-list strong {
  display: block;
  font-weight: 640;
  color: var(--text);
}

/* ---------------------------------------------------------------- Telephone */

@media (max-width: 640px) {
  .reg-main { padding: 20px 14px 40px; }
  .reg-card { padding: 18px 16px; border-radius: var(--r-md); }
  .reg-intro h1 { font-size: 22px; }

  /* Deux colonnes de 160 px coupent « Téléphone du restaurant » au milieu. */
  .reg-row { grid-template-columns: 1fr; gap: 0; }

  /* Le fil des etapes garde ses pastilles mais perd ses sous-titres : trois
     mots tronques n'informent personne et volent la largeur du libelle. */
  .reg-step-label em { display: none; }
  .reg-step-bar { width: 12px; }

  .reg-map { height: 220px; }

  /* Les deux boutons de bas d'etape passent pleine largeur, « Envoyer » en
     premier sous le pouce. */
  .reg-actions { flex-direction: column-reverse; gap: 10px; }
  .reg-actions .btn { width: 100%; }

  .reg-recap > div { flex-direction: column; gap: 2px; }
  .reg-recap dt { width: auto; }

  .reg-track-row { flex-direction: column; }
  .reg-track-row .btn { width: 100%; }

  /* La feuille du bas du portail s'applique telle quelle. Seul le `spacer`
     saute : il sert la-bas a isoler une action destructive sur sa propre
     ligne, alors qu'ici « Fermer » et « Corriger » vont ensemble. */
  .modal-actions .spacer { display: none; }
}
