/* ==========================================================================
   Centro Anna Rita Buonincontro — pagina CONTATTI
   --------------------------------------------------------------------------
   Ordine di caricamento:
     css/base.css → css/inner.css → css/contatti.css
   Riutilizza da base.css: token, bottoni (.btn, .btn--teal), header/menu,
   .hero__bg / .hero__bg-img, .booking, .maps (fascia finale e stile di
   pin/popup delle mappe), footer, back-to-top.
   Riutilizza da inner.css: .cs-container, .cs-eyebrow, .page-hero.
   Riferimento design: artboard 1728px (contatti/Contatti.pdf).

   Struttura della pagina:
     .page-hero.ct-hero        → Hero (eyebrow + titolo + sottotitolo)
     .ct-contacts              → .ct-top: a sinistra la card bianca con il modulo
                                 contatti (sale di 112px sopra l'Hero), a destra
                                 3 card impilate (Recapiti, Sedi Operative,
                                 Direzione e Responsabili); sotto, a tutta
                                 larghezza, la card "Posta Elettronica" su 3
                                 colonne, che scende nella fascia Prenota
     .booking.ct-booking       → CTA MioDottore (identica alla Home)
     .maps                     → identiche alla Home

   Indice
   01. Hero (variante)
   02. Disposizione delle card
   03. Card
   04. Modulo contatti
   05. Card "Posta Elettronica"
   06. Prenota (variante)
   07. Responsive
   ========================================================================== */

/* 01. Hero --------------------------------------------------------------- */
/* A 1728 la foto (1728×1152) parte 140px sopra la pagina: 18.7% con il margine
   del parallax di .hero__bg-img (inset -8%) */
.ct-hero .hero__bg-img { background-position: 50% 18.7%; }
.ct-hero .page-hero__text { margin-top: 35px; }

/* 02. Disposizione delle card --------------------------------------------- */
/* A 1728: Hero fino a 552px, card da 440px (--ct-rise); fondo bianco fino a 1475px,
   card "Posta Elettronica" fino a 1556px (--ct-overlap nella fascia Prenota). */
:root { --ct-rise: 112px; --ct-overlap: 81px; }
.ct-contacts {
  position: relative; z-index: 1;                   /* sopra l'Hero e la fascia .booking */
  margin-top: calc(-1 * var(--ct-rise)); margin-bottom: calc(-1 * var(--ct-overlap));
}
.ct-contacts > .cs-container { max-width: 1201px; }
/* Colonne del design: 754px + 424px, 23px di spazio; le 3 card di destra occupano
   l'altezza del modulo (19px tra una e l'altra) */
.ct-top { display: grid; grid-template-columns: minmax(0, 754fr) minmax(0, 424fr); gap: 23px; }
.ct-side { display: flex; flex-direction: column; gap: 19px; min-width: 0; }
.ct-side > .ct-card { flex: 1 1 auto; }

/* 03. Card --------------------------------------------------------------- */
.ct-card {
  --ct-pad: 37px;
  min-width: 0; padding: 24px var(--ct-pad) 24px;
  background: var(--mist); box-shadow: 0 4px 20px rgba(79, 117, 139, .2);
  font-family: var(--ff-head); font-weight: 400; font-size: 14px; line-height: 20px; color: var(--gray-600);
  /* "translate" (e non "transform") per l'hover: non interferisce con il reveal GSAP */
  transition: translate .5s var(--ease), box-shadow .5s var(--ease);
}
.ct-side > .ct-card:hover, .ct-side > .ct-card:focus-within { translate: 0 -6px; box-shadow: 0 18px 34px -12px rgba(1, 100, 106, .35); }
.ct-card__title { font-family: var(--ff-head); font-weight: 700; font-size: 20px; line-height: 24px; color: var(--slate); }
.ct-card strong { font-weight: 700; }

/* Distanze titolo → contenuto del design */
.ct-card__list { margin-top: 19px; display: flex; flex-direction: column; gap: 8px; }
.ct-card--recapiti .ct-card__list { margin-top: 28px; }
.ct-card--direzione .ct-card__list { margin-top: 14px; }
/* Sedi: indirizzo su 2 righe, 19px tra le due sedi */
.ct-card--sedi .ct-card__list { gap: 19px; }

/* Link: telefono nel colore del testo, email in teal; sottolineatura che si disegna da sinistra */
.ct-card a {
  overflow-wrap: anywhere;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: color .3s var(--ease), background-size .4s var(--ease);
}
.ct-card a:hover, .ct-card a:focus-visible { background-size: 100% 1px; }
.ct-card a[href^="mailto:"] { color: var(--teal); }
.ct-card a[href^="mailto:"]:hover { color: var(--teal-deep); }
.ct-card a[href^="tel:"]:hover { color: var(--teal); }

