/* ===========================================================
   CERT.O — Webinar Sicurezza Ottici 3 Agosto 2026
   stylesheet principale

   Struttura:
   1. Reset + variabili brand
   2. Tipografia + utility
   3. Header sticky
   4. Hero gradient
   5. Sezione Intro
   6. Sezione Programma (grid 4 card)
   7. Sezione Relatore (foto + bio)
   8. Sezione Form di iscrizione
   9. Footer bicolonna
   10. Stato success post-submit
   11. Media query responsive
   =========================================================== */

/* 1. RESET + VARIABILI */
:root {
  /* Brand */
  --teal: #0196ad;
  --teal-dark: #0e6b78;
  --teal-soft: #e9f4f6;
  --teal-mid: #5abacb;
  --magenta: #ec0a7e;
  --magenta-dark: #c80668;
  --navy: #0e2e4f;
  --navy-2: #13314f;
  --slate: #5b6b7a;
  --line: #e2eaec;
  --bg-soft: #f4f7f8;

  /* Spacing scale (4px base) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;
  --s-10: 72px;

  /* Layout */
  --max-w: 1180px;
  --gutter: 28px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 26px 50px -28px rgba(14, 46, 79, 0.32);
  --shadow-cta: 0 10px 24px -10px rgba(236, 10, 126, 0.6);
  --shadow-cta-hover: 0 16px 30px -12px rgba(236, 10, 126, 0.7);

  /* Type */
  --font-display: 'Montserrat', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-body: 'Open Sans', system-ui, -apple-system, Segoe UI, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;                       /* FIX: anti-overflow orizzontale (più forte di hidden, niente scroll) */
}
body { overflow-x: clip; }                /* FIX: rinforzo su body */

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--navy-2);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

img,
svg,
picture { max-width: 100%; display: block; }

a { color: var(--teal); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--teal-dark); }

button,
input,
select,
textarea { font-family: inherit; font-size: inherit; color: inherit; }

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal) !important;
  box-shadow: 0 0 0 3px rgba(1, 150, 173, 0.12);
  background: #fff !important;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.18; letter-spacing: -0.01em; }
p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* 2. UTILITY */
.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  color: var(--teal);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12.5px;
  font-family: var(--font-display);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--teal);
  display: inline-block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 0;
  border-radius: 6px;
  padding: 15px 28px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .25s ease, box-shadow .25s ease, background .2s ease, color .2s ease;
  font-family: var(--font-display);
}
.btn-primary {
  background: var(--magenta);
  color: #fff;
  box-shadow: var(--shadow-cta);
}
.btn-primary:hover {
  background: var(--magenta-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta-hover);
}
.btn-primary:disabled {
  background: #c98aa5;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.btn-ghost {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
}
.btn-ghost:hover { background: var(--teal); color: #fff; }

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* 3. HEADER */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  gap: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--navy);
}
.brand .logo {
  height: 54px;
  width: auto;
}
.brand .name {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  font-size: 18px;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand .name small {
  display: block;
  font-weight: 400;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--teal);
  text-transform: lowercase;
  margin-top: 2px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a {
  font-size: 14.5px;
  color: var(--navy-2);
  font-weight: 400;
  padding: 6px 0;
  position: relative;
}
.nav-links a:hover { color: var(--teal); }
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
  color: var(--navy);
}
.nav-toggle svg { display: block; }

@media (max-width: 920px) {
  .nav-inner { height: 68px; }
  .brand .logo { height: 44px; }
  .brand .name { font-size: 16px; }
  .nav-links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 12px 0;
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
    box-shadow: 0 16px 30px -22px rgba(14, 46, 79, 0.32);
  }
  .nav-links.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 14px var(--gutter);
    border-bottom: 1px solid var(--line);
  }
  .nav-cta .btn { display: none; }
  .nav-toggle { display: inline-flex; }
}

