/* Base comune alle tre proposte: reset, accessibilità, moduli, video, segnaposto, barra di anteprima.
   L'aspetto (colori, caratteri, forme) lo decide ogni proposta tramite le variabili. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 1.0625rem; line-height: 1.6; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; overflow-wrap: break-word; }
@media (max-width: 480px) { h1, h2, h3 { hyphens: auto; } }
p { margin: 0 0 1em; }
ul, ol { padding: 0; margin: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus, #1f6feb); outline-offset: 3px; border-radius: 2px; }
main:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .7rem 1rem; background: var(--ink); color: var(--bg); text-decoration: none; border-radius: 4px; }
.skip:focus { top: 1rem; }
[hidden] { display: none !important; }
[data-hidden-by-result] { display: none !important; }

/* Barra di anteprima e punti da verificare */
.preview-bar { position: relative; z-index: 60; display: flex; flex-wrap: wrap; gap: .4rem 1rem; align-items: center; justify-content: space-between; padding: .45rem 1rem; background: #fff3c4; color: #3d3000; font: 500 .8rem/1.35 system-ui, sans-serif; border-bottom: 1px solid #e6cf6a; }
.preview-bar button { background: #3d3000; color: #fff3c4; border: 0; border-radius: 999px; padding: .3rem .8rem; cursor: pointer; font-size: .78rem; }
.show-verify .da-verificare { background: #fff3c4; color: #3d3000; outline: 2px dashed #d2a900; outline-offset: 2px; border-radius: 2px; }
.show-verify .da-verificare::after { content: " ⚑ " attr(data-nota); display: block; font: 500 .75rem/1.35 system-ui, sans-serif; margin-top: .25rem; }
.photo-note, .ph-note { font-size: .78rem; }
html:not(.is-preview) .photo-note { display: none; }

/* Segnaposto per foto mancanti */
.ph { position: relative; margin: 0; aspect-ratio: var(--ratio, 4/3); overflow: hidden; background: var(--ph-bg, #e9e4da); color: var(--ph-ink, #8a7a5c); border-radius: var(--radius-media, 0); display: flex; align-items: flex-end; }
.ph::before { content: ""; position: absolute; inset: 0; background-image: repeating-linear-gradient(135deg, transparent 0 14px, rgba(0,0,0,.025) 14px 15px); }
.ph-art { position: absolute; inset: 12% 8% 22%; display: flex; align-items: center; justify-content: center; opacity: .9; }
.ph-art svg { width: 100%; height: 100%; }
.ph-label { min-width: 0; overflow-wrap: anywhere; position: relative; z-index: 1; display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; font: 500 .78rem/1.35 system-ui, sans-serif; color: var(--ph-label, #5d5442); }
.ph-tag { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }

/* Foto */
.photo { margin: 0; }
.photo img { width: 100%; border-radius: var(--radius-media, 0); }
.photo-note { margin-top: .5rem; color: var(--muted); }

/* Video */
.vplayer { margin: 0; max-width: 360px; width: 100%; }
.vplayer-frame { position: relative; aspect-ratio: var(--ratio, 9/16); background: #111; overflow: hidden; border-radius: var(--radius-media, 0); }
.vplayer-frame img, .vplayer-frame video { width: 100%; height: 100%; object-fit: cover; }
.vplayer-btn { position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%); display: inline-flex; align-items: center; gap: .6rem; padding: .7rem 1.1rem; border: 0; border-radius: 999px; background: rgba(255,255,255,.94); color: #111; font-weight: 600; cursor: pointer; box-shadow: 0 6px 24px rgba(0,0,0,.25); white-space: nowrap; }
.vplayer-icon { width: 0; height: 0; border-left: 12px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.vplayer-dur { font-weight: 400; opacity: .7; font-size: .85em; }
.vplayer figcaption { margin-top: .6rem; font-size: .85rem; color: var(--muted); }

/* Moduli */
.lead-form { display: grid; gap: 1rem; }
.f-grid { display: grid; gap: 1rem; }
.f-field { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.f-field label, .f-field legend, .f-label { font-weight: 600; font-size: .95rem; padding: 0; }
.f-opt { font-weight: 400; color: var(--muted); }
.f-field input[type=text], .f-field input[type=email], .f-field input[type=tel], .f-field select, .f-field textarea {
  width: 100%; min-height: 48px; padding: .7rem .85rem; background: var(--field-bg, #fff); border: 1px solid var(--field-line, #c9c2b6); border-radius: var(--radius-field, 4px); }
.f-field textarea { min-height: 96px; resize: vertical; }
.f-field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.f-phone-row { display: grid; grid-template-columns: minmax(98px, 34%) 1fr; gap: .5rem; }
.f-choices { display: flex; flex-wrap: wrap; gap: .5rem; }
.f-choice { position: relative; display: inline-flex; cursor: pointer; font-weight: 500; }
.f-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.f-choice span { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem .9rem; border: 1px solid var(--field-line, #c9c2b6); border-radius: var(--radius-choice, 999px); background: var(--field-bg, #fff); font-size: .92rem; }
.f-choice input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.f-choice input:focus-visible + span { outline: 3px solid var(--focus, #1f6feb); outline-offset: 2px; }
.f-check { grid-template-columns: auto 1fr; align-items: start; gap: .6rem; }
.f-check input { width: 22px; height: 22px; margin-top: .15rem; accent-color: var(--accent); }
.f-check label { font-weight: 400; font-size: .92rem; }
.f-check .f-err { grid-column: 1 / -1; }
.f-err { margin: 0; min-height: 0; color: var(--error, #b42318); font-size: .85rem; font-weight: 600; }
.f-err:empty { display: none; }
.is-invalid input, .is-invalid select, .is-invalid textarea { border-color: var(--error, #b42318) !important; }
.f-details { border-top: 1px solid var(--field-line, #c9c2b6); padding-top: .8rem; }
.f-details summary { cursor: pointer; font-weight: 600; font-size: .95rem; min-height: 44px; display: flex; align-items: center; }
.f-details-body { display: grid; gap: 1rem; padding-top: .6rem; }
.f-row { display: grid; grid-template-columns: 1fr 110px; gap: .75rem; }
.f-note { font-size: .88rem; color: var(--muted); margin: 0; }
.f-summary { margin: 0; color: var(--error, #b42318); font-weight: 600; }
.f-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.f-step { border: 0; padding: 0; margin: 0; display: grid; gap: 1rem; min-width: 0; }
.f-step-title { font-weight: 700; font-size: 1.1rem; padding: 0; }
.f-step-n { display: block; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.f-progress { height: 4px; background: var(--field-line, #ddd); border-radius: 4px; overflow: hidden; }
.f-progress span { display: block; height: 100%; width: 50%; background: var(--accent); transition: width .3s; }
.f-nav { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.f-result { outline: none; scroll-margin-top: 110px; }
.lead-form .f-nav .f-submit { flex: 1 1 100%; order: -1; }
.lead-form .f-nav [data-prev] { flex: 0 1 auto; }
.f-result ol { padding-left: 1.2rem; list-style: decimal; margin: 0 0 1rem; }
.f-result li { margin-bottom: .3rem; }
.f-demo { padding: 1.2rem; border: 2px dashed #d2a900; background: #fffbea; color: #2f2700; border-radius: var(--radius-field, 4px); }
.f-demo pre { white-space: pre-wrap; word-break: break-word; font-size: .78rem; background: #fff; padding: .7rem; border: 1px solid #eadfa8; max-height: 260px; overflow: auto; }
.f-demo summary { cursor: pointer; font-weight: 600; margin-bottom: .5rem; }
.f-result-title { font-weight: 800; font-size: 1.1rem; margin-bottom: .4rem; }
.f-result-sub { font-weight: 700; margin-bottom: .3rem; }
.f-ok { padding: 1.2rem; border: 1px solid #2e7d4f; background: #eef8f1; }
.f-ko { padding: 1.2rem; border: 1px solid #b42318; background: #fdf0ef; }
@media (min-width: 640px) { .f-grid { grid-template-columns: 1fr 1fr; } .f-grid > .f-radios, .f-grid > .f-field:has(textarea), .f-grid > .f-phone { grid-column: 1 / -1; } }

/* FAQ */
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 1.1rem 0; font-weight: 600; min-height: 44px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; font-size: 1.4rem; line-height: 1; transition: transform .2s; flex: none; }
.faq-list details[open] summary::after { transform: rotate(45deg); }
.faq-a { padding: 0 0 1.1rem; color: var(--muted); }

/* Breadcrumb */
.crumbs ol { display: flex; flex-wrap: wrap; gap: .3rem; font-size: .85rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: .3rem; opacity: .6; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* Lingua */
.lang { display: flex; gap: .25rem; align-items: center; }
.lang a, .lang span { display: inline-flex; min-width: 40px; min-height: 40px; align-items: center; justify-content: center; text-decoration: none; font-weight: 700; font-size: .82rem; letter-spacing: .06em; }
.lang abbr { text-decoration: none; }

/* Contatti, social, portali */
.contact-list li, .foot-contacts li, .form-contacts li { display: grid; grid-template-columns: 24px 1fr; gap: .7rem; align-items: start; margin-bottom: .7rem; }
.cl-label { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.social { display: flex; gap: .5rem; flex-wrap: wrap; }
.social a { display: inline-flex; gap: .45rem; align-items: center; min-height: 44px; padding: .4rem .8rem; text-decoration: none; }
.portals { display: grid; gap: .75rem; margin: 1.2rem 0; }
.portals a { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 1rem; padding: 1.1rem 1.2rem; text-decoration: none; border: 1px solid var(--line); background: var(--card, #fff); }
.pl-name { font-weight: 700; font-size: 1.15rem; }
.pl-sub { grid-row: 2; font-size: .85rem; color: var(--muted); }
.portals .ico { grid-row: 1 / 3; grid-column: 2; }
@media (min-width: 640px) { .portals { grid-template-columns: 1fr 1fr; } }
.updated { font-size: .85rem; color: var(--muted); margin-top: 1.5rem; }
.draft-banner { padding: 1rem 1.2rem; background: #fff3c4; color: #3d3000; border-left: 4px solid #d2a900; font-weight: 600; }
.ico { width: 22px; height: 22px; flex: none; }

/* Comparsa leggera */
.js-reveal .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s ease; }
.js-reveal .reveal.is-in { opacity: 1; transform: none; }