/* 04. Modulo contatti ----------------------------------------------------- */
/* Card bianca: 82px di margine laterale, etichette a 84px dall'alto, pulsante a 55px dal fondo */
.ct-form-card {
  min-width: 0; padding: 84px 82px 55px;
  background: var(--white); box-shadow: 0 4px 20px rgba(79, 117, 139, .2);
}
.ct-form { scroll-margin-top: 140px; }
.ct-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 47px 20px; }
.ct-field { display: flex; flex-direction: column; min-width: 0; }
.ct-field--full { grid-column: 1 / -1; margin-top: -3px; }
.ct-field label {
  margin-bottom: 4px;
  font-family: var(--ff-head); font-weight: 700; font-size: 14px; line-height: 16px;
  text-transform: uppercase; color: var(--gray-600);
}
.ct-field__opt { font-weight: 400; text-transform: none; color: var(--muted); }
.ct-field input, .ct-field textarea {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid #a1b4bf; border-radius: 2px; background: #f5f5f5;
  font-family: var(--ff-body); font-weight: 400; font-size: 16px; line-height: 24px; color: var(--ink-2);
  transition: border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.ct-field textarea { height: 99px; min-height: 99px; padding-block: 9px; resize: vertical; }
.ct-field input:hover, .ct-field textarea:hover { border-color: var(--slate); }
.ct-field input:focus, .ct-field textarea:focus {
  outline: none; border-color: var(--teal); background: var(--white); box-shadow: 0 0 0 3px rgba(1, 156, 165, .18);
}
.ct-field [aria-invalid="true"] { border-color: #b3261e; background: #fff8f7; }
.ct-field__error { margin-top: 5px; font-family: var(--ff-head); font-size: 13px; line-height: 16px; color: #b3261e; text-align: left; }
/* Dentro la griglia l'errore non sposta la riga successiva */
.ct-form__grid .ct-field { position: relative; }
.ct-form__grid .ct-field__error { position: absolute; top: 100%; left: 0; right: 0; }

/* Campo trappola per i bot: fuori dallo schermo, non raggiungibile da tastiera */
.ct-form__trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Consenso: casella 13px con bordo slate, testo 14px */
.ct-check {
  display: grid; grid-template-columns: 13px minmax(0, 1fr); column-gap: 14px; align-items: start;
  margin-top: 18px; font-family: var(--ff-head); font-weight: 400; font-size: 14px; line-height: 18px; color: var(--muted);
}
.ct-check input {
  appearance: none; -webkit-appearance: none; width: 13px; height: 13px; margin: 2px 0 0;
  border: 1px solid var(--slate); border-radius: 1px; background: #f5f5f5 center / 9px 9px no-repeat; cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.ct-check input:checked {
  border-color: var(--teal); background-color: var(--teal);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M1.5 5.2 4 7.6 8.5 2.6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.ct-check input[aria-invalid="true"] { border-color: #b3261e; }
.ct-check label { cursor: pointer; }
.ct-check a { font-weight: 700; color: var(--teal); text-decoration: underline; text-underline-offset: 2px; }
.ct-check a:hover { color: var(--teal-deep); }
.ct-check .ct-field__error { grid-column: 2; }

.ct-form__captcha { margin-top: 20px; }
.ct-form__captcha:empty { display: none; }

/* Pulsante a tutta larghezza, 60px (34px sotto la casella del consenso) */
.ct-form__submit { width: 100%; min-height: 60px; margin-top: 31px; text-transform: uppercase; }
.ct-form__submit:disabled { opacity: .6; pointer-events: none; }

/* Esito dell'invio (vuoto finché non serve) */
.ct-form__status {
  margin-top: 18px; padding: 12px 16px; border-left: 3px solid var(--slate); background: var(--mist);
  font-family: var(--ff-head); font-size: 16px; line-height: 22px; color: var(--ink-2); text-align: left;
}
.ct-form__status:empty { display: none; }
.ct-form__status:focus { outline: none; }
.ct-form__status.is-success { border-color: var(--teal); }
.ct-form__status.is-error { border-color: #b3261e; background: #fff4f2; }

/* 05. Card "Posta Elettronica" ------------------------------------------- */
/* 46px sotto il modulo; 3 colonne riempite dall'alto in basso (--ct-rows-3 dal template):
   etichetta maiuscola + indirizzo in monospazio */
.ct-card--mail { --ct-pad: 83px; margin-top: 46px; padding-top: 55px; padding-bottom: 69px; }
.ct-mail {
  margin: 36px 0 0; display: grid; grid-auto-flow: column;
  grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(var(--ct-rows-3, 5), auto);
  gap: 23px; align-content: start;
}
.ct-mail dt, .ct-mail dd { margin: 0; }
.ct-mail dt {
  font-family: var(--ff-head); font-weight: 600; font-size: 12.5px; line-height: 16px;
  text-transform: uppercase; color: var(--muted);
}
.ct-mail dd { margin-top: 6px; font-family: 'Roboto Mono', ui-monospace, monospace; font-size: 12px; line-height: 16px; }

/* 06. Prenota ------------------------------------------------------------ */
/* Stessa fascia della Home; lo spazio in alto tiene conto della card sovrapposta
   (a 1728: logo 148px sotto la card, pulsante 139px sopra la fine) */
.ct-booking { min-height: 0; padding-top: calc(148px + var(--ct-overlap)); padding-bottom: 139px; }

/* 07. Responsive --------------------------------------------------------- */
/* ≤1199 — modulo a tutta larghezza; sotto, Recapiti e Sedi affiancate e Direzione su due colonne */
@media (max-width: 1199.98px) {
  .ct-top { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .ct-form-card { padding: 56px 56px 48px; }
  .ct-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .ct-side > .ct-card--direzione { grid-column: 1 / -1; }
  .ct-card--direzione .ct-card__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; }
  .ct-card--recapiti .ct-card__list, .ct-card--direzione .ct-card__list { margin-top: 19px; }
  .ct-card { --ct-pad: 36px; padding-bottom: 32px; }
  .ct-card--mail { --ct-pad: 56px; margin-top: 24px; padding-top: 40px; padding-bottom: 48px; }
  .ct-mail { margin-top: 28px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--ct-rows-2, 8), auto); }
}

/* ≤1023 — tablet */
@media (max-width: 1023.98px) {
  :root { --ct-rise: 80px; --ct-overlap: 60px; }
  .ct-top, .ct-side { gap: 20px; }
  .ct-form-card { padding: 44px 40px 40px; }
  .ct-form__grid { row-gap: 40px; }
  .ct-card { --ct-pad: 28px; padding-top: 24px; padding-bottom: 28px; }
  .ct-card--mail { --ct-pad: 40px; margin-top: 20px; padding-top: 32px; padding-bottom: 40px; }
  .ct-booking { padding-top: calc(120px + var(--ct-overlap)); padding-bottom: 120px; }
}

/* ≤767 — mobile: una colonna */
@media (max-width: 767.98px) {
  :root { --ct-rise: 40px; --ct-overlap: 44px; }
  .ct-contacts > .cs-container { max-width: 560px; }
  .ct-top, .ct-side { gap: 16px; }
  .ct-form-card { padding: 28px 22px 26px; }
  .ct-form__grid { grid-template-columns: minmax(0, 1fr); row-gap: 30px; }
  .ct-field--full { margin-top: 0; }
  .ct-form__grid .ct-field__error { position: static; }   /* una colonna: l'errore sta nel flusso, sotto il campo */
  .ct-check { margin-top: 26px; font-size: 15px; line-height: 21px; column-gap: 12px; }
  .ct-check input { width: 18px; height: 18px; background-size: 12px 12px; }
  .ct-check { grid-template-columns: 18px minmax(0, 1fr); }
  .ct-form__submit { margin-top: 26px; }
  .ct-side { grid-template-columns: minmax(0, 1fr); }
  .ct-side > .ct-card--direzione { grid-column: auto; }
  .ct-card, .ct-card--mail { --ct-pad: 22px; padding-top: 22px; padding-bottom: 24px; }
  .ct-card--mail { margin-top: 16px; }
  .ct-side > .ct-card:hover, .ct-side > .ct-card:focus-within { translate: none; }
  .ct-card { font-size: 15px; line-height: 22px; }
  .ct-card--direzione .ct-card__list { display: flex; }
  .ct-card__list, .ct-card--recapiti .ct-card__list, .ct-card--direzione .ct-card__list { margin-top: 16px; }
  .ct-card--sedi .ct-card__list { gap: 16px; }
  .ct-mail { display: block; margin-top: 20px; }
  .ct-mail__item + .ct-mail__item { margin-top: 18px; }
  .ct-mail dd { margin-top: 4px; font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }
  .ct-booking { padding-top: calc(88px + var(--ct-overlap)); padding-bottom: 88px; }
}

/* Stato pre-animazione: modulo e card sono nel primo schermo, partono nascosti come
   il contenuto dell'Hero (rivelati da GSAP, js/home.js modulo 5) */
.js-anim .ct-top > * { opacity: 0; }
