/* Studio Tecnico MaSc · Bologna — stile del sito
   Palette: petrolio #1F5F7A, inchiostro #12222B, carta #FAFBFA, nebbia #E8EEF0, segnale #B26A00
   Font di sistema: nessun servizio esterno, quindi nessun problema di privacy con i font. */

:root {
  color-scheme: light dark;
  --btn: #1F5F7A;
  --btn-hover: #154559;
  --header-bg: rgba(250,251,250,.94);
  --paper-0: rgba(250,251,250,0);
  --card: #ffffff;
  --foot-bg: #12222B;
  --brand: #1F5F7A;
  --brand-dark: #154559;
  --ink: #12222B;
  --muted: #53656F;
  --paper: #FAFBFA;
  --mist: #E8EEF0;
  --line: #D5DEE2;
  --signal: #B26A00;
  --todo: #FFF1B8;
  --wrap: 1120px;
  --font: "Avenir Next", "Segoe UI", "Helvetica Neue", Roboto, system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --btn: #2A7A9B;
    --btn-hover: #226682;
    --header-bg: rgba(15,27,33,.94);
    --paper-0: rgba(15,27,33,0);
    --card: #15262E;
    --foot-bg: #0A1317;
    --brand: #6DBBD9;
    --brand-dark: #9AD3E7;
    --ink: #E6EEF1;
    --muted: #A2B5BE;
    --paper: #0F1B21;
    --mist: #162830;
    --line: #28424D;
    --signal: #E0A03A;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
img, svg { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--btn); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

h1, h2, h3 { line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 .6em; font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.7rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 68ch; }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 56ch; }
.muted { color: var(--muted); }
.small { font-size: .92rem; }

/* segnaposto da compilare */
.todo { background: var(--todo); color: #12222B; padding: 0 .25em; border-radius: 3px; font-weight: 600; }
.todo a { color: #12222B; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }
.brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.1; }
.brand-name { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; }
.brand-name b { color: var(--brand); font-weight: 800; }
.brand-sub { font-size: .78rem; color: var(--muted); letter-spacing: .01em; margin-top: 2px; }
.nav { display: flex; align-items: center; gap: 1.6rem; }
.nav a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: .98rem; padding: .35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-color: var(--line); }
.nav a[aria-current="page"] { border-color: var(--brand); }
.nav .btn { border-bottom: 0; padding: .6rem 1.1rem; }
.menu-btn { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: .5rem .75rem; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; }