/* 4. HERO (2 colonne: copy + form, + barra brand sotto) */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(115deg, #47a8b9 0%, #14798f 43%, #0e2e4f 100%);
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero::before {
  width: 620px;
  height: 620px;
  right: -210px;
  top: -240px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 100px rgba(255, 255, 255, 0.035), 0 0 0 200px rgba(255, 255, 255, 0.025);
}
.hero::after {
  width: 280px;
  height: 280px;
  right: 12%;
  bottom: 90px;
  background: var(--magenta);
  opacity: 0.82;
  filter: blur(1px);
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
  padding: 72px 0 64px;
}

.hero-copy { display: grid; gap: 24px; align-content: start; }
.hero-eyebrow {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: none;
  border: 0;
  padding: 0;
  box-shadow: none;
  align-self: flex-start;
  max-width: 620px;
}
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(36px, 4.4vw, 60px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.035em;
  max-width: 620px;
}
.hero .lead {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
}
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
  margin-top: 6px;
}
.hero-cta .badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 30px;
  padding: 9px 16px;
}
.hero-cta .badge svg { color: var(--teal-mid); flex: none; }

/* Colonna form nell'hero: la card bianca è "isolata" e ben visibile */
.hero-form {
  position: relative;
  z-index: 3;
  min-width: 0;            /* FIX: previene overflow da min-content form */
}
.hero-form .form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: 0 36px 72px -28px rgba(8, 30, 52, 0.55);
  color: var(--navy-2);
}
.hero-form .form-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  font-size: 20px;
  margin: 0 0 4px;
}
.hero-form .form-card .form-sub {
  color: var(--slate);
  font-size: 13.5px;
  margin: 0 0 18px;
}
.hero-form .form-row { gap: 12px; margin-bottom: 12px; }
.hero-form .field label { font-size: 12.5px; margin-bottom: 4px; }
.hero-form .field input,
.hero-form .field select { padding: 10px 12px; font-size: 14px; }
.hero-form .consent { font-size: 12.5px; margin-top: 10px; padding: 10px 0; gap: 9px; }
.hero-form .consent input[type="checkbox"] { width: 16px; height: 16px; }
.hero-form .submit-row { margin-top: 18px; }
.hero-form .submit-row .btn { width: 100%; padding: 15px 22px; font-size: 13px; }

/* --- Barra brand sotto l'hero --- */
.hero-bar {
  position: relative;
  z-index: 2;
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.hero-bar-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.hb-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px var(--gutter);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  position: relative;
  transition: background .2s ease;
}
.hb-item:last-child { border-right: 0; }
.hb-item::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--teal-mid);
  opacity: 0;
  transition: opacity .2s ease;
}
.hb-item:hover { background: rgba(255, 255, 255, 0.04); }
.hb-item:hover::before { opacity: 1; }
.hb-item--date::before    { background: var(--teal); }
.hb-item--time::before    { background: var(--teal-mid); }
.hb-item--online::before  { background: var(--teal); }
.hb-item--free::before    { background: var(--teal); }
.hb-ico {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
}
.hb-item--date   .hb-ico { background: rgba(1, 150, 173, 0.18); color: var(--teal-mid); }
.hb-item--time   .hb-ico { background: rgba(1, 150, 173, 0.18); color: var(--teal-mid); }
.hb-item--online .hb-ico { background: rgba(1, 150, 173, 0.18); color: var(--teal-mid); }
.hb-item--free   .hb-ico { background: rgba(1, 150, 173, 0.18); color: var(--teal-mid); }
.hb-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.hb-text small {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 600;
  margin-bottom: 4px;
}
.hb-text strong {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   RESPONSIVE HERO — 4 breakpoint progressivi
   980px: tablet portrait grande (iPad portrait)
   760px: tablet portrait piccolo / phablet
   480px: mobile grande
   380px: mobile piccolo (iPhone SE, Android 320-360)
   Strategia: padding laterali generosi, font-size scalato con
   clamp(), CTA touch-friendly (min 44px altezza).
   ============================================================ */

/* TABLET PORTRAIT GRANDE — 980px */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 56px 0 48px;
  }
  .hero-copy {
    gap: 20px;
    max-width: 640px;       /* contenere la copy */
    margin: 0 auto;
    text-align: left;
  }
  .hero h1 { font-size: clamp(34px, 4.2vw, 50px); }
  .hero .lead { font-size: 16.5px; line-height: 1.65; }
  .hero-form { max-width: 540px; width: 100%; margin: 0 auto; }
  .hero-bar-inner { grid-template-columns: repeat(2, 1fr); }
  .hb-item { border-right: 0; }
  .hb-item:nth-child(odd) { border-right: 1px solid rgba(255, 255, 255, 0.1); }
  .hb-item:nth-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
}

