/* =====================================================================
   Web Vision S.r.l. - Foglio di stile
   Palette: blu primario (coerente con il logo), navy per le sezioni scure,
   verde del logo come accento secondario.
   ===================================================================== */

:root {
  --blue:        #1d63d6;
  --blue-dark:   #154aa3;
  --blue-light:  #e8f0fc;
  --navy:        #0f1f3d;
  --navy-2:      #16294f;
  --green:       #6cb33f;
  --ink:         #1b2432;
  --muted:       #5b6678;
  --line:        #e3e8ef;
  --bg:          #ffffff;
  --bg-alt:      #f5f7fb;
  --radius:      14px;
  --shadow:      0 10px 30px rgba(15, 31, 61, .08);
  --shadow-lg:   0 24px 60px rgba(15, 31, 61, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cc-black: #111111;
  --cc-blue:  #1d63d6;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.65;
  color: var(--ink); background: var(--bg);
}
body.cc-open { overflow: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.container { width: min(1140px, 100% - 2rem); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--blue); color: #fff; padding: .5rem 1rem; border-radius: 6px; z-index: 1000; }
.skip-link:focus { left: 8px; }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.6rem; border-radius: 999px; font-weight: 600; font-size: 1rem;
  border: 2px solid transparent; cursor: pointer; transition: .2s; text-decoration: none !important;
  font-family: inherit;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(29, 99, 214, .3); }
.btn-outline { border-color: #fff; color: #fff; background: transparent; }
.btn-outline:hover { background: rgba(255,255,255,.12); }
.btn-sm { padding: .6rem 1.2rem; font-size: .95rem; }
.btn:disabled { opacity: .6; cursor: wait; transform: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid transparent; transition: .25s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 2px 14px rgba(15,31,61,.06); }
.nav-wrap { display: flex; align-items: center; justify-content: space-between; padding: .8rem 0; gap: 1rem; }
.brand img { width: 180px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav a { color: var(--ink); font-weight: 500; }
.site-nav a:not(.btn):hover { color: var(--blue); text-decoration: none; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; padding: 8px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); display: none; padding: .5rem 1rem 1rem;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: .8rem .5rem; border-bottom: 1px solid var(--line); }
  .site-nav a.btn { margin-top: .75rem; border: 0; }
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 600px at 85% -10%, #2a63c7 0%, transparent 60%),
              linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: clamp(4rem, 9vw, 7.5rem) 0; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: auto -10% -40% auto; width: 60vw; max-width: 760px; aspect-ratio: 1;
  border-radius: 50%; background: radial-gradient(circle, rgba(108,179,63,.22), transparent 65%); pointer-events: none;
}
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; position: relative; }
.hero .eyebrow { display: inline-block; font-size: .85rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #9cc5ff; margin-bottom: 1rem; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: normal; color: #9cc5ff; }
.hero p.lead { font-size: 1.2rem; color: #c9d5ea; max-width: 54ch; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-card {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius);
  padding: 1.75rem; backdrop-filter: blur(6px);
}
.hero-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.hero-card li { display: flex; gap: .8rem; align-items: flex-start; color: #e3ebf8; }
.hero-card li svg { flex: none; margin-top: .2rem; color: var(--green); }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } }

/* ---------- Sezioni ---------- */
.section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 680px; margin-bottom: 2.5rem; }
.section-head .eyebrow { color: var(--blue); font-weight: 700; font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; display: block; margin-bottom: .5rem; }
.section-head p { color: var(--muted); font-size: 1.08rem; }

/* Servizi */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.75rem;
  transition: .25s; position: relative;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }
.card .icon {
  width: 52px; height: 52px; border-radius: 12px; background: var(--blue-light); color: var(--blue);
  display: grid; place-items: center; margin-bottom: 1.1rem;
}
.card h3 { margin-bottom: .5rem; }
.card p { color: var(--muted); margin: 0; font-size: 1rem; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

/* Metodo */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: step; }
.step { position: relative; padding-top: .5rem; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-size: 2.6rem; font-weight: 800; color: var(--blue-light); line-height: 1; display: block; margin-bottom: .5rem;
}
.step h3 { font-size: 1.1rem; }
.step p { color: var(--muted); font-size: .98rem; margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: repeat(2, 1fr); } }

