/* GR Medical Blog — modale di prenotazione (componente M1).
 *
 * Estratto da blog.css: la modale serve anche dove il blog non c'è — la
 * barra di ricerca della homepage la apre sui risultati, e caricare 47 KB di
 * stili del blog per averla sarebbe tempo di caricamento regalato.
 *
 * ⚠️ La modale è agganciata al <body>, quindi sta FUORI da .grmb e le
 * variabili di colore sono ridichiarate su .grmb-modal: vanno tenute
 * allineate al blocco in cima a blog.css.
 */
/* ---------- M1 · modale ---------- */
@keyframes grmbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes grmbUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

/* La modale è agganciata al <body>, quindi sta FUORI da .grmb: le variabili
   di colore vanno ridichiarate qui, altrimenti risultano non definite e le
   dichiarazioni che le usano vengono scartate — bordi che spariscono, sfondi
   trasparenti. Vanno tenute allineate al blocco in cima al file. */
.grmb-modal {
  display: none;
  --grmb-primary: #00679A;
  --grmb-dark: #014D6B;
  --grmb-cta: #0087BD;
  --grmb-accent: #18A1DC;
  --grmb-muted: #707376;
  --grmb-muted2: #7B8E9B;
  --grmb-slate: #4F6B7C;
  --grmb-border: #DCE6EE;
  --grmb-chip: #E6F0F7;
  --grmb-soft: #F5F8FB;
}
.grmb-modal.is-open {
  position: fixed; inset: 0; z-index: 100010; /* sopra i pulsanti flottanti, che stanno a 99999 */
  background: rgba(15,42,58,.58);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  animation: grmbFade 200ms cubic-bezier(.2,.8,.2,1);
  font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.5;
}
/* Il tema applica margini, bordi e maiuscoletto a button/h3/p/input: dentro
   la modale si azzerano. Il reset sta in :where(), che non aggiunge
   specificità: così le regole dei componenti qui sotto vincono comunque e
   non serve rincorrerle con !important. */
.grmb-modal :where(*, *::before, *::after) { box-sizing: border-box; }
.grmb-modal :where(h3, h4, p, label) { margin: 0; }
.grmb-modal :where(button, input, select) {
  margin: 0; box-shadow: none; text-transform: none; letter-spacing: normal;
  border: none; background: none; line-height: 1.5;
}
.grmb-modal :where(a) { text-decoration: none; }

/* L'ingresso del riquadro gira SOLO mentre la modale sta entrando.
 *
 * `render()` rifa' l'innerHTML di tutto: se l'animazione stesse sul riquadro,
 * questo verrebbe ricreato a ogni ridisegno e l'animazione ripartirebbe da
 * capo — scegliendo una data la modale sembrava richiudersi e riaprirsi. La
 * classe `is-entering` sta sull'involucro, che `render()` non ricrea, e la
 * toglie il JS quando l'ingresso e' finito.
 */
.grmb-modal.is-entering .grmb-m-box {
  animation: grmbUp 220ms cubic-bezier(.2,.8,.2,1);
}

.grmb-m-box {
  width: 100%; max-width: 640px;
  /* `dvh` tiene conto della barra degli indirizzi dei browser mobili, che
     `vh` ignora: senza, il pannello sfora sopra il bordo visibile e la
     testata resta fuori schermo. Il `vh` prima fa da ripiego per i
     browser vecchi. */
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  background: #fff; border-radius: 14px; box-shadow: 0 34px 70px rgba(1,77,107,.4);
  display: flex; flex-direction: column; overflow: hidden;
}
.grmb-m-head { flex: none; padding: 16px 20px 15px; border-bottom: 1px solid var(--grmb-border); }
.grmb-m-head-row { display: flex; align-items: center; gap: 12px; }
.grmb-m-head-txt { flex: 1; min-width: 0; }
.grmb-m-head-txt span {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--grmb-muted2);
}
.grmb-m-head-txt b { display: block; font-size: 14.5px; font-weight: 700; color: var(--grmb-dark); line-height: 1.3; margin-top: 2px; }
.grmb-m-price { flex: none; font-size: 16px; font-weight: 800; color: var(--grmb-primary); }
.grmb-m-x, .grmb-m-back {
  flex: none; font-family: inherit; color: var(--grmb-slate);
  background: #fff; border: 1px solid var(--grmb-border); border-radius: 8px; cursor: pointer;
}
.grmb-m-x { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; }
.grmb-m-back { font-size: 13px; font-weight: 700; color: var(--grmb-dark); padding: 7px 11px; }
.grmb-m-bar { height: 4px; border-radius: 999px; background: var(--grmb-chip); overflow: hidden; margin-top: 13px; }
.grmb-m-bar span {
  display: block; height: 100%; border-radius: 999px; background: var(--grmb-primary);
  transition: width 300ms cubic-bezier(.2,.8,.2,1);
}
.grmb-m-body { flex: 1 1 auto; overflow-y: auto; padding: 22px 20px 24px; }