/* ---------- bottoni ---------- */
.btn { display: inline-block; background: var(--btn); color: #fff; text-decoration: none; font-weight: 600; padding: .85rem 1.5rem; border-radius: 6px; border: 1px solid var(--btn); transition: background .15s; }
.btn:hover { background: var(--btn-hover); color: #fff; }
.btn.ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn.ghost:hover { background: var(--mist); color: var(--brand-dark); }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }

/* ---------- hero ---------- */
.hero { position: relative; padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 5vw, 4rem); overflow: hidden;
  background-image:
    linear-gradient(var(--mist) 1px, transparent 1px),
    linear-gradient(90deg, var(--mist) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: -1px -1px; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, var(--paper-0) 55%, var(--paper) 100%); pointer-events: none; }
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.hero h1 { margin-bottom: .45em; }
.hero-note { margin-top: 1.4rem; font-size: .95rem; color: var(--muted); }
.plan { width: 100%; height: auto; }
.plan .wall { stroke: var(--ink); stroke-width: 3; fill: none; stroke-linecap: square; }
.plan .thin { stroke: var(--brand); stroke-width: 1.4; fill: none; }
.plan .dim { stroke: var(--brand); stroke-width: 1.2; fill: none; }
.plan text { font-family: var(--font); font-size: 13px; fill: var(--brand); }
.plan .room { fill: var(--muted); font-size: 12px; }
.plan .draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.8s ease-out .2s forwards; }
.plan .label { opacity: 0; animation: show .6s ease-out 1.6s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes show { to { opacity: 1; } }

/* ---------- sezioni ---------- */
section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.band { background: var(--mist); }
.sec-head { max-width: 62ch; margin-bottom: 2rem; }
.sec-head p { color: var(--muted); }

/* elenco servizi a righe (non a schede) */
.rows { border-top: 1px solid var(--ink); }
.row { display: grid; grid-template-columns: 56px minmax(0, 15rem) minmax(0, 1fr); gap: 1.2rem; align-items: start; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.row .ico { width: 40px; height: 40px; stroke: var(--brand); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.row h3 { margin: 0; font-size: 1.25rem; }
.row p { margin: 0 0 .6em; }
.row p:last-child { margin: 0; }
.row a.more { font-weight: 600; font-size: .95rem; }

/* callout rogito */
.callout { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; border-left: 5px solid var(--signal); background: var(--card); padding: 1.8rem 2rem; border-radius: 0 8px 8px 0; box-shadow: 0 1px 0 var(--line); }
.callout h2 { font-size: 1.6rem; margin-bottom: .4em; }
.callout p { margin: 0; color: var(--muted); }

/* passi: sequenza vera */
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6rem; }
.steps li { counter-increment: s; border-top: 3px solid var(--brand); padding-top: 1rem; }
.steps li::before { content: counter(s); display: block; font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1; margin-bottom: .5rem; }
.steps h3 { font-size: 1.1rem; margin-bottom: .3em; }
.steps p { font-size: .98rem; color: var(--muted); margin: 0; }
.steps-long { grid-template-columns: 1fr; gap: 0; }
.steps-long li { display: grid; grid-template-columns: 4rem 1fr; border-top: 1px solid var(--line); padding: 1.6rem 0; }
.steps-long li::before { margin: 0; font-size: 2.4rem; }
.steps-long h3 { font-size: 1.3rem; }
.steps-long p { font-size: 1.05rem; color: var(--ink); max-width: 62ch; }

/* due professionisti */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.person { border-top: 3px solid var(--brand); padding-top: 1.2rem; }
.person .photo { width: 100%; max-width: 220px; aspect-ratio: 1; background: var(--mist); border: 1px dashed var(--line); display: grid; place-items: center; color: var(--muted); font-size: .85rem; margin-bottom: 1rem; border-radius: 6px; }
.person .role { color: var(--muted); margin: -.3em 0 1em; }
dl.data { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .96rem; }
dl.data dt { color: var(--muted); }
dl.data dd { margin: 0; overflow-wrap: anywhere; }

/* liste semplici */
.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { position: relative; padding-left: 1.6rem; margin-bottom: .45rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .6em; width: .8rem; height: 2px; background: var(--brand); }

/* faq */
details { border-top: 1px solid var(--line); padding: 1.1rem 0; }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 600; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font-size: 1.5rem; line-height: 1; color: var(--brand); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: .8rem 0 0; color: var(--muted); }

/* pagine interne */
.page-head { padding: clamp(2.2rem, 5vw, 4rem) 0 1.5rem; border-bottom: 1px solid var(--line); background-image: linear-gradient(var(--mist) 1px, transparent 1px); background-size: 100% 44px; }
.page-head h1 { font-size: clamp(2rem, 4.4vw, 3rem); margin-bottom: .3em; }
.page-head p { margin: 0; color: var(--muted); font-size: 1.15rem; }
.prose h2 { margin-top: 2rem; font-size: 1.5rem; }
.prose h3 { margin-top: 1.4rem; }
.prose table { border-collapse: collapse; width: 100%; font-size: .96rem; margin: 1rem 0; }
.prose th, .prose td { text-align: left; border-bottom: 1px solid var(--line); padding: .6rem .8rem .6rem 0; vertical-align: top; }
.draft { color: #12222B; background: var(--todo); border-left: 5px solid var(--signal); padding: 1rem 1.2rem; border-radius: 0 6px 6px 0; margin-bottom: 2rem; font-weight: 600; }
.formbox { border: 2px dashed var(--line); border-radius: 8px; padding: 3rem 1.5rem; text-align: center; background: var(--card); color: var(--muted); }

/* contatti */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.mapbox { margin-top: 2rem; min-height: 260px; border: 1px dashed var(--line); background: var(--mist); display: grid; place-items: center; color: var(--muted); border-radius: 6px; text-align: center; padding: 1rem; }

/* footer */
.site-footer { background: var(--foot-bg); color: #D6E0E5; padding: 3rem 0 2rem; margin-top: 2rem; font-size: .95rem; }
.site-footer a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; }
.site-footer h3 { color: #fff; font-size: 1rem; margin-bottom: .6em; }
.site-footer p { margin: 0 0 .5em; }
.legal { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid #2c4350; font-size: .85rem; color: #9db0ba; }
.legal { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 0 2rem; }
.legal p { max-width: none; }
.legal p:first-child { grid-column: 1; text-align: justify; text-align-last: left; text-justify: inter-word; hyphens: auto; -webkit-hyphens: auto; }
.legal p:last-child { grid-column: 1 / -1; margin-top: 1rem; text-align: left; }
.site-footer .todo { color: var(--ink); }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  .hero .wrap, .duo, .contact-grid, .foot-grid, .legal, .callout { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .row { grid-template-columns: 44px 1fr; }
  .row > div:last-child { grid-column: 1 / -1; }
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1.25rem 1rem; }
  .nav.open { display: flex; }
  .nav a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav .btn { text-align: center; margin-top: .8rem; }
  .plan { max-width: 520px; margin-inline: auto; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: 1fr; }
  body { font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .plan .draw { animation: none; stroke-dashoffset: 0; }
  .plan .label { animation: none; opacity: 1; }
}
@media print { .site-header, .site-footer, .btn-row { display: none; } }

/* ---------- schede servizi ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 1.6rem; }
.card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.card-media { aspect-ratio: 4 / 3; background: var(--mist); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.card-media.icon { display: grid; place-items: center; }
.card-media.icon .ico { width: 84px; height: 84px; fill: none; stroke: var(--brand); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 1.2rem 1.3rem 1.4rem; }
.card-body h3 { font-size: 1.15rem; color: var(--brand-dark); }
.card-body p { color: var(--muted); font-size: .98rem; flex: 1; }
.btn.small { align-self: flex-start; padding: .55rem 1rem; font-size: .92rem; }
/* ancore dei dettagli: spazio sotto la testata fissa */
.row { scroll-margin-top: 90px; }

/* loghi (Chi siamo) */
.logo-plate { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: .7rem .9rem; margin-bottom: 1rem; line-height: 0; }
.logo-plate img { height: 84px; width: auto; }
.logo-plate.sm { padding: .3rem .5rem; margin: .6rem 0 0; }
.logo-plate.sm img { height: 44px; }
/* illustrazioni e foto: nessun fondo bianco forzato nel tema scuro */
@media (prefers-color-scheme: dark) { .card-media img { opacity: .94; } }

/* ---------- modulo di preventivo ---------- */
.wrap.narrow { max-width: 760px; }
.req { color: var(--signal); font-weight: 700; }
#qf { margin-top: 1rem; }
.dots { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; padding: 0; margin: 0 0 1.6rem; counter-reset: d; }
.dots li { counter-increment: d; font-size: .82rem; color: var(--muted); border-top: 3px solid var(--line); padding-top: .45rem; }
.dots li::before { content: counter(d) ". "; }
.dots li.on { color: var(--brand); border-top-color: var(--brand); font-weight: 700; }
.dots li.done { border-top-color: var(--brand); }
@media (max-width: 560px) { .dots li { font-size: 0; } .dots li::before { font-size: .85rem; } }
#qf .step { display: none; border: 0; padding: 0; margin: 0; min-width: 0; }
#qf .step.on { display: block; }
#qf legend { font-size: 1.35rem; font-weight: 700; color: var(--brand-dark); margin-bottom: 1rem; padding: 0; }
@media (prefers-color-scheme: dark) { #qf legend { color: var(--brand); } }
#qf .f { margin-bottom: 1.15rem; }
#qf .lab { font-weight: 600; margin-bottom: .35rem; }
#qf .hint, #qf .intro { color: var(--muted); font-size: .92rem; margin: 0 0 .5rem; max-width: none; }
#qf .intro { margin-bottom: 1.2rem; }
#qf input[type=text], #qf input[type=tel], #qf input[type=email], #qf input[type=date], #qf select, #qf textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .7rem .8rem; }
#qf textarea { resize: vertical; }
#qf input:focus, #qf select:focus, #qf textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
#qf .bad { border-color: #C0392B !important; outline: 2px solid #C0392B; }
#qf .opts { display: grid; gap: .45rem; }
#qf .opt, #qf .consent, #qf .nodoc { display: flex; gap: .65rem; align-items: flex-start; cursor: pointer; }
#qf .opt { border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: .6rem .8rem; }
#qf .opt:has(input:checked) { border-color: var(--brand); background: var(--mist); }
#qf input[type=radio], #qf input[type=checkbox] { margin-top: .25rem; accent-color: var(--brand); flex: none; }
#qf .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
#qf .row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
@media (max-width: 560px) { #qf .row2, #qf .row3 { grid-template-columns: 1fr; gap: 0; } }
#qf .grp { margin-bottom: 1.8rem; }
#qf .grp h3 { font-size: 1.05rem; margin: 0 0 .8rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }
#qf .doc { border: 1px solid var(--line); background: var(--card); border-radius: 6px; padding: .8rem; margin-bottom: .7rem; }
#qf .dl { font-weight: 600; margin-bottom: .45rem; }
#qf .dh { display: block; font-weight: 400; font-size: .88rem; color: var(--muted); }
#qf .nodoc { margin-top: .5rem; font-size: .92rem; color: var(--muted); }
#qf input[type=file] { width: 100%; font: inherit; font-size: .92rem; }
#qf .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#qf .consent { margin-top: 1rem; }
#qf [hidden] { display: none !important; }
#qf .bar2 { display: flex; gap: .8rem; margin-top: 1.6rem; justify-content: space-between; flex-wrap: wrap; }
#qf .bar2 .btn { cursor: pointer; font: inherit; font-weight: 600; }
#qf .bar2 #qnext, #qf .bar2 #qsend { margin-left: auto; }
#qf .msg, .msg { margin-top: 1rem; padding: .8rem 1rem; border-radius: 6px; background: #FDECEA; color: #7A1F14; border: 1px solid #F1B5AD; }
@media (prefers-color-scheme: dark) { #qf .msg, .msg { background: #3A1B17; color: #F5C6BF; border-color: #6B2D25; } }
#qf .prog { margin-top: 1.2rem; }
#qf .prog-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
#qf .prog-bar span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }

/* ---------- centratura dei testi introduttivi ---------- */
.page-head { text-align: center; }
.page-head p { margin-inline: auto; max-width: 60ch; }
.lead.center, section .wrap > .lead { margin-inline: auto; text-align: center; }
.steps-long { max-width: 820px; margin-inline: auto; }
.wrap > .callout { max-width: 820px; margin-inline: auto; }
.faq-wrap, details { max-width: 820px; margin-inline: auto; }
.sec-head { margin-inline: auto; text-align: center; }
.sec-head h2 { text-align: center; }
.hero .lead { text-align: left; margin-inline: 0; }
.logo-plate.sm.geo { margin-top: .6rem; }
.logo-plate.sm.geo img { height: 54px; }
section .wrap > a.btn { display: table; margin-inline: auto; }
section .wrap > p.small { margin-inline: auto; text-align: center; }
.wrap > .btn-row { justify-content: center; }
.wrap > p[style*="margin-top:1.6rem"] { text-align: center; margin-inline: auto; }

/* ---------- testi più larghi, senza parole sole a fine riga ---------- */
p, li, .lead, summary { text-wrap: pretty; }
h1, h2, h3, .page-head p, .sec-head p { text-wrap: balance; }
p { max-width: 86ch; }
.lead { max-width: 74ch; }
.row p, .steps-long p, .prose p, .prose li, details p { max-width: none; }
.steps-long { max-width: 1040px; }
.wrap > .callout { max-width: 1040px; }
details { max-width: 1040px; }
.wrap.prose { max-width: 960px; }
.row { grid-template-columns: 56px minmax(0, 14rem) minmax(0, 1fr); }
@media (max-width: 860px) { .steps-long, .wrap > .callout, details { max-width: none; } }

/* testi di sezione più larghi, titolo su una riga */
.sec-head { max-width: 1000px; }
.sec-head p { max-width: 92ch; margin-inline: auto; }
@media (min-width: 700px) { .sec-head h2 { text-wrap: nowrap; } }
.card-media img { object-position: center; }

/* ---------- elenco materie (Chi siamo) ---------- */
.chips-title { text-align: center; font-weight: 600; color: var(--muted); margin: 2.2rem auto .9rem; }
.chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem .6rem; padding: 0; margin: 0 auto 2.2rem; max-width: 900px; }
.chips li { margin: 0; padding: .32rem .95rem; border: 1px solid var(--line); border-radius: 999px; background: var(--mist); font-size: .97rem; line-height: 1.4; }

/* ---------- animazione in home ---------- */
.hero-media video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--line); background: var(--card); box-shadow: 0 10px 30px rgba(18,34,43,.12); }
@media (prefers-color-scheme: dark) { .hero-media video { box-shadow: 0 10px 30px rgba(0,0,0,.45); } }
@media (max-width: 860px) { .hero-media { max-width: 560px; margin-inline: auto; } }

/* mappa statica nei Contatti */
.mapimg { margin: 2rem 0 0; }
.mapimg img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.mapimg figcaption { margin-top: .6rem; font-size: .85rem; color: var(--muted); }

/* logo MaSc sopra l'animazione in home */
.hero-logo { text-align: center; margin-bottom: 1.4rem; line-height: 1; }
.hero-logo-name { display: block; font-size: clamp(3.2rem, 7vw, 5rem); font-weight: 800; letter-spacing: -0.04em; color: var(--ink); }
.hero-logo-name b { color: var(--brand); font-weight: 800; }
.hero-logo-sub { display: block; margin-top: .5rem; font-size: clamp(.9rem, 1.4vw, 1.05rem); color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
