/* ==========================================================================
   MonteSoprano — sistema form lead (ms-forms)
   Caricato in wp_head DOPO gli <style> inline dei page-template, quindi qui
   basta la stessa specificita' per vincere. Le variabili --red/--ink/... sono
   dichiarate dai template e da ms-tokens.css: ogni uso ha il fallback.
   ⚠️ Un solo rosso: #D41119.
   ========================================================================== */

/* --- Honeypot: invisibile per l'utente, presente per il bot ------------- */
.ms-hp{position:absolute!important; left:-9999px!important; top:auto!important;
  width:1px!important; height:1px!important; overflow:hidden!important;}

/* --- Consenso privacy --------------------------------------------------- */
.ms-consent{display:flex; align-items:flex-start; gap:.7em; font-size:.86rem;
  line-height:1.5; color:var(--muted,#6B6459); cursor:pointer; text-align:left;}
.ms-consent input[type=checkbox]{flex:none; width:18px; height:18px; margin-top:2px;
  accent-color:var(--red,#D41119);}
.ms-consent a{color:var(--red,#D41119); text-decoration:underline; text-underline-offset:2px;}
/* Sui fondi scuri (newsletter) il testo deve restare leggibile. */
.news .ms-consent{color:rgba(255,255,255,.85);}
.news .ms-consent a{color:#fff;}

/* --- Messaggio di esito iniettato dentro il form ------------------------ */
.ms-form-msg{display:none; margin-top:14px; padding:.9em 1.1em; border-radius:2px;
  font-size:.9rem; line-height:1.5; border:1px solid transparent; text-align:left;
  opacity:1!important; transform:none!important;}
.ms-form-msg.is-wait,.ms-form-msg.is-ok,.ms-form-msg.is-err{display:block;}
.ms-form-msg.is-wait{background:rgba(35,33,29,.06); border-color:rgba(35,33,29,.14); color:var(--muted,#6B6459);}
.ms-form-msg.is-ok{background:rgba(110,114,80,.12); border-color:rgba(110,114,80,.45); color:#3F4430;}
.ms-form-msg.is-err{background:rgba(212,17,25,.08); border-color:rgba(212,17,25,.4); color:var(--red-ink,#9A0B10);}
.ms-form-msg__wa{display:inline-block; margin-top:.5em; font-weight:600;
  color:var(--red,#D41119); text-decoration:underline; text-underline-offset:2px;}
/* I form a griglia/flex: il messaggio prende tutta la riga. */
.cform .ms-form-msg,.ms-booking-widget .ms-form-msg{grid-column:1 / -1;}
.news__form .ms-form-msg{flex:1 0 100%;}
.news .ms-form-msg.is-ok{background:rgba(255,255,255,.14); border-color:rgba(255,255,255,.5); color:#fff;}
.news .ms-form-msg.is-err{background:rgba(0,0,0,.2); border-color:rgba(255,255,255,.5); color:#fff;}
.news .ms-form-msg.is-wait{background:rgba(255,255,255,.1); border-color:rgba(255,255,255,.3); color:#fff;}
.news .ms-form-msg__wa{color:#fff;}

form[data-ms-busy="1"] button[type=submit]{opacity:.6; cursor:progress;}

/* --- Banner di esito senza JavaScript (stampato in wp_footer) ----------- */
.ms-lead-flash{position:fixed; z-index:200; left:50%; transform:translateX(-50%);
  top:16px; width:min(560px,calc(100vw - 32px)); padding:1.1em 3em 1.1em 1.3em;
  border-radius:3px; font-family:'Inter',system-ui,sans-serif; font-size:.92rem;
  line-height:1.5; box-shadow:0 14px 40px rgba(35,33,29,.24); background:#fff;
  border-left:4px solid var(--red,#D41119); color:var(--ink,#23211D);}
.ms-lead-flash.is-ok{border-left-color:#6E7250;}
.ms-lead-flash p{margin:0 0 .3em;}
.ms-lead-flash p:last-of-type{margin-bottom:0;}
.ms-lead-flash__wa{color:var(--red,#D41119); font-weight:600; text-decoration:underline;}
.ms-lead-flash__x{position:absolute; top:.5em; right:.7em; font-size:1.4rem; line-height:1;
  color:var(--muted,#6B6459); text-decoration:none;}
.ms-lead-flash__x:hover{color:var(--ink,#23211D);}

/* --- Adattamenti ai form esistenti -------------------------------------- */

/* Prenotazione camere: da 4 colonne (date+ospiti+invio) a 3, perche' ora il
   widget raccoglie anche nome, telefono ed email — senza un recapito una
   richiesta e' inservibile. Le media query rispecchiano quelle inline di
   camere.php, che questo foglio sovrascrive. */
.ms-booking-widget{grid-template-columns:repeat(3,1fr);}
.ms-booking-widget .bk-submit,
.ms-booking-widget .ms-consent{grid-column:1 / -1;}
.ms-booking-widget .bk-field input[type=text],
.ms-booking-widget .bk-field input[type=tel],
.ms-booking-widget .bk-field input[type=email]{
  font:inherit; font-size:.95rem; color:var(--ink,#23211D); background:var(--cream,#F5F0E8);
  border:1px solid var(--border,#E5DFD4); border-radius:2px; padding:.72em .9em; width:100%;}
.ms-booking-widget .bk-field input:focus{outline:none; border-color:var(--olive,#6E7250); background:#fff;}
@media(max-width:900px){ .ms-booking-widget{grid-template-columns:1fr 1fr;} }
@media(max-width:560px){ .ms-booking-widget{grid-template-columns:1fr;} }

/* Newsletter: la riga email+bottone resta com'era, il consenso va sotto. */
.news__form .ms-consent{flex:1 0 100%; justify-content:center; max-width:460px; margin:.2em auto 0;}

/* Prenotazione tavolo: il consenso occupa la riga intera della griglia. */
.book__fields .ms-consent{grid-column:1 / -1;}

@media(prefers-reduced-motion:reduce){
  .ms-lead-flash{transition:none;}
}