/* PHABLET / TABLET PICCOLO — 760px */
@media (max-width: 760px) {
  :root { --gutter: 24px; }                /* padding laterale più generoso */
  .hero-grid { padding: 48px 0 40px; gap: 32px; }
  .hero-eyebrow { font-size: 11.5px; letter-spacing: 0.16em; }
  .hero h1 { font-size: clamp(30px, 6vw, 40px); line-height: 1.1; }
  .hero .lead { font-size: 16px; line-height: 1.65; }
  .hero-cta { gap: 14px; }
  .hero-cta .btn { padding: 14px 22px; font-size: 12.5px; }
  .hero-form .form-card { padding: 26px 22px; }
  .hero-form .form-card h3 { font-size: 19px; }
  .hero-bar-inner { grid-template-columns: 1fr; }
  .hb-item {
    border-right: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 18px var(--gutter);
  }
  .hb-item:last-child { border-bottom: 0; }
}

/* MOBILE GRANDE — 480px */
@media (max-width: 480px) {
  :root { --gutter: 20px; }                /* padding laterale ancora più stretto ma sicuro */
  .hero-grid {
    padding: 40px 10px 32px;
    gap: 28px;
  }
  .hero-eyebrow { font-size: 11px; letter-spacing: 0.14em; line-height: 1.4; }
  .hero h1 { font-size: clamp(28px, 8.5vw, 36px); }
  .hero .lead { font-size: 15.5px; }
  .hero-cta { flex-direction: column; align-items: stretch; gap: 12px; }
  .hero-cta .btn { width: 100%; padding: 14px 18px; font-size: 12.5px; }
  .hero-cta .badge { justify-content: center; font-size: 12.5px; padding: 8px 14px; }
  .hero-form .form-card { padding: 22px 18px; border-radius: 12px; }
  .hero-form .form-card h3 { font-size: 18px; }
  .hero-form .form-card .form-sub { font-size: 13px; }
  .hero-form .field input,
  .hero-form .field select { padding: 11px 12px; font-size: 14px; }
  .hero-form .consent { font-size: 12px; padding: 8px 0; }
  .hero-form .submit-row .btn {
    padding: 14px 14px;
    font-size: 12px;
    letter-spacing: 0.02em;   /* FIX: 0.06em + nowrap faceva uscire il testo dal form */
    white-space: normal;      /* FIX: lascia andare a capo se serve */
    line-height: 1.25;
  }
  .hb-item { padding: 16px var(--gutter); gap: 12px; }
  .hb-ico { width: 40px; height: 40px; }
  .hb-ico svg { width: 18px; height: 18px; }
  .hb-text strong { font-size: 14px; }
  .hb-text small { font-size: 10.5px; }
}

/* MOBILE PICCOLO — 380px (iPhone SE, 320-360) */
@media (max-width: 380px) {
  :root { --gutter: 10px; }              /* padding laterale hero = 10px */
  .hero-grid {
    padding: 40px 10px 32px;
    gap: 28px;
  }
  .hero-eyebrow { font-size: 10.5px; letter-spacing: 0.12em; }
  .hero h1 { font-size: clamp(24px, 7vw, 28px); line-height: 1.12; }
  .hero .lead { font-size: 14px; line-height: 1.55; }
  .hero-cta .btn { padding: 12px 12px; font-size: 11.5px; letter-spacing: 0.04em; }
  .hero-cta .badge { font-size: 12px; padding: 7px 12px; }
  .hero-form .form-card { padding: 18px 12px; border-radius: 10px; }
  .hero-form .form-card h3 { font-size: 17px; }
  .hero-form .form-card .form-sub { font-size: 12.5px; }
  .hero-form .field label { font-size: 12px; }
  .hero-form .field input,
  .hero-form .field select { padding: 10px 11px; font-size: 13.5px; }
  .hero-form .consent { font-size: 11.5px; padding: 8px 0; gap: 8px; }
  .hero-form .consent input[type="checkbox"] { width: 16px; height: 16px; }
  .hero-form .submit-row .btn {
    padding: 13px 12px;
    font-size: 11.5px;
    letter-spacing: 0.01em;
    white-space: normal;
    line-height: 1.25;
  }
  .hb-item { padding: 12px var(--gutter); gap: 9px; }
  .hb-ico { width: 34px; height: 34px; border-radius: 8px; }
  .hb-ico svg { width: 16px; height: 16px; }
  .hb-text strong { font-size: 12.5px; }
  .hb-text small { font-size: 9.5px; letter-spacing: 0.1em; }
}

