/* Studio Servolini — stile "Contemporanea": ardesia + ottanio, font di sistema. */
:root {
  --ink: #1f2a33;
  --text: #2b3640;
  --muted: #4b5964;
  --accent: #0f6e6e;
  --accent-dark: #0a5454;
  --accent-soft: #e3efee;
  --mint: #7fd0c8;
  --bg: #fff;
  --bg-alt: #f5f8f9;
  --line: #e1e7eb;
  --radius: 14px;
  --radius-sm: 10px;
  --wrap: 2160px;
  /* margine esterno + margine interno del pannello scuro: tutto il testo parte dalla stessa linea */
  --edge: clamp(12px, 1.6vw, 28px);
  --inset: clamp(28px, 5vw, 96px);
  --shadow: 0 1px 2px rgba(31, 42, 51, .06), 0 8px 24px rgba(31, 42, 51, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--text); background: var(--bg); overflow-wrap: break-word; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { color: var(--ink); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.4rem); font-weight: 750; letter-spacing: -.03em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.15rem); font-weight: 720; }
h3 { font-size: 1.12rem; font-weight: 680; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul { padding-left: 1.2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 calc(var(--edge) + var(--inset)); }
.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 { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip:focus { top: 12px; color: #fff; }
.muted { color: var(--muted); }

/* Fase di test */
.testbar { background: #fff4c2; color: #4a3b00; font-size: 14px; text-align: center; padding: 7px 16px; line-height: 1.4; }
.tbd { display: inline-block; font: 700 10.5px/1 var(--font); letter-spacing: .06em; padding: 3px 5px; border-radius: 4px; background: #ffe14d; color: #222; vertical-align: middle; margin-left: 6px; position: relative; top: -1px; }

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 22px; border-radius: var(--radius-sm); border: 0; background: var(--accent); color: #fff; font: 650 16px/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s, transform .15s; }
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn-soft { background: #edf2f4; color: var(--ink); }
.btn-soft:hover { background: #e1e9ec; color: var(--ink); }
.btn-sm { min-height: 42px; padding: 0 16px; font-size: 15px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(255, 255, 255, .82); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); } }
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 4px 18px rgba(31, 42, 51, .05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 46px; height: 46px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 18.5px; letter-spacing: -.015em; }
.brand-text span { font-size: 13.5px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { color: var(--text); text-decoration: none; font-size: 15.5px; padding: 10px 12px; border-radius: 8px; }
.nav a:not(.btn):hover { background: var(--bg-alt); color: var(--ink); }
.nav .btn { margin-left: 8px; }
.nav-toggle { display: none; }

@media (max-width: 960px) {
  .nav-toggle { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
  .nav-toggle .bars, .nav-toggle .bars::before, .nav-toggle .bars::after { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: transform .2s, background-color .2s; }
  .nav-toggle .bars::before, .nav-toggle .bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle .bars::before { top: -6px; }
  .nav-toggle .bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bars::after { transform: translateY(-6px) rotate(-45deg); }
  .js .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 2px; padding: 10px 16px 18px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 16px 30px rgba(31, 42, 51, .1); }
  .js .nav.open { display: flex; }
  .js .nav a:not(.btn) { padding: 13px 12px; font-size: 17px; }
  .js .nav .btn { margin: 8px 0 0; }
  /* Senza JS il menu resta visibile, su più righe */
  .no-js .site-header { position: static; }
  .no-js .header-inner { flex-wrap: wrap; padding-block: 10px; }
  .no-js .nav { flex-wrap: wrap; margin-left: -12px; }
  .no-js .nav-toggle { display: none; }
}

/* Sezioni */
section { padding: 80px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: 18px; margin: 0; }
.kicker { display: inline-block; font-size: 13.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }

/* Hero: pannello scuro con foto e scorciatoie */
.hero { padding: 20px 0 0; }
.hero .wrap { padding: 0 var(--edge); }
.hero-panel { background: var(--ink); color: #c9d4db; border-radius: 26px; padding: clamp(40px, 4.5vw, 80px) var(--inset) clamp(32px, 3vw, 48px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.hero-grid > *, .footer-grid > *, .contact-grid > *, .about-grid > * { min-width: 0; }
h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }
.hero .kicker { color: var(--mint); }
.hero h1 { color: #fff; }
.hero h1 span { color: var(--mint); }
.hero .lead { font-size: clamp(1.08rem, 1rem + .4vw, 1.25rem); color: #c9d4db; max-width: 32em; margin-bottom: 30px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.btn-outline { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); }
.btn-outline:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.hero-meta { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15.5px; }
.hero-meta li { display: flex; align-items: flex-start; gap: 10px; }
.hero-meta svg { width: 18px; height: 18px; flex: none; color: var(--mint); margin-top: 3px; }
.hero-meta a { color: #fff; }
.hero-meta a:hover { color: var(--mint); }
.hero :focus-visible { outline-color: var(--mint); }

/* Foto (repertorio in test) */
.photo { position: relative; margin: 0; border-radius: 18px; overflow: hidden; background: #3a4852; aspect-ratio: 4 / 5; }
.photo picture { display: contents; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.stock::after { content: "FOTO DI REPERTORIO — DA SOSTITUIRE"; position: absolute; left: 12px; bottom: 12px; width: max-content; max-width: calc(100% - 24px); background: rgba(0, 0, 0, .74); color: #fff; font: 700 11.5px/1.3 var(--font); letter-spacing: .05em; padding: 7px 9px; border-radius: 5px; }

/* Di cosa hai bisogno (dentro il pannello) */
.needs { margin-top: 44px; padding-top: 32px; border-top: 1px solid rgba(255, 255, 255, .12); }
.needs h2 { color: #fff; font-size: 1.25rem; margin-bottom: 16px; }
.needs-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.needs-grid a { display: flex; align-items: center; gap: 12px; height: 100%; min-height: 58px; padding: 12px 16px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .13); color: #fff; text-decoration: none; font-weight: 600; line-height: 1.3; transition: background-color .15s, border-color .15s; }
.needs-grid a:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); color: #fff; }
.needs-grid a::after { content: "→"; margin-left: auto; color: var(--mint); font-weight: 700; }
.needs-grid svg { width: 21px; height: 21px; flex: none; color: var(--mint); }

/* Servizi: schede brevi */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; scroll-margin-top: calc(var(--header-h) + 20px); transition: border-color .2s, box-shadow .2s; }
.card:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card .ico { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 14px; }
.card .ico svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: 4px; }
.card p { color: var(--muted); font-size: 15.5px; line-height: 1.5; margin: 0; }
.cards-note { margin: 18px 0 0; color: var(--muted); font-size: 15px; }

/* Come lavoriamo: striscia scura sotto i servizi */
.steps { list-style: none; margin: 40px 0 0; padding: 22px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; background: var(--ink); border-radius: var(--radius); color: #c9d4db; font-size: 15.5px; line-height: 1.45; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 36px 1fr; column-gap: 12px; align-items: start; }
.steps li::before { content: counter(step); grid-row: span 2; width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 750; }
.steps strong { color: #fff; display: block; }

/* Lo studio */
.about-grid { display: grid; grid-template-columns: minmax(0, 480px) 1fr; gap: clamp(40px, 5vw, 96px); align-items: center; }
.about-grid p { max-width: 62ch; }
.about-grid .photo { aspect-ratio: 1 / 1; }
.facts { list-style: none; padding: 0; margin: 22px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.facts li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 15px; color: var(--muted); line-height: 1.35; }
.facts strong { display: block; color: var(--ink); font-size: 16.5px; margin-bottom: 2px; }

/* Documenti utili: schede apribili */
.docs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
.doc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.doc summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 20px 22px; font-weight: 650; color: var(--ink); }
.doc summary::-webkit-details-marker { display: none; }
.doc summary > svg { width: 22px; height: 22px; color: var(--accent); flex: none; }
.doc summary::after, .faq-list summary::after { content: ""; flex: none; margin-left: auto; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft) no-repeat center / 14px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1v12M1 7h12' stroke='%230f6e6e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); transition: transform .2s; }
.doc[open] summary::after, .faq-list details[open] summary::after { transform: rotate(45deg); }
.checklist { list-style: none; padding: 0 22px 22px; margin: 0; }
.checklist li { position: relative; padding-left: 28px; font-size: 15.5px; color: var(--text); }
.checklist li + li { margin-top: 8px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: 4px; width: 17px; height: 17px; border-radius: 5px; border: 2px solid var(--accent); }
.checklist li::after { content: ""; position: absolute; left: 5.5px; top: 7px; width: 5px; height: 9px; border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* FAQ */
.faq-list { max-width: 820px; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 4px; font-weight: 650; color: var(--ink); font-size: 17.5px; line-height: 1.35; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list details p { margin: 0 4px 22px; color: var(--muted); max-width: 70ch; }

/* Contatti */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 4px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.contact-list svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: 2px; }
.contact-list .lbl { display: block; font-size: 13.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.contact-list a, .contact-list .val { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.contact-list a:hover { color: var(--accent); text-decoration: underline; }
.area { color: var(--muted); font-size: 15px; margin: 0; }
.hours { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.hours th { text-align: left; vertical-align: top; font-weight: 600; color: var(--ink); padding: 3px 16px 3px 0; white-space: nowrap; }
.hours td { color: var(--muted); padding: 3px 0; }

.form { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 30px; box-shadow: var(--shadow); }
.form h3 { margin-bottom: 4px; }
.form > p { color: var(--muted); font-size: 15.5px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-weight: 600; font-size: 15px; color: var(--ink); margin-bottom: 6px; }
label .opt { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1.5px solid #c9d3d9; border-radius: var(--radius-sm); padding: 12px 14px; min-height: 50px; }
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.invalid, [aria-invalid="true"] { border-color: #b3261e; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; color: var(--muted); }
.check input { width: 22px; height: 22px; min-height: 0; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.check.invalid { color: #b3261e; }
.no-js .form-js { display: none; }
.form-status { margin: 14px 0 0; font-size: 15.5px; color: #b3261e; }
.form-status:empty { display: none; }
.form-status.ok { color: var(--ink); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; }

/* Footer */
.site-footer { background: var(--ink); color: #c4cfd6; padding: 56px 0 28px; font-size: 15px; }
.site-footer a { color: #fff; overflow-wrap: anywhere; }
.site-footer a:hover { color: #7fd0c8; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; margin-bottom: 36px; }
.footer-grid h2 { color: #fff; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.footer-grid p { margin: 0 0 8px; line-height: 1.55; }
.footer-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; color: #fff; }
.footer-brand img { width: 88px; height: 88px; }
.footer-brand strong { font-size: 18px; }
.footer-small { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 22px; font-size: 14px; }

/* Barra fissa su mobile */
.mobile-bar { display: none; }
@media (max-width: 760px) {
  /* nascosta = anche non raggiungibile con Tab (visibility) */
  .mobile-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(31, 42, 51, .08); transform: translateY(110%); visibility: hidden; transition: transform .25s, visibility 0s .25s; }
  .mobile-bar.show { transform: none; visibility: visible; transition: transform .25s; }
  /* lo scroll verso un elemento lascia spazio alla barra fissa in basso */
  html { scroll-padding-bottom: 88px; }
  .mobile-bar .btn { min-height: 48px; }
  .no-js .mobile-bar { display: none; }
}

/* Pagine legali */
.legal { padding: 56px 0 80px; }
.legal .wrap > * { max-width: 820px; }
.legal h2 { font-size: 1.4rem; margin-top: 2em; }
.legal h3 { margin-top: 1.4em; }
.legal dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.legal dt { font-weight: 650; color: var(--ink); }
.legal dd { margin: 0; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.legal dt { min-width: 0; }
.note { background: #fff4c2; color: #4a3b00; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 15.5px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Schermi larghi: usare lo spazio in orizzontale */
@media (min-width: 1100px) {
  .split { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 56px; align-items: start; }
  .split .section-head { margin-bottom: 0; position: sticky; top: calc(var(--header-h) + 24px); }
  .split .faq-list { max-width: none; }
}
@media (min-width: 1280px) {
  .hero-grid { grid-template-columns: 1fr 1fr; gap: clamp(56px, 5vw, 96px); }
  .photo-hero { aspect-ratio: 16 / 11; }
  .hero h1 { font-size: clamp(3rem, 1.2rem + 2.6vw, 4.2rem); }
  .hero .lead { font-size: 1.3rem; }
}
@media (min-width: 1400px) {
  .needs-grid { grid-template-columns: repeat(6, 1fr); }
  .needs-grid a { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 112px; }
  .needs-grid a::after { margin: auto 0 0; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-panel { padding: 40px 32px 32px; }
  .hero-grid, .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 32px; }
  .photo-hero { aspect-ratio: 16 / 10; }
  .about-grid .photo { aspect-ratio: 16 / 10; max-width: 560px; }
  .cards, .docs, .needs-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .wrap { padding: 0 16px; }
  section { padding: 56px 0; }
  .hero { padding: 12px 0 0; }
  .hero-panel { padding: 30px 20px 22px; border-radius: 20px; margin: 0 -4px; }
  .needs { margin-top: 32px; padding-top: 24px; }
  .docs, .needs-grid, .steps, .facts, .field-row, .footer-grid { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .facts li { padding: 10px; font-size: 13.5px; }
  .facts strong { font-size: 14.5px; }
  /* servizi come elenco compatto: icona a sinistra */
  .cards { grid-template-columns: 1fr; gap: 10px; }
  .card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; }
  .card .ico { margin: 0; flex: none; width: 38px; height: 38px; }
  .actions .btn { flex: 1 1 100%; }
  .form { padding: 22px 18px; }
  .brand-text strong { font-size: 17px; }
  .brand-text span { font-size: 12.5px; }
  .site-footer { padding-bottom: 96px; }
  .legal dl { grid-template-columns: 1fr; gap: 2px; }
  .legal dd { margin-bottom: 10px; }
}
@media (max-width: 360px) {
  .brand img { width: 38px; height: 38px; }
  .brand-text span { display: none; }
}
@media print {
  .site-header, .mobile-bar, .testbar, .form, .needs { display: none; }
  section { padding: 24px 0; }
}
