/* =========================================================================
   Autoscuola — base condivisa dalle proposte
   Reset · icone · placeholder immagini · animazioni di caricamento ·
   slideshow · dialog. Lo stile di ogni proposta è dentro la sua pagina.
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; animation: fadein .45s ease both; }
img, svg, video, iframe { display: block; max-width: 100%; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd, address { margin: 0; }
address { font-style: normal; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

.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: 12px; top: -80px; z-index: 1000; padding: 10px 14px; border-radius: 8px; background: #000; color: #fff; font-weight: 600; }
.skip:focus { top: 12px; }

/* Icone: sprite iniettato da common.js → <svg class="i"><use href="#i-phone"/></svg> */
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Placeholder immagini.
   Se il file indicato in data-img esiste, common.js lo carica al posto del placeholder. */
.ph { position: relative; overflow: hidden; background-color: #26303d; background-image: var(--ph, linear-gradient(135deg, #3a4657, #1b222c)); background-size: cover; background-position: center; }
.ph::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 1px, transparent 1px 12px); }
.ph[data-label]::after { content: attr(data-label); position: absolute; right: 14px; top: 14px; pointer-events: none; padding: 6px 8px; border: 1px dashed rgba(255,255,255,.35); border-radius: 4px; font: 600 10px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.62); }
.ph.has-img::before, .ph.has-img::after { display: none; }

/* Caricamento: solo una comparsa morbida, niente di più */
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
.rise { animation: rise .7s cubic-bezier(.2, .75, .25, 1) both; animation-delay: calc(var(--d, 0) * 80ms + 60ms); }

/* Slideshow (dissolvenza) */
.slides { position: absolute; inset: 0; overflow: hidden; animation: fadein 1s ease both; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.slide.is-active, .slide:first-child { opacity: 1; }
.js .slide:first-child:not(.is-active) { opacity: 0; }
.slide > .ph { position: absolute; inset: 0; }

/* Dialog */
dialog { padding: 0; border: 0; max-width: none; max-height: none; color: inherit; background: transparent; }
dialog::backdrop { background: rgba(8, 12, 18, .55); backdrop-filter: blur(3px); }
dialog[open] { animation: rise .35s cubic-bezier(.2, .75, .25, 1); }
dialog[open]::backdrop { animation: fadein .3s ease; }
html:has(dialog[open]), html.menu-open { overflow: hidden; }

/* Form dimostrativi */
[data-mock-form] .sent { display: none; }
[data-mock-form].is-sent > :not(.sent) { display: none; }
[data-mock-form].is-sent .sent { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