/* Chi siamo */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.about-grid p { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.5rem 1.2rem; text-align: center; }
.stat strong { display: block; font-size: 2rem; color: #9cc5ff; line-height: 1.1; }
.stat span { font-size: .9rem; color: #c9d5ea; }
.checklist { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; gap: .6rem; }
.checklist li { padding-left: 1.8rem; position: relative; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .45em; width: 1rem; height: 1rem; border-radius: 50%; background: var(--green); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/70% no-repeat, linear-gradient(#000,#000); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/70% no-repeat; background: var(--green); }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }

/* CTA band */
.cta-band { background: linear-gradient(90deg, var(--blue) 0%, var(--blue-dark) 100%); color: #fff; padding: 3rem 0; }
.cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0; font-size: 1.6rem; }
.cta-band .btn-primary { background: #fff; color: var(--blue); }
.cta-band .btn-primary:hover { background: #f0f4ff; }

/* ---------- Contatti ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 3rem; align-items: start; }
.contact-info .item { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.contact-info .item .icon { flex: none; width: 46px; height: 46px; border-radius: 12px; background: var(--blue-light); color: var(--blue); display: grid; place-items: center; }
.contact-info .item h3 { font-size: 1rem; margin-bottom: .2rem; }
.contact-info .item p { margin: 0; color: var(--muted); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: .35rem; }
.field label .req { color: #d23f3f; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); transition: .15s;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(29,99,214,.12); }
.field .is-invalid { border-color: #d23f3f; }
.field textarea { min-height: 140px; resize: vertical; }
.field-error { color: #d23f3f; font-size: .85rem; min-height: 1.2em; display: block; margin-top: .25rem; }
.field-check { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; color: var(--muted); margin-bottom: .75rem; }
.field-check input { margin-top: .3rem; width: 18px; height: 18px; flex: none; accent-color: var(--blue); }
.hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }
.form-status { margin-top: 1rem; padding: .9rem 1rem; border-radius: 10px; font-weight: 500; display: none; }
.form-status.is-success { display: block; background: #e8f7e4; color: #26601a; border: 1px solid #b9e3ad; }
.form-status.is-error { display: block; background: #fdecec; color: #8f1f1f; border: 1px solid #f3bcbc; }
.form-note { font-size: .85rem; color: var(--muted); margin: 1rem 0 0; }
@media (max-width: 820px) { .contact-grid, .form-row { grid-template-columns: 1fr; } }

/* Dati societari */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { padding: .8rem .5rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { width: 40%; color: var(--muted); font-weight: 600; font-size: .95rem; }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: 0; }
@media (max-width: 600px) { .data-table th, .data-table td { display: block; width: 100%; padding: .3rem 0; } .data-table td { padding-bottom: .8rem; } }

/* ---------- Pagine legali ---------- */
.legal { padding: 3.5rem 0 5rem; }
.legal .container { max-width: 820px; }
.legal h1 { margin-bottom: .25rem; }
.legal .updated { color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }
.legal h2 { font-size: 1.4rem; margin-top: 2.2rem; }
.legal h3 { font-size: 1.1rem; margin-top: 1.5rem; }
.legal table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1rem 0 1.5rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: .6rem .7rem; text-align: left; vertical-align: top; }
.legal th { background: var(--bg-alt); }
.legal .box { background: var(--bg-alt); border-left: 4px solid var(--blue); padding: 1rem 1.2rem; border-radius: 8px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #c9d5ea; padding: 3.5rem 0 1.5rem; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 2.5rem; }
.footer-logo { background: #fff; padding: .5rem .7rem; border-radius: 8px; margin-bottom: 1rem; }
.footer-tagline { max-width: 36ch; }
.site-footer h3 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .6rem; }
.site-footer a { color: #fff; }
.footer-links a { display: block; margin-bottom: .3rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 2.5rem; padding-top: 1.25rem; font-size: .85rem; color: #8fa0c0; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; } }

/* ---------- Animazioni ---------- */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
html.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } }

/* =====================================================================
   COOKIE BANNER - sfondo nero, testo bianco, pulsanti blu
   ===================================================================== */
.cc-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 9000; }
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9001;
  background: var(--cc-black); color: #fff; border-top: 3px solid var(--cc-blue);
  box-shadow: 0 -10px 40px rgba(0,0,0,.35);
  animation: cc-up .35s ease;
}
@keyframes cc-up { from { transform: translateY(100%); } to { transform: none; } }
.cc-banner-inner { width: min(1140px, 100% - 2rem); margin: 0 auto; padding: 1.4rem 0; display: flex; gap: 2rem; align-items: center; }
.cc-text { flex: 1; }
.cc-text h2 { color: #fff; font-size: 1.15rem; margin-bottom: .35rem; }
.cc-text p { margin: 0; font-size: .92rem; color: #d9d9d9; line-height: 1.55; }
.cc-text a { color: #fff; text-decoration: underline; }
.cc-actions { display: flex; flex-direction: column; gap: .6rem; flex: none; min-width: 190px; }
.cc-btn {
  font: inherit; font-weight: 600; font-size: .95rem; padding: .7rem 1.3rem; border-radius: 8px; cursor: pointer;
  border: 2px solid var(--cc-blue); background: var(--cc-blue); color: #fff; transition: .15s; white-space: nowrap;
}
.cc-btn:hover { background: #164fb0; border-color: #164fb0; }
.cc-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.cc-btn-outline { background: transparent; color: #fff; }
.cc-btn-outline:hover { background: rgba(29,99,214,.25); }
@media (max-width: 760px) {
  .cc-banner-inner { flex-direction: column; align-items: stretch; gap: 1rem; padding: 1.1rem 0; }
  .cc-actions { flex-direction: row; flex-wrap: wrap; }
  .cc-actions .cc-btn { flex: 1 1 45%; }
}

/* Modale preferenze */
.cc-modal { position: fixed; inset: 0; z-index: 9002; display: grid; place-items: center; padding: 1rem; }
.cc-modal[hidden] { display: none; }
.cc-modal-box {
  background: var(--cc-black); color: #fff; width: min(620px, 100%); max-height: 90vh; overflow: auto;
  border-radius: 14px; padding: 1.5rem 1.75rem; border: 1px solid #333; box-shadow: 0 30px 80px rgba(0,0,0,.5);
}
.cc-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.cc-modal-head h2 { color: #fff; font-size: 1.3rem; margin: 0; }
.cc-close { background: none; border: 0; color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer; padding: .2rem .5rem; border-radius: 6px; }
.cc-close:hover { background: #2a2a2a; }
.cc-modal-intro { font-size: .92rem; color: #d9d9d9; }
.cc-cat { border-top: 1px solid #2e2e2e; padding: 1rem 0; }
.cc-cat-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .3rem; }
.cc-cat p { margin: 0; font-size: .88rem; color: #bdbdbd; }
.cc-always { font-size: .8rem; color: #9cc5ff; font-weight: 600; }
.cc-switch { position: relative; width: 48px; height: 26px; flex: none; }
.cc-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.cc-slider { position: absolute; inset: 0; background: #444; border-radius: 26px; cursor: pointer; transition: .2s; }
.cc-slider::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.cc-switch input:checked + .cc-slider { background: var(--cc-blue); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(22px); }
.cc-switch input:focus-visible + .cc-slider { outline: 3px solid #fff; outline-offset: 2px; }
.cc-modal-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.25rem; }
.cc-modal-actions .cc-btn { flex: 1 1 30%; }
.cc-modal-foot { font-size: .8rem; color: #9a9a9a; margin: 1rem 0 0; }
.cc-modal-foot a { color: #fff; }

/* Pulsante di richiamo in basso a destra */
.cc-float {
  position: fixed; right: 18px; bottom: 18px; z-index: 8000;
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--cc-blue);
  background: var(--cc-black); color: #fff; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); transition: .2s;
}
.cc-float:hover { background: var(--cc-blue); transform: scale(1.06); }
.cc-float[hidden] { display: none; }
