/* ============================================================
   VILLA MONASTERO — SURVEY DQuaDLA
   FOGLIO DI STILE
   ------------------------------------------------------------
   Identità: Petrolio #153238 · Beige #B79C72 · Grigio #F0F2F1
   Tipografia: Lexend Deca (self-hosted, conforme GDPR)
   ============================================================ */

/* ---------------- FONT (self-hosted) ---------------- */
@font-face { font-family: "Lexend Deca"; font-style: normal; font-weight: 300; font-display: swap; src: url("../assets/fonts/lexend-deca-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend Deca"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/lexend-deca-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend Deca"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/lexend-deca-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend Deca"; font-style: normal; font-weight: 600; font-display: swap; src: url("../assets/fonts/lexend-deca-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Lexend Deca"; font-style: normal; font-weight: 700; font-display: swap; src: url("../assets/fonts/lexend-deca-latin-700-normal.woff2") format("woff2"); }

/* ---------------- TOKEN ---------------- */
:root {
  --petrolio: #153238;
  --petrolio-2: #1d4651;      /* hover / superfici scure secondarie */
  --petrolio-3: #0d2227;      /* footer / fondo profondo */
  --petrolio-tint: rgba(21, 50, 56, 0.05);
  --beige: #B79C72;
  --beige-soft: rgba(183, 156, 114, 0.16);
  --beige-ink: #7a6540;       /* beige scurito, leggibile su bianco (AA) */
  --grigio: #F0F2F1;
  --bianco: #FFFFFF;
  --ink: #153238;
  --ink-soft: rgba(21, 50, 56, 0.74);
  --line: #dde4e3;
  --error: #B3261E;
  --error-bg: #FBEFEE;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px rgba(13, 34, 39, 0.08);
  --font: "Lexend Deca", "Segoe UI", system-ui, -apple-system, sans-serif;
  --maxw: 760px;
  --maxw-card: 720px;
}

/* ---------------- RESET / BASE ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bianco);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
#progetto, #prima, #privacy, #consent-form { scroll-margin-top: 84px; }
h1, h2, h3 { line-height: 1.16; margin: 0 0 0.6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.1rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.05rem); font-weight: 600; }
h3 { font-size: 1.18rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--petrolio); text-underline-offset: 3px; }
button { font-family: inherit; }
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

/* Solo screen reader */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip link */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--petrolio); color: #fff; padding: 12px 18px;
  border-radius: 0 0 10px 10px; font-weight: 500; text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* Focus visibile (WCAG 2.4.7) */
:focus-visible { outline: 3px solid var(--petrolio); outline-offset: 2px; border-radius: 4px; }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--beige); }

/* ---------------- EYEBROW / DIVIDER ---------------- */
.eyebrow {
  display: block;
  font-size: 0.76rem; font-weight: 500;
  letter-spacing: 0.17em; text-transform: uppercase;
  color: var(--beige-ink); margin-bottom: 14px;
}
.on-dark .eyebrow { color: var(--beige); }

.leaf-divider { display: flex; justify-content: center; padding: 6px 0 0; }
.leaf-divider svg { width: 130px; height: 26px; color: var(--beige); opacity: 0.9; }

/* ---------------- HEADER ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px; max-width: 1080px;
  margin-inline: auto; padding: 8px 22px;
}
.header-logo img { height: 38px; width: auto; }
.header-tools { display: flex; align-items: center; gap: 14px; }

.textsize-group, .lang-group {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--line); border-radius: 999px; padding: 3px;
  background: #fff;
}
.tool-btn {
  border: 0; background: transparent; color: var(--ink);
  min-width: 34px; height: 32px; border-radius: 999px;
  font-size: 0.82rem; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding-inline: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.tool-btn:hover { background: var(--grigio); }
.tool-btn[aria-pressed="true"] { background: var(--petrolio); color: #fff; }
.textsize-group .tool-btn:nth-child(1) { font-size: 0.72rem; }
.textsize-group .tool-btn:nth-child(3) { font-size: 0.95rem; }

/* ---------------- VISTE ---------------- */
.view { display: none; }
.view.is-active { display: block; }
.view-focus:focus { outline: none; }
/* Titoli/regioni che ricevono focus solo via script (tabindex=-1): nessun anello visivo */
h1[tabindex="-1"]:focus, h2[tabindex="-1"]:focus { outline: none; }