/* 5. INTRO */
.intro { padding: 110px 0; }
.intro-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 80px;
  align-items: start;
}
.intro h2 {
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 400;
  line-height: 1.13;
  letter-spacing: -0.01em;
  color: var(--slate);
  margin: 0;
}
.intro-body { padding-top: 34px; }
.intro-body p {
  color: var(--slate);
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 20px;
}
.intro-body p:last-child { margin-bottom: 0; }

@media (max-width: 900px) {
  .intro { padding: 64px 0; }
  .intro-grid { grid-template-columns: 1fr; gap: 28px; }
  .intro-body { padding-top: 0; }
}

/* 6. PROGRAMMA */
.programma {
  padding: 100px 0;
  background: var(--bg-soft);
}
.section-head { max-width: 770px; margin-bottom: 54px; }
.section-head h2 {
  font-size: clamp(30px, 3vw, 46px);
  font-weight: 700;
  line-height: 1.13;
  letter-spacing: -0.01em;
  color: var(--navy);
  margin: 0;
}
.programma-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.prog-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 32px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.prog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
  border-color: #cfe4e8;
}
.prog-card .pc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.prog-card .pc-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 40px;
  color: var(--teal-mid);
  line-height: 1;
}
.prog-card .pc-ico {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
}
.prog-card h3 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  color: var(--navy);
  font-size: 21px;
  font-weight: 500;
  line-height: 1.25;
}
.prog-card p {
  margin: 0;
  font-size: 15px;
  color: var(--slate);
  line-height: 1.7;
}

@media (max-width: 760px) {
  .programma { padding: 64px 0; }
  .section-head { margin-bottom: 32px; }
  .programma-grid { grid-template-columns: 1fr; }
  .prog-card { padding: 26px 24px; }
  .form-card { padding: 28px 22px; }       /* FIX 4: form card padding su tablet */
  .iscrizione-grid { gap: 36px; }
}

/* 7. RELATORE */
.relatore { padding: 110px 0; }
.relatore-grid {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: 70px;
  align-items: center;
}
.relatore-grid > * { min-width: 0; }    /* FIX: coerenza anti-overflow */
.relatore-foto {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: var(--navy);
}
.relatore-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.relatore h2 {
  font-size: clamp(30px, 3.5vw, 42px);
  font-weight: 600;
  line-height: 1.18;
  color: var(--navy);
  margin: 0 0 12px;
}
.relatore .nome {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin: 4px 0 6px;
}
.relatore .qualifica {
  font-style: italic;
  color: var(--teal);
  font-weight: 600;
  font-size: 16px;
  margin: 0 0 24px;
}
.relatore p {
  color: var(--slate);
  font-size: 17px;
  line-height: 1.75;
  margin: 0 0 20px;
}
.relatore p:last-of-type { margin-bottom: 0; }

@media (max-width: 900px) {
  .relatore { padding: 64px 0; }
  .relatore-grid { grid-template-columns: 1fr; gap: 32px; }
  .relatore-foto { max-width: 480px; margin: 0 auto; }
}