.grmb-m-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--grmb-cta); margin-bottom: 5px;
}
.grmb-m-h { font-size: 22px; font-weight: 800; color: var(--grmb-primary); margin: 0 0 18px; }
.grmb-m-lead { font-size: 14px; line-height: 1.55; color: var(--grmb-muted); font-weight: 500; margin: -12px 0 18px; }

/* passo date */
.grmb-m-slots { display: flex; flex-direction: column; gap: 10px; }
.grmb-m-first {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--grmb-primary); background: var(--grmb-chip);
  border-radius: 999px; padding: 4px 10px; margin-bottom: 8px;
}
.grmb-m-slot {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  font-family: inherit; padding: 13px 16px;
  border: 1.5px solid var(--grmb-border); border-radius: 12px; background: #fff; cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.grmb-m-slot.is-sel { border-color: var(--grmb-primary); background: var(--grmb-chip); }
.grmb-m-radio {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #B8CBD9; display: flex; align-items: center; justify-content: center;
}
.grmb-m-slot.is-sel .grmb-m-radio { border-color: var(--grmb-primary); }
.grmb-m-radio span { width: 10px; height: 10px; border-radius: 50%; background: transparent; }
.grmb-m-slot.is-sel .grmb-m-radio span { background: var(--grmb-primary); }
.grmb-m-av {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  background: var(--grmb-chip); color: var(--grmb-primary);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.grmb-m-when { flex: 1; min-width: 0; }
.grmb-m-when-l { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.grmb-m-when-l b { font-size: 15.5px; font-weight: 800; color: var(--grmb-dark); }
.grmb-m-when-l i { font-style: normal; font-size: 15.5px; font-weight: 700; color: var(--grmb-primary); }
.grmb-m-doc { display: block; font-size: 12.5px; font-weight: 500; color: var(--grmb-muted2); margin-top: 2px; }
.grmb-m-more {
  font-family: inherit; font-size: 14px; font-weight: 700; color: var(--grmb-cta);
  background: #fff; border: 1.5px dashed #B8CBD9; border-radius: 11px; padding: 13px; cursor: pointer;
}
.grmb-m-help {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px;
  padding: 14px 16px; border: 1px solid var(--grmb-border); border-radius: 11px; background: var(--grmb-soft);
}
.grmb-m-help > div { flex: 1; min-width: 180px; font-size: 13.5px; line-height: 1.45; color: var(--grmb-slate); font-weight: 500; }
.grmb-m-help a {
  flex: none; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 700; color: #fff; text-decoration: none;
  background: var(--grmb-primary); border-radius: 9px; padding: 11px 17px;
}
.grmb-m-load, .grmb-m-empty { padding: 28px 10px; text-align: center; color: var(--grmb-muted); font-weight: 500; }
.grmb-m-tel {
  display: inline-block; margin-top: 12px; font-weight: 700; text-decoration: none;
  color: #fff; background: var(--grmb-primary); border-radius: 9px; padding: 11px 18px;
}

/* campi */
.grmb-m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 18px; }
.grmb-m-grid3 { display: grid; grid-template-columns: 1.4fr .7fr 1fr; gap: 13px; margin-bottom: 18px; }
.grmb-mf { min-width: 0; }
.grmb-mf.is-wide { grid-column: 1 / -1; }
.grmb-mf label { display: block; font-size: 12.5px; font-weight: 700; color: var(--grmb-dark); margin-bottom: 6px; }
.grmb-mi {
  width: 100%; font-family: inherit; font-size: 15px; font-weight: 500; color: #0F2A3A;
  padding: 12px 13px; border: 1.5px solid var(--grmb-border); border-radius: 9px; background: #fff;
}
.grmb-mi:focus { outline: none; border-color: var(--grmb-cta); box-shadow: 0 0 0 3px rgba(24,161,220,.18); }
.grmb-mi.is-err { border-color: #B4442F; }
.grmb-m-body > .grmb-mf { margin-bottom: 13px; }

.grmb-m-gdpr {
  display: flex; align-items: flex-start; gap: 11px; padding: 15px;
  border: 1.5px solid var(--grmb-border); border-radius: 11px; background: var(--grmb-soft); cursor: pointer;
}
.grmb-m-gdpr.is-err { border-color: #B4442F; }
.grmb-m-gdpr input { flex: none; width: 19px; height: 19px; margin-top: 1px; accent-color: var(--grmb-primary); cursor: pointer; }
.grmb-m-gdpr span { font-size: 13.5px; line-height: 1.5; color: var(--grmb-slate); font-weight: 500; }
.grmb-m-gdpr strong { color: var(--grmb-dark); font-weight: 700; }
.grmb-m-err { font-size: 13px; font-weight: 700; color: #B4442F; margin-top: 13px; }
.grmb-m-note {
  display: flex; gap: 11px; align-items: flex-start; padding: 14px 15px;
  border: 1px solid #C4EAF5; border-radius: 11px; background: #E8FBFF;
  font-size: 13.5px; line-height: 1.55; color: var(--grmb-slate); font-weight: 500;
}

/* conferma */
.grmb-m-done { text-align: center; padding-top: 6px; }
.grmb-m-check {
  width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--grmb-chip); color: var(--grmb-primary);
  display: flex; align-items: center; justify-content: center;
}
.grmb-m-done h3 { font-size: 24px; font-weight: 800; color: var(--grmb-primary); margin: 0 0 8px; }
.grmb-m-done > p { font-size: 15px; line-height: 1.55; color: var(--grmb-muted); font-weight: 500; margin: 0 0 22px; }
.grmb-m-recap {
  text-align: left; border: 1px solid var(--grmb-border); border-radius: 12px;
  background: var(--grmb-soft); padding: 18px; margin-bottom: 20px;
}
.grmb-m-recap > div { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.grmb-m-recap span { font-size: 13px; font-weight: 600; color: var(--grmb-muted2); }
.grmb-m-recap b { font-size: 13.5px; font-weight: 700; color: var(--grmb-dark); text-align: right; }
.grmb-m-recap-tot { padding-top: 10px; border-top: 1px dashed var(--grmb-border); margin-bottom: 0 !important; }
.grmb-m-recap-tot b { font-size: 16px; font-weight: 800; color: var(--grmb-primary); }
.grmb-m-bring { text-align: left; }
.grmb-m-bring > div:not(.grmb-m-eyebrow) {
  font-size: 14px; line-height: 1.5; color: var(--grmb-slate); font-weight: 500; margin-bottom: 9px;
  padding-left: 24px; position: relative;
}
.grmb-m-bring > div:not(.grmb-m-eyebrow)::before {
  content: "\2713"; position: absolute; left: 0; color: var(--grmb-primary); font-weight: 800;
}

/* piede */
.grmb-m-foot {
  flex: none; padding: 14px 20px 0; border-top: 1px solid var(--grmb-border); background: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.grmb-m-foot-txt { min-width: 0; }
.grmb-m-foot-txt b { display: block; font-size: 15.5px; font-weight: 800; color: var(--grmb-primary); }
.grmb-m-foot-txt span { display: block; font-size: 12.5px; font-weight: 600; color: var(--grmb-muted2); }
/* Al passaggio dei dati il piede ha il solo pulsante. Il contenitore e'
   `space-between`, che con un elemento solo lo spingerebbe a SINISTRA: qui
   torna a destra dov'era. Da telefono no: li' il piede e' in colonna e il
   pulsante si allarga per intero. */
.grmb-m-foot > .grmb-m-cta:only-child { margin-left: auto; }
.grmb-m-cta {
  flex: none; display: inline-flex; align-items: center; gap: 9px;
  font-family: inherit; font-size: 15px; font-weight: 700; color: #fff;
  background: var(--grmb-primary); border: none; border-radius: 9px;
  padding: 14px 24px; cursor: pointer; transition: background 200ms cubic-bezier(.2,.8,.2,1);
}
.grmb-m-cta:hover { background: var(--grmb-dark); }
.grmb-m-cta[disabled] { background: #B8CBD9; cursor: not-allowed; }
.grmb-m-safe {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 12px 20px 13px; padding-top: 11px; border-top: 1px solid #EEF3F7;
  font-size: 12.5px; font-weight: 600; color: var(--grmb-muted2); background: #fff;
}

/* su mobile la modale diventa un pannello che sale dal basso (M2) */
@media (max-width: 640px) {
  .grmb-modal.is-open { padding: 0; align-items: flex-end; }
  .grmb-m-box { max-width: none; max-height: 94vh; max-height: 94dvh; border-radius: 18px 18px 0 0; }
  .grmb-m-grid, .grmb-m-grid3 { grid-template-columns: 1fr; }
  .grmb-m-foot { flex-direction: column; align-items: stretch; gap: 12px; }
  /* Da telefono il prezzo sopra al pulsante resta solo al primo passaggio:
     dopo ruberebbe altezza a un pulsante che deve restare comodo da
     premere. Su desktop c'e' sempre, lo spazio non manca. */
  .grmb-m-foot-txt--largo { display: none; }
  .grmb-m-foot > .grmb-m-cta:only-child { margin-left: 0; }
  .grmb-m-cta { justify-content: center; }
}

/* --------------------------------------- la pagina, mentre la modale e' su
 *
 * I pulsanti fissi — Google Maps, WhatsApp, "Prenota" e la bolla della chat —
 * galleggiavano sopra la finestra di prenotazione: i primi tre stanno allo
 * stesso `z-index: 99999`, e a parita' vince chi viene dopo nel DOM; la bolla
 * della chat sta a 2147483600, cioe' quasi il massimo, e vincerebbe comunque.
 * Alzare la modale non basta: finche' e' aperta si tolgono di mezzo. La classe
 * la mettono `apri()` e `chiudi()`.
 */
body.grmb-aperta .gr-maps-circle,
body.grmb-aperta .gr-whatsapp-circle,
body.grmb-aperta .lqd-stickybar-wrap,
body.grmb-aperta #grm-launcher {
  display: none !important;
}

/* ------------------------------------------------------ la schermata d'attesa
 *
 * Dal progetto di prenotazione ("SpecialtyBooking.dc.html"): non un giro di
 * rotella, ma una barra che si riempie con dei messaggi che dicono cosa sta
 * succedendo. Le misure e i colori sono quelli del design.
 */
@keyframes grmbFill { from { width: 0; } to { width: 100%; } }
@keyframes grmbPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

.grmb-m-attesa {
  animation: grmbFade .25s ease;
  flex: 1 1 auto; display: flex; flex-direction: column;
  width: 100%; max-width: 520px; margin: 0 auto; text-align: center;
  padding: 28px 10px;
}
.grmb-m-attesa-mezzo { margin: auto 0; width: 100%; }
.grmb-m-attesa-icona {
  margin: 0 auto 18px; display: flex; align-items: center; justify-content: center;
  animation: grmbPulse 1.6s ease-in-out infinite;
}
.grmb-m-attesa-icona img { width: 52px; height: 52px; object-fit: contain; }
.grmb-m-attesa-stelle {
  display: inline-flex; align-items: center; gap: 3px;
  color: #FFC531; margin-bottom: 14px;
}
.grmb-m-attesa-titolo {
  margin: 0 0 26px; font-weight: 500; font-size: 21px; line-height: 1.32;
  color: var(--grmb-primary); text-wrap: pretty;
}
.grmb-m-attesa-titolo b { font-weight: 800; }
.grmb-m-attesa-barra {
  width: 100%; max-width: 340px; margin: 0 auto 20px; height: 8px;
  border-radius: 999px; background: var(--grmb-chip); overflow: hidden;
}
.grmb-m-attesa-barra span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--grmb-primary);
  animation: grmbFill 4s cubic-bezier(.4, 0, .2, 1) forwards;
}
.grmb-m-attesa-passo {
  min-height: 22px; font-size: 15px; font-weight: 700; color: var(--grmb-dark);
}

/* Chi ha chiesto meno movimento vede la barra piena e il messaggio, fermi. */
@media (prefers-reduced-motion: reduce) {
  .grmb-m-attesa-barra span { animation: none; width: 100%; }
  .grmb-m-attesa-icona { animation: none; }
}

/* ------------------------------------------------- il riepilogo, quarto passo
 *
 * Riusa la scheda della conferma (`.grmb-m-recap`): e' la stessa informazione,
 * prima invece che dopo, e vederla nella stessa forma aiuta a riconoscerla.
 * Qui in piu' ci sono le intestazioni di sezione col loro "Modifica".
 */
.grmb-m-riep-titolo {
  font-size: 21px; font-weight: 800; line-height: 1.25;
  color: var(--grmb-primary); margin: 2px 0 20px; text-wrap: pretty;
}

.grmb-m-riep-sez {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 7px;
}
.grmb-m-riep-sez .grmb-m-eyebrow { margin-bottom: 0; }

.grmb-m-edit {
  flex: none; font-family: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--grmb-cta); background: none; border: none; padding: 2px 0;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.grmb-m-edit:hover { color: var(--grmb-dark); }

/* Codice fiscale e residenza stanno nella stessa scheda dei contatti, ma
   staccati da una riga: sono dati che si sono scritti in un altro passaggio,
   e il loro "Modifica" porta li'. */
.grmb-m-riep-sotto {
  display: block !important;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--grmb-border);
}
.grmb-m-riep-sotto > div { display: flex; justify-content: space-between; gap: 14px; margin-bottom: 10px; }

/* Chiuso si vede l'appuntamento e il resto sfuma nel bianco: chi ha appena
   scritto i propri dati non ha bisogno di rileggerli tutti, gli serve
   controllare quando e con chi. Il resto si apre con un clic.
   ⚠️ La sfumatura deve finire nel colore del fondo della modale (#fff), non
   in `transparent`: su Safari `transparent` e' nero trasparente e la
   sfumatura vira al grigio sporco. */
.grmb-m-riep-corpo {
  position: relative;
  max-height: 232px;
  overflow: hidden;
}
.grmb-m-riep-corpo::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 86px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 82%);
  pointer-events: none;
}
.grmb-m-riep-corpo.is-aperto { max-height: none; }
.grmb-m-riep-corpo.is-aperto::after { display: none; }

.grmb-m-riep-tutto {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; margin-top: 2px; padding: 11px;
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  color: var(--grmb-cta); background: none;
  border: 1px solid var(--grmb-border); border-radius: 10px; cursor: pointer;
}
.grmb-m-riep-tutto:hover { background: var(--grmb-soft); }
.grmb-m-riep-tutto svg { transition: transform .2s; }
.is-aperto + .grmb-m-riep-tutto svg { transform: rotate(180deg); }

/* L'ultima scheda non ha bisogno di stacco: sotto c'e' gia' il piede. */
.grmb-m-riep > .grmb-m-recap:last-child { margin-bottom: 0; }