/* ---------------- HERO ---------------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1100px 520px at 18% -10%, rgba(183, 156, 114, 0.14), transparent 60%),
    linear-gradient(180deg, #17383f 0%, var(--petrolio) 55%, #112b31 100%);
  color: #fff;
  padding: clamp(72px, 11vw, 130px) 0 clamp(78px, 10vw, 120px);
}
.hero .container { position: relative; z-index: 2; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero-lead { font-size: 1.06rem; color: rgba(255, 255, 255, 0.86); max-width: 58ch; font-weight: 300; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; margin-top: 30px; }
.time-pill {
  display: inline-flex; align-items: center; gap: 9px;
  border: 1px solid rgba(183, 156, 114, 0.55);
  background: rgba(255, 255, 255, 0.05);
  color: var(--beige);
  border-radius: 999px; padding: 9px 17px;
  font-size: 0.88rem; font-weight: 400;
}
.time-pill svg { width: 16px; height: 16px; }

/* Motivo botanico ambientale (firma visiva) */
.hero-botanic {
  position: absolute; z-index: 1; pointer-events: none;
  right: -70px; bottom: -60px;
  width: clamp(340px, 44vw, 620px); height: auto;
  color: var(--beige); opacity: 0.16;
  transform: rotate(-8deg);
}
.hero-botanic--left {
  right: auto; left: -110px; top: -90px; bottom: auto;
  width: clamp(240px, 30vw, 420px);
  opacity: 0.08; transform: rotate(141deg);
}

/* ---------------- SEZIONI LANDING ---------------- */
.band { padding: clamp(56px, 8vw, 92px) 0; }
.band--white { background: var(--bianco); }
.band--grey { background: var(--grigio); }
.band--narrow p { max-width: 64ch; }
.band .lead { font-size: 1.04rem; color: var(--ink-soft); }

/* Card benefici */
.benefits { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.benefit {
  display: flex; gap: 14px; align-items: flex-start;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 18px 18px;
}
.benefit-icon {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 999px;
  background: var(--beige-soft); color: var(--petrolio);
  display: grid; place-items: center;
}
.benefit-icon svg { width: 22px; height: 22px; }
.benefit p { margin: 0; font-size: 0.86rem; line-height: 1.45; align-self: center; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }

/* ---------------- PRIVACY ---------------- */
.privacy-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 40px);
}
.privacy-body { font-size: 0.94rem; color: var(--ink-soft); }
.privacy-body p { margin-bottom: 0.85em; }
.privacy-body ul { margin: 0 0 1em; padding-left: 1.15em; }
.privacy-body li { margin-bottom: 0.25em; }
.privacy-body li::marker { color: var(--beige-ink); }

.privacy-refs {
  margin: 18px 0; padding: 16px 18px;
  background: var(--grigio); border-radius: var(--radius);
  font-size: 0.92rem; display: grid; gap: 6px;
}
.privacy-refs strong { font-weight: 600; }
.privacy-link { display: inline-block; margin: 4px 0 18px; font-weight: 500; }

.consent-box { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 8px; display: grid; gap: 16px; }
.consent {
  display: grid; grid-template-columns: 26px 1fr; gap: 13px;
  align-items: start; cursor: pointer;
  padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.consent:hover { border-color: var(--beige); }
.consent.is-checked { border-color: var(--petrolio); background: var(--petrolio-tint); }
.consent input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--petrolio); cursor: pointer; }
.consent span { font-size: 0.95rem; line-height: 1.55; }
.consent .req-mark { color: var(--beige-ink); font-weight: 500; white-space: nowrap; }
.consent-note { font-size: 0.85rem; color: var(--ink-soft); margin: -6px 2px 0; }
.consent-error {
  display: none; align-items: center; gap: 8px;
  color: var(--error); background: var(--error-bg);
  border-radius: 10px; padding: 11px 14px; font-size: 0.92rem; font-weight: 500;
}
.consent-error.is-visible { display: flex; }
.consent-cta-row { display: flex; justify-content: flex-end; margin-top: 6px; }