/* 8. FORM */
.iscrizione {
  padding: 100px 0;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
}
.iscrizione-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 64px;
  align-items: start;
}
.iscrizione-grid > * { min-width: 0; }     /* FIX CRITICO: evita overflow orizzontale da min-content dei form */
.iscrizione h2 {
  font-size: clamp(30px, 3.5vw, 42px);
  font-weight: 600;
  line-height: 1.13;
  color: var(--navy);
  margin: 0 0 12px;
}
.iscrizione .sub {
  color: var(--slate);
  font-size: 16px;
  line-height: 1.7;
  margin: 0 0 26px;
}
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: #fff8e6;
  border: 1px solid #f0d68a;
  color: #7a5a00;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 28px;
}
.alert svg { flex: none; margin-top: 2px; color: #c99500; }

.form-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 38px 36px;
  box-shadow: 0 30px 60px -32px rgba(14, 46, 79, 0.18);
}
.form-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  font-size: 22px;
  margin: 0 0 6px;
}
.form-card .form-sub {
  color: var(--slate);
  font-size: 14px;
  margin: 0 0 24px;
}
.form-row {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row.row-2 { grid-template-columns: 1fr 1fr; }
.form-row.row-3 { grid-template-columns: 1.5fr 0.7fr 0.9fr; }
@media (max-width: 600px) {
  .form-row.row-2,
  .form-row.row-3 { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.field label .req { color: var(--magenta); }
.field label .opt { color: var(--slate); font-weight: 400; font-style: italic; font-size: 12px; }
.field input,
.field select {
  width: 100%;
  border: 1px solid #d3dde0;
  border-radius: 8px;
  padding: 12px 14px;
  background: #f9fbfc;
  color: var(--navy-2);
  font-size: 15px;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6b7a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
}
.field input.err,
.field select.err { border-color: var(--magenta); background: #fff5fa; }
.field .msg {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--magenta);
  font-weight: 600;
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--slate);
  margin: 14px 0 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.consent input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--teal);
  flex: none;
  cursor: pointer;
}
.consent .msg {
  display: inline;
  font-size: 12.5px;
  color: var(--magenta);
  font-weight: 600;
}
.consent a { font-weight: 600; }

.form-status {
  display: none;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.form-status.show { display: block; }
.form-status.error { background: #fde7ee; color: var(--magenta-dark); border-color: #f5b8cf; }
.form-status.loading { background: var(--teal-soft); color: var(--teal-dark); border-color: #cfe4e8; }

.form-card .submit-row { margin-top: 22px; }
.form-card .submit-row .btn { width: 100%; padding: 17px 24px; font-size: 13.5px; }
@media (max-width: 760px) {
  /* FIX: bottone submit nella form-card (sezione iscrizione).
     Il testo uppercase + 0.06em + nowrap usciva dal form su mobile.
     Riduciamo font, padding orizzontale e letter-spacing. */
  .form-card .submit-row .btn {
    padding: 14px 14px;
    font-size: 12px;
    letter-spacing: 0.02em;
    white-space: normal;
    line-height: 1.25;
  }
}
@media (max-width: 380px) {
  .form-card .submit-row .btn {
    padding: 13px 10px;
    font-size: 11.5px;
    letter-spacing: 0.01em;
  }
}

.privacy-note {
  font-size: 12px;
  color: var(--slate);
  margin: 16px 0 0;
  line-height: 1.6;
}

/* ====================== SOLD OUT ======================
   Quando la sorgente raggiunge le 100 iscrizioni, il form viene
   bloccato con classe .form-card--locked e mostra il banner
   .form-soldout-banner con la scritta SOLD OUT.
   Niente counter visibile dentro al form: il numero di prenotazione
   compare solo nella pagina "grazie.html" (vedi .ty-counter). */
.form-card--locked {
  position: relative;
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
  filter: saturate(0.6);
}
.form-card--locked::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: transparent;
  pointer-events: auto; /* cattura i click per evitare focus strani */
}
.form-card--locked input,
.form-card--locked select,
.form-card--locked textarea,
.form-card--locked button[type="submit"] {
  pointer-events: none !important;
  cursor: not-allowed !important;
}

/* Banner mostrato dentro al form quando si raggiunge il cap.
   Due varianti:
   - .form-soldout-banner--hard    → SOLD OUT definitivo, form bloccato
   - .form-soldout-banner--waitlist→ posti esauriti MA accettiamo lista d'attesa */
.form-soldout-banner {
  margin: 0 0 18px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  text-align: left;
  border: 1px solid;
}
.form-soldout-banner--hard {
  background: #fdecef;
  border-color: #f4b5c6;
  color: #6b1130;
}
.form-soldout-banner--hard h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: #6b1130;
  font-size: 22px;
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  text-transform: uppercase;
}
.form-soldout-banner--hard p { color: #6b1130; }
.form-soldout-banner--hard a { color: #c80668; }

.form-soldout-banner--waitlist {
  background: #fff5e0;
  border-color: #f0d68a;
  color: #6a4a00;
}
.form-soldout-banner--waitlist h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: #6a4a00;
  font-size: 18px;
  margin: 0 0 8px;
}
.form-soldout-banner--waitlist p { color: #6a4a00; }
.form-soldout-banner--waitlist a { color: #d68b00; }

.form-soldout-banner .soldout-eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 6px;
  opacity: 0.85;
}
.form-soldout-banner p {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.55;
}
.form-soldout-banner p:last-child { margin-bottom: 0; }
.form-soldout-banner p.small { font-size: 12.5px; opacity: 0.9; }
.form-soldout-banner a { text-decoration: underline; }

/* HARD SOLD OUT: form interamente nascosto, solo banner visibile */
.form-card--soldout .form-row,
.form-card--soldout .consent,
.form-card--soldout .submit-row,
.form-card--soldout .privacy-note { display: none; }

/* WAITLIST: form resta visibile, ma evidenziamo lo stato */
.form-card--waitlist {
  border-color: #f0d68a;
  box-shadow: 0 26px 50px -28px rgba(214, 139, 0, 0.32);
}
.form-card--waitlist .form-sub::after {
  content: ' \2022 Lista d\u2019attesa attiva';
  color: #d68b00;
  font-weight: 600;
}

/* Bottone in modalità waitlist (cambia solo il colore) */
.btn--waitlist {
  background: #d68b00 !important;
  box-shadow: 0 10px 24px -10px rgba(214, 139, 0, 0.6) !important;
}
.btn--waitlist:hover {
  background: #b57300 !important;
  box-shadow: 0 16px 30px -12px rgba(214, 139, 0, 0.7) !important;
}

/* Stato success post-submit per waitlist */
.form-success--waitlist { color: var(--navy-2); }
.form-success--waitlist .check {
  background: #fff5e0;
  color: #d68b00;
}
.form-success--waitlist .eyebrow { color: #d68b00; }
.form-success--waitlist .eyebrow::before { background: #d68b00; }

/* ====================== THANK-YOU COUNTER ======================
   Numero di prenotazione mostrato in grazie.html ("Sei il partecipante
   #N di 100 · restano M posti"). Non è visibile nel form. */
.ty-counter {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 22px auto 8px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
}
.ty-counter strong {
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  font-size: 22px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.ty-counter small {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
  font-family: var(--font-display);
}
.ty-counter .ty-counter-text { display: flex; flex-direction: column; line-height: 1.15; }
.ty-counter .ty-counter-num { font-size: 13.5px; color: rgba(255, 255, 255, 0.88); }
.ty-counter .ty-counter-num b { color: #fff; font-weight: 700; }
.ty-counter--soldout {
  background: rgba(255, 85, 119, 0.15);
  border-color: rgba(255, 85, 119, 0.45);
}
.ty-counter--soldout small { color: #ff9bbb; }
.ty-counter--waitlist {
  background: rgba(214, 139, 0, 0.15);
  border-color: rgba(214, 139, 0, 0.5);
}
.ty-counter--waitlist small { color: #f0d68a; }
.ty-counter--waitlist strong { color: #d68b00; }
.ty-counter--loading { opacity: 0.7; }

@media (max-width: 900px) {
  .iscrizione { padding: 64px 0; }
  .iscrizione-grid { grid-template-columns: 1fr; gap: 36px; }
  .form-card { padding: 28px 22px; }
}

/* Stato success post-submit */
.form-success {
  text-align: center;
  padding: 20px 4px;
}
.form-success .check {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
}
.form-success h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--navy);
  font-size: 24px;
  margin: 0 0 12px;
}
.form-success p {
  color: var(--slate);
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 18px;
}
.form-success .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}

/* 9. FOOTER */
.foot {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  color: #fff;
  align-items: stretch;
}
.foot-contact {
  background: #2f415c;
  padding: 72px 0 72px var(--gutter);
  display: flex;
  justify-content: flex-end;
}
.foot-contact-inner {
  max-width: 480px;
  width: 100%;
}
.foot h2 {
  margin: 0 0 34px;
  font-family: var(--font-display);
  color: rgba(255, 255, 255, 0.5);
  font-weight: 300;
  font-size: 46px;
  line-height: 1.12;
}
.foot-line {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  padding: 14px 0;
}
.foot-line .fi {
  width: 34px;
  height: 34px;
  flex: none;
  color: var(--teal-mid);
  display: grid;
  place-items: center;
}
.foot-nav {
  background: var(--navy);
  color: #fff;
  padding: 72px 0 0 64px;
  display: flex;
  align-items: flex-start;
}
.foot-nav ul {
  max-width: 420px;
  width: 100%;
}
.foot-nav li a {
  display: block;
  padding: 16px 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: color .2s ease, padding-left .2s ease;
}
.foot-nav li:first-child a { color: rgba(255, 255, 255, 0.5); }
.foot-nav li a:hover { color: #fff; padding-left: 8px; }
.foot .socials {
  display: flex;
  gap: 12px;
  margin: 26px 0 0;
}
.foot .socials a {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #fff;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.foot .socials a:hover {
  background: var(--teal);
  border-color: var(--teal);
  transform: translateY(-2px);
}
.foot .copyright {
  grid-column: 1 / -1;
  background: var(--navy);
  color: rgba(255, 255, 255, 0.5);
  font-size: 11.5px;
  text-align: center;
  padding: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.foot .copyright a { color: rgba(255, 255, 255, 0.7); }
.foot .copyright a:hover { color: #fff; }

@media (max-width: 760px) {
  .foot { grid-template-columns: 1fr; }
  .foot-contact { padding: 48px var(--gutter); justify-content: flex-start; }
  .foot-contact-inner { max-width: none; }
  .foot-nav { padding: 0 var(--gutter) 24px; }
  .foot h2 { font-size: 34px; margin-bottom: 22px; }
}

/* 10. STATO SUCCESS POST-SUBMIT (anche per grazie.html) */
.success-shell {
  position: relative;
  overflow: hidden;
  background: linear-gradient(115deg, #47a8b9 0%, #14798f 43%, #0e2e4f 100%);
  min-height: calc(100vh - 78px - 62px);
  display: grid;
  place-items: center;
  padding: 80px var(--gutter);
}
.success-shell::before,
.success-shell::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.success-shell::before {
  width: 620px;
  height: 620px;
  right: -210px;
  top: -240px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 0 100px rgba(255, 255, 255, 0.035), 0 0 0 200px rgba(255, 255, 255, 0.025);
}
.success-shell::after {
  width: 280px;
  height: 280px;
  left: 6%;
  bottom: -190px;
  background: var(--magenta);
  opacity: 0.82;
  filter: blur(1px);
}
.success-card {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: var(--radius);
  padding: 64px 54px;
  max-width: 620px;
  width: 100%;
  box-shadow: 0 44px 90px -34px rgba(8, 30, 52, 0.62);
  text-align: center;
  animation: pop 0.5s cubic-bezier(.22,.61,.36,1);
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.success-card .check {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  margin: 0 auto 26px;
}
.success-card .check svg path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
  animation: draw 0.7s 0.15s cubic-bezier(.22,.61,.36,1) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.success-card .eyebrow { color: var(--teal); }
.success-card h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 300;
  line-height: 1.13;
  letter-spacing: -0.01em;
  color: var(--navy);
}
.success-card p {
  margin: 0 0 10px;
  color: var(--slate);
  font-size: 16px;
  line-height: 1.75;
}
.success-card p b { color: var(--navy); }
.success-card .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 20px 0 28px;
}
.success-card .meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy);
  background: var(--teal-soft);
  border-radius: 30px;
  padding: 9px 16px;
}
.success-card .meta-pill svg { color: var(--teal); }
.success-card .actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.success-card .actions .btn { padding: 14px 26px; }

@media (prefers-reduced-motion: reduce) {
  .success-card, .success-card .check svg path { animation: none; }
  .success-card .check svg path { stroke-dashoffset: 0; }
}

@media (max-width: 600px) {
  .success-card { padding: 44px 24px; }
  .success-shell { padding: 48px var(--gutter); }
}