/* ---------------- BOTTONI ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 11px; border: 1.5px solid transparent;
  padding: 14px 30px; font-size: 1rem; font-weight: 500;
  cursor: pointer; text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--petrolio); color: #fff; }
.btn-primary:hover { background: var(--petrolio-2); }
.btn-accent { background: var(--beige); color: var(--petrolio); font-weight: 600; }
.btn-accent:hover { background: #c5ab84; }
.btn-ghost { background: transparent; color: var(--petrolio); border-color: var(--petrolio); }
.btn-ghost:hover { background: var(--petrolio-tint); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

/* ---------------- SURVEY ---------------- */
.survey-shell { background: var(--grigio); min-height: 70vh; padding: clamp(26px, 5vw, 56px) 0 clamp(56px, 7vw, 88px); }
.survey-card {
  background: #fff; max-width: var(--maxw-card); margin-inline: auto;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4.5vw, 42px);
}

.progress-head { margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.progress-label { font-size: 0.82rem; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--beige-ink); }
.progress-track { height: 6px; border-radius: 999px; background: #e2e8e7; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--beige), #cdb38a); transition: width 0.35s ease; }

.section-head { margin: 26px 0 6px; }
.section-head h2 { margin-bottom: 0.3em; }
.section-intro { color: var(--ink-soft); margin-bottom: 4px; }
.required-legend { font-size: 0.84rem; color: var(--ink-soft); margin: 0 0 8px; }

/* Domanda */
.q { border: 0; padding: 26px 0 4px; margin: 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q[hidden] { display: none; }
.q-legend { font-size: 1.06rem; font-weight: 600; line-height: 1.42; padding: 0; margin-bottom: 6px; display: block; }
.q-num { color: var(--beige-ink); margin-right: 6px; font-variant-numeric: tabular-nums; }
.q-req { color: var(--beige-ink); margin-left: 3px; }
.q-tag {
  display: inline-block; vertical-align: 2px; margin-left: 10px;
  font-size: 0.7rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--grigio);
  border-radius: 999px; padding: 3px 10px;
}
.q-hint { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 12px; }
.q-hint--auto { display: flex; align-items: center; gap: 7px; color: var(--beige-ink); }
.q-hint--auto svg { width: 15px; height: 15px; flex: 0 0 auto; }

/* Opzioni (radio / checkbox card) */
.opts { list-style: none; margin: 12px 0 6px; padding: 0; display: grid; gap: 10px; }
.opt {
  position: relative; display: grid; grid-template-columns: 24px 1fr; gap: 13px;
  align-items: center; padding: 14px 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: #fff; cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.opt:hover { border-color: var(--beige); }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt-ctrl {
  width: 22px; height: 22px; border-radius: 999px;
  border: 2px solid #b9c3c2; background: #fff;
  display: grid; place-items: center; transition: border-color 0.15s ease, background 0.15s ease;
}
.opt-ctrl--check { border-radius: 7px; }
.opt-ctrl svg { width: 13px; height: 13px; color: #fff; opacity: 0; transition: opacity 0.12s ease; }
.opt-text { font-size: 0.98rem; line-height: 1.45; }
.opt:focus-within { outline: 3px solid var(--petrolio); outline-offset: 2px; }
.opt.is-checked { border-color: var(--petrolio); background: var(--petrolio-tint); }
.opt.is-checked .opt-ctrl { border-color: var(--petrolio); background: var(--petrolio); }
.opt.is-checked .opt-ctrl svg { opacity: 1; }

/* Textarea */
.q-textarea {
  width: 100%; min-height: 112px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; font: inherit; font-size: 0.98rem; color: var(--ink);
  background: #fff; transition: border-color 0.15s ease;
}
.q-textarea:hover { border-color: var(--beige); }
.q-textarea:focus { outline: 3px solid var(--petrolio); outline-offset: 1px; border-color: var(--petrolio); }
.char-count { font-size: 0.8rem; color: var(--ink-soft); text-align: right; margin: 6px 2px 0; }

/* Email */
.q-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  transition: border-color 0.15s ease;
}
.q-input:hover { border-color: var(--beige); }
.q-input:focus { outline: 3px solid var(--petrolio); outline-offset: 1px; border-color: var(--petrolio); }
.email-confirm { margin-top: 14px; }

/* Errori */
.q-error {
  display: flex; align-items: center; gap: 8px;
  color: var(--error); font-size: 0.9rem; font-weight: 500; margin: 10px 2px 0;
}
.q-error svg { width: 15px; height: 15px; flex: 0 0 auto; }
.q.has-error .opt, .q.has-error .q-input, .q.has-error .q-textarea { border-color: rgba(179, 38, 30, 0.5); }

/* Navigazione */
.survey-nav { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 34px; }
.survey-nav .spacer { flex: 1; }
.back-to-intro {
  display: inline-block; margin-top: 22px;
  font-size: 0.88rem; color: var(--ink-soft);
}

/* ---------------- LOADING ---------------- */
.loading-screen {
  min-height: calc(100vh - 64px);
  background: linear-gradient(180deg, #17383f, var(--petrolio));
  color: #fff; display: grid; place-items: center; text-align: center;
  padding: 60px 22px;
}
.loading-inner { max-width: 480px; }
.spinner {
  width: 58px; height: 58px; margin: 0 auto 26px;
  border-radius: 999px;
  border: 4px solid rgba(183, 156, 114, 0.25);
  border-top-color: var(--beige);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-screen h2 { color: #fff; }
.loading-screen p { color: rgba(255, 255, 255, 0.82); font-weight: 300; }
.fail-box { display: none; }
.fail-box.is-visible { display: block; }
.fail-box .btn { margin-top: 10px; }

/* ---------------- RINGRAZIAMENTO ---------------- */
.thanks-hero {
  background:
    radial-gradient(900px 420px at 80% -20%, rgba(183, 156, 114, 0.16), transparent 60%),
    linear-gradient(180deg, #17383f, var(--petrolio));
  color: #fff; text-align: center;
  padding: clamp(64px, 9vw, 104px) 22px clamp(56px, 8vw, 88px);
  position: relative; overflow: hidden;
}
.thanks-hero h1 { color: #fff; margin-inline: auto; }
.thanks-logo { display: block; height: 56px; width: auto; margin: 0 auto 28px; }
.thanks-hero p { color: rgba(255, 255, 255, 0.85); max-width: 56ch; margin-inline: auto; }
.check-badge {
  width: 76px; height: 76px; border-radius: 999px; margin: 0 auto 24px;
  background: var(--beige); color: var(--petrolio);
  display: grid; place-items: center;
}
.check-badge svg { width: 38px; height: 38px; }
.demo-pill {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 22px;
  font-size: 0.82rem; color: var(--beige);
  border: 1px dashed rgba(183, 156, 114, 0.6); border-radius: 999px; padding: 7px 15px;
}

.thanks-body { padding: clamp(46px, 7vw, 76px) 0; }
.thanks-grid { display: grid; gap: 20px; }
.info-card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(20px, 3.6vw, 30px);
}
.info-card--grey { background: var(--grigio); border-color: transparent; }
.info-card h3 { display: flex; align-items: center; gap: 10px; }
.info-card h3 svg { width: 21px; height: 21px; color: var(--beige-ink); flex: 0 0 auto; }
.info-card ul { margin: 10px 0 0; padding-left: 1.2em; }
.info-card li { margin-bottom: 5px; }
.info-card li::marker { color: var(--beige-ink); }
.spam-note { font-size: 0.88rem; color: var(--ink-soft); margin: 14px 0 0; }

.gift-card { border: 1.5px dashed var(--beige); background: #fffdf9; }
.gift-rows { display: grid; gap: 10px; margin-top: 8px; }
.gift-row { display: grid; gap: 2px; }
.gift-row .g-label { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--beige-ink); }
.gift-row .g-value { font-weight: 500; }
.gift-stock { font-size: 0.86rem; color: var(--ink-soft); margin: 14px 0 0; }

.assistant-card { background: var(--petrolio); color: #fff; border: 0; position: relative; overflow: hidden; }
.assistant-card h3 { color: #fff; }
.assistant-card h3 svg { color: var(--beige); }
.assistant-card p { color: rgba(255, 255, 255, 0.84); position: relative; z-index: 1; }
.assistant-card .btn { position: relative; z-index: 1; }
.assistant-botanic {
  position: absolute; right: -50px; bottom: -65px; width: 240px;
  color: var(--beige); opacity: 0.14; transform: rotate(-10deg); pointer-events: none;
}

/* ---------------- FOOTER ---------------- */
.site-footer { background: var(--petrolio-3); color: rgba(255, 255, 255, 0.85); padding: clamp(46px, 6vw, 68px) 0 30px; }
.footer-grid { display: grid; gap: 34px; grid-template-columns: 1.3fr 1fr; max-width: 1080px; margin-inline: auto; padding-inline: 22px; }
.footer-logo img { height: 44px; width: auto; }
.footer-funding { font-size: 0.9rem; max-width: 48ch; margin-top: 18px; color: rgba(255, 255, 255, 0.78); }
.footer-label { font-size: 0.74rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--beige); margin: 26px 0 12px; }
.partner-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.partner-logo {
  background: #fff; border-radius: 10px; padding: 12px 18px;
  display: inline-flex; align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.partner-logo img { height: 56px; width: auto; display: block; }
.partner-logo--lg img { height: 76px; }
@media (max-width: 600px) {
  .partner-logo img { height: 44px; }
  .partner-logo--lg img { height: 60px; }
}
.partner-ph {
  border: 1px dashed rgba(255, 255, 255, 0.32); border-radius: 9px;
  padding: 9px 15px; font-size: 0.8rem; color: rgba(255, 255, 255, 0.72);
}
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-links a { color: rgba(255, 255, 255, 0.85); text-decoration: none; font-size: 0.92rem; }
.footer-links a:hover { color: var(--beige); text-decoration: underline; }
.footer-bottom {
  max-width: 1080px; margin: 40px auto 0; padding: 22px 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem; color: rgba(255, 255, 255, 0.55);
}

/* ---------------- ANIMAZIONI ---------------- */
.anim-in { animation: fadeUp 0.45s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hero .anim-1 { animation: fadeUp 0.6s 0.05s ease both; }
.hero .anim-2 { animation: fadeUp 0.6s 0.16s ease both; }
.hero .anim-3 { animation: fadeUp 0.6s 0.27s ease both; }
.hero .anim-4 { animation: fadeUp 0.6s 0.38s ease both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001s !important; animation-delay: 0s !important; transition-duration: 0.001s !important; }
  .spinner { animation: none; border-top-color: var(--beige); }
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 720px) {
  .benefits { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .survey-nav { flex-direction: column-reverse; align-items: stretch; }
  .survey-nav .btn { width: 100%; }
  .survey-nav .spacer { display: none; }
  .consent-cta-row { justify-content: stretch; }
  .consent-cta-row .btn { width: 100%; }
  .hero-actions .btn { width: 100%; }
  .header-logo img { height: 31px; }
  .header-bar { gap: 8px; }
  .textsize-group { display: none; } /* su mobile lo zoom di sistema è preferibile; si riattiva sotto */
}
@media (max-width: 720px) and (min-width: 480px) {
  .textsize-group { display: flex; }
}

/* ============================================================
   SELETTORE LINGUA (dropdown)
   ============================================================ */
.lang-select { position: relative; }
.lang-current {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 7px 12px 7px 14px; font: 600 0.82rem var(--font); color: var(--ink);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.lang-current:hover { border-color: var(--petrolio); }
.lang-current[aria-expanded="true"] { border-color: var(--petrolio); background: var(--beige-soft, rgba(183,156,114,.14)); }
.lang-current svg { transition: transform .2s; opacity: .65; }
.lang-current[aria-expanded="true"] svg { transform: rotate(180deg); }
.lang-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 168px;
  list-style: none; margin: 0; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 28px rgba(13,34,39,.14);
  z-index: 80;
}
.lang-menu[hidden] { display: none; }
.lang-menu li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px; font-size: 0.9rem;
  cursor: pointer; user-select: none;
}
.lang-menu li:hover, .lang-menu li:focus-visible { background: var(--grigio); outline: none; }
.lang-menu li[aria-selected="true"] { background: var(--petrolio); color: #fff; font-weight: 500; }
.lang-flag { font-size: 1.05rem; line-height: 1; }

/* ============================================================
   PULSANTE FAB ACCESSIBILITÀ (sempre visibile in basso a destra)
   ============================================================ */
.a11y-open {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 7px 13px; color: var(--petrolio); font-weight: 500; font-size: 0.82rem;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.a11y-open:hover { border-color: var(--petrolio); background: var(--beige-soft, rgba(183,156,114,.14)); }
.a11y-open[aria-expanded="true"] { background: var(--petrolio); color: #fff; border-color: var(--petrolio); }
@media (max-width: 480px) { .a11y-open-label { display: none; } }

.a11y-fab {
  position: fixed; left: 0; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 0 8px 8px 0;
  background: var(--petrolio); color: #fff; border: 0;
  box-shadow: 4px 4px 14px rgba(13,34,39,.22);
  cursor: pointer; z-index: 60;
  display: inline-flex; align-items: center; justify-content: center;
  transition: width .18s, background .15s;
  padding: 0;
}
.a11y-fab:hover { background: var(--petrolio-2, #1d4651); width: 50px; }
.a11y-fab[aria-expanded="true"] { background: var(--petrolio-2, #1d4651); }
.a11y-fab svg { width: 22px; height: 22px; }

/* ============================================================
   PANNELLO ACCESSIBILITÀ (laterale sinistro, stretto)
   ============================================================ */
.a11y-backdrop {
  position: fixed; inset: 0; background: rgba(13,34,39,.32);
  z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.a11y-backdrop.is-open { opacity: 1; pointer-events: auto; }
.a11y-backdrop[hidden] { display: none; }

.a11y-panel {
  position: fixed; top: 0; left: 0; height: 100vh; width: 280px; max-width: 88vw;
  background: #fff; box-shadow: 16px 0 40px rgba(13,34,39,.18);
  z-index: 100; padding: 18px 16px 22px;
  transform: translateX(-100%); transition: transform .28s ease;
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px;
}
.a11y-panel.is-open { transform: translateX(0); }
.a11y-panel[hidden] { display: none; }

.a11y-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.a11y-panel-head h2 {
  margin: 0; font-size: 0.98rem; color: var(--petrolio); font-weight: 600;
}
.a11y-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--grigio); color: var(--petrolio); border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.a11y-close svg { width: 16px; height: 16px; }
.a11y-close:hover { background: var(--beige-soft, rgba(183,156,114,.18)); }

.a11y-panel-intro {
  margin: -6px 0 2px; font-size: 0.74rem; color: var(--beige-ink, #7a6540); line-height: 1.45;
}

.a11y-group { display: flex; flex-direction: column; gap: 6px; }
.a11y-label {
  font-size: 0.66rem; font-weight: 600; color: var(--beige-ink, #7a6540);
  text-transform: uppercase; letter-spacing: .06em;
}
.a11y-row-buttons { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.a11y-btn {
  background: #fff; border: 1.5px solid var(--line); border-radius: 7px;
  padding: 6px 9px; font: 600 0.78rem var(--font); color: var(--ink);
  cursor: pointer; transition: border-color .15s, background .15s, color .15s;
  min-width: 34px;
}
.a11y-btn:hover { border-color: var(--petrolio); }
.a11y-btn[aria-pressed="true"] { background: var(--petrolio); color: #fff; border-color: var(--petrolio); }
.a11y-value {
  margin-left: auto; font-size: 0.76rem; color: var(--beige-ink, #7a6540); font-variant-numeric: tabular-nums;
}

.a11y-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px;
}
.a11y-toggle-label { flex: 1; cursor: pointer; }
.a11y-toggle-title { display: block; font-weight: 500; font-size: 0.82rem; color: var(--ink); line-height: 1.3; }
.a11y-toggle-desc { display: block; font-size: 0.7rem; color: var(--beige-ink, #7a6540); margin-top: 2px; line-height: 1.35; }
.a11y-switch {
  -webkit-appearance: none; appearance: none;
  width: 36px; height: 20px; border-radius: 999px;
  background: #d6dddc; position: relative; cursor: pointer;
  transition: background .18s; flex: 0 0 auto;
}
.a11y-switch::before {
  content: ""; position: absolute; top: 2.5px; left: 2.5px;
  width: 15px; height: 15px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
  transition: transform .18s;
}
.a11y-switch:checked { background: var(--petrolio); }
.a11y-switch:checked::before { transform: translateX(16px); }
.a11y-switch:focus-visible { outline: 3px solid var(--petrolio); outline-offset: 2px; }

.a11y-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.a11y-reset {
  width: 100%; background: transparent; border: 1.5px solid var(--line);
  border-radius: 8px; padding: 8px; font: 500 0.78rem var(--font); color: var(--ink);
  cursor: pointer; transition: background .15s, border-color .15s;
}
.a11y-reset:hover { background: var(--grigio); border-color: var(--petrolio); }

/* ============================================================
   MODALITÀ ACCESSIBILITÀ (attivate aggiungendo classi su <html>)
   ============================================================ */
/* Scala font: gestita via inline style su :root come prima */

/* Interlinea */
html.a11y-line-large body { line-height: 1.75; }
html.a11y-line-xlarge body { line-height: 2; }

/* Contrasto elevato */
html.a11y-contrast {
  --petrolio: #000; --petrolio-2: #000; --petrolio-3: #000;
  --ink: #000;
  --beige: #B45F00; --beige-ink: #6E3A00;
  --line: #000;
}
html.a11y-contrast body { background: #fff !important; }
html.a11y-contrast .hero.on-dark,
html.a11y-contrast .site-footer { background: #000 !important; color: #fff !important; }
html.a11y-contrast .hero.on-dark *,
html.a11y-contrast .site-footer * { color: #fff !important; }
html.a11y-contrast .btn,
html.a11y-contrast button:not(.a11y-switch):not(.lang-menu li) { border: 2px solid currentColor !important; }
html.a11y-contrast .card, html.a11y-contrast .privacy-card,
html.a11y-contrast .question-card { border: 2px solid #000 !important; }

/* Font ad alta leggibilità (dislessia) — usa Atkinson Hyperlegible se disponibile, altrimenti fallback safe */
html.a11y-dyslexia,
html.a11y-dyslexia body,
html.a11y-dyslexia .btn,
html.a11y-dyslexia input,
html.a11y-dyslexia textarea,
html.a11y-dyslexia select {
  font-family: "Atkinson Hyperlegible", "Verdana", "Tahoma", sans-serif !important;
  letter-spacing: 0.02em;
}

/* Sottolinea i link */
html.a11y-underline a:not(.btn):not(.tool-btn) {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}

/* Riduci animazioni */
html.a11y-no-motion *,
html.a11y-no-motion *::before,
html.a11y-no-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* Cursore evidenziato */
html.a11y-cursor, html.a11y-cursor * {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><path d='M4 2 L4 24 L10 19 L14 28 L18 26 L14 17 L22 17 Z' fill='%23153238' stroke='%23ffffff' stroke-width='1.5'/></svg>") 4 2, auto !important;
}
html.a11y-cursor button, html.a11y-cursor a, html.a11y-cursor [role="button"],
html.a11y-cursor input, html.a11y-cursor select, html.a11y-cursor textarea {
  cursor: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'><path d='M14 4 v9 h-3 a1 1 0 0 0-.7 1.7 l5 5 a1 1 0 0 0 1.4 0 l5-5 a1 1 0 0 0-.7-1.7 h-3 v-9 z' fill='%23B79C72' stroke='%23153238' stroke-width='1.5'/></svg>") 16 16, pointer !important;
}

/* Responsive del pannello a11y */
@media (max-width: 600px) {
  .a11y-fab { width: 40px; height: 40px; }
  .a11y-panel { width: 88vw; padding: 16px 14px; }
}
