/* Solverings — web app: home e "Prova la diagnosi".
   Le pagine legali restano su style.css: sono documenti, non vetrine.
   Solo font di sistema (il sito dichiara di non usare servizi di terzi:
   caricare i font da Google lo contraddirebbe). Chiaro/scuro seguono il
   telefono, come l'app. */

:root {
  --navy: #12245f;
  --blue: #1668ff;
  --blue2: #0b4fd6;
  --ink: #15171c;
  --ink2: #535b67;
  --line: #e3e7ee;
  --bg: #ffffff;
  --bg2: #f4f7fc;
  --card: #ffffff;
  --ok: #1f7a3f;
  --warn: #a3470b;
  --warnbg: #fff3e8;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(18, 36, 95, 0.10);
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef1f6;
    --ink2: #a7afbd;
    --line: #2a313d;
    --bg: #0e1116;
    --bg2: #151a22;
    --card: #171c25;
    --warnbg: #3a2414;
    --warn: #ffb37a;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- barra ---------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.bar .brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; }
.bar .brand img { width: 30px; height: 30px; border-radius: 7px; background: #fff; }
.bar nav { display: flex; gap: 6px; align-items: center; }
.bar nav a { color: #d9deea; text-decoration: none; font-size: 14.5px; padding: 8px 10px; border-radius: 10px; }
.bar nav a:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.bar nav a.cta { background: var(--blue); color: #fff; font-weight: 700; }
.bar nav a.cta:hover { background: var(--blue2); }
@media (max-width: 640px) { .bar nav a.hide-sm { display: none; } }

/* ---------- pulsanti (stessa regola dell'app) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 14px;
  font-size: 16.5px; font-weight: 800; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; font-family: inherit;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue2); }
.btn-outline { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn[disabled] { opacity: 0.55; cursor: default; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(22, 104, 255, 0.18), transparent 60%),
    radial-gradient(900px 400px at -10% 110%, rgba(18, 36, 95, 0.16), transparent 60%),
    var(--bg2);
  padding: 56px 20px 64px;
}
.hero-in { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5.4vw, 58px); line-height: 1.05; margin: 0 0 16px; letter-spacing: -0.02em; }
.hero h1 .ings { color: var(--blue); }
.hero p.lead { font-size: clamp(17px, 2vw, 20px); color: var(--ink2); margin: 0 0 26px; max-width: 36ch; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero .badge { display: inline-block; margin-top: 18px; font-size: 14px; color: var(--ink2); }
.hero-logo {
  justify-self: center; width: min(400px, 80vw); aspect-ratio: 1;
  border-radius: 32px; background: #fff; box-shadow: var(--shadow);
  display: grid; place-items: center; padding: 22px;
  animation: float 6s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero .actions { justify-content: center; }
  .hero-logo { order: -1; width: min(260px, 70vw); }
}

/* ---------- sezioni ---------- */
section { padding: 64px 20px; }
.in { max-width: 1120px; margin: 0 auto; }
.kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 12.5px; font-weight: 800; color: var(--blue); margin: 0 0 8px; }
h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.01em; }
.sub { color: var(--ink2); font-size: 17px; max-width: 62ch; margin: 0 0 28px; }

.mission {
  font-family: Georgia, "Times New Roman", serif; font-style: italic;
  font-size: clamp(18px, 2.1vw, 22px); line-height: 1.6; text-align: center;
  max-width: 880px; margin: 0 auto; color: var(--ink);
}
.mission b { font-style: normal; color: var(--blue); }

/* le tre schede storiche, con le loro foto */
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.tile img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.tile .t { padding: 18px 20px 22px; }
.tile h3 { margin: 0 0 6px; font-size: 19px; }
.tile p { margin: 0; color: var(--ink2); font-size: 15.5px; }
@media (max-width: 900px) { .trio { grid-template-columns: 1fr; } .tile { flex-direction: row; } .tile img { width: 38%; aspect-ratio: auto; } }
@media (max-width: 560px) { .tile { flex-direction: column; } .tile img { width: 100%; aspect-ratio: 16 / 9; } }

/* le funzioni nuove */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }
.feat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feat .ic { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: rgba(22, 104, 255, 0.12); color: var(--blue); margin-bottom: 12px; }
.feat h3 { margin: 0 0 6px; font-size: 18px; }
.feat p { margin: 0; color: var(--ink2); font-size: 15px; }
.feat .tag { display: inline-block; margin-top: 10px; font-size: 12.5px; font-weight: 700; color: var(--ink2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }

.alt { background: var(--bg2); }

/* come funziona */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; padding: 22px 22px 22px 70px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 20px; top: 20px; width: 36px; height: 36px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 800; display: grid; place-items: center; }
.step h3 { margin: 0 0 4px; font-size: 17px; }
.step p { margin: 0; color: var(--ink2); font-size: 15px; }

/* motto */
.statement { text-align: center; }
.statement .no { font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; margin: 0 0 12px; }
.statement .yes { font-size: clamp(22px, 3vw, 32px); font-weight: 900; line-height: 1.25; margin: 0; }
.statement .ings { color: var(--blue); }

/* novità */
.future { background: linear-gradient(135deg, #0e1a44, #12245f 55%, #1648c8); color: #fff; }
.future h2, .future .sub { color: #fff; }
.future .sub { opacity: 0.85; }
.future .feat { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.14); }
.future .feat p { color: #d7def0; }
.future .feat .ic { background: rgba(255, 255, 255, 0.14); color: #fff; }
.future .feat .tag { color: #d7def0; border-color: rgba(255, 255, 255, 0.25); }

.safety { border-left: 4px solid var(--warn); background: var(--warnbg); border-radius: 12px; padding: 14px 18px; color: var(--ink); font-size: 15px; }

footer { padding: 40px 20px 60px; border-top: 1px solid var(--line); }
footer .in { display: grid; gap: 18px; }
footer .links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
footer .links a { color: var(--ink2); text-decoration: none; font-size: 14.5px; }
footer .links a:hover { color: var(--blue); }
footer small { color: var(--ink2); }

/* ---------- prova la diagnosi ---------- */
.try { max-width: 760px; margin: 0 auto; padding: 36px 20px 70px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.drop {
  border: 2px dashed var(--line); border-radius: 16px; min-height: 220px;
  display: grid; place-items: center; text-align: center; cursor: pointer; padding: 18px;
  color: var(--ink2); position: relative; overflow: hidden;
}
.drop:hover, .drop.over { border-color: var(--blue); color: var(--blue); }
.drop img { max-height: 320px; border-radius: 12px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
label.lbl { display: block; font-weight: 800; margin: 18px 0 8px; }
textarea {
  width: 100%; min-height: 110px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); padding: 12px 14px; font: inherit; font-size: 16px; resize: vertical;
}
.row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.row .btn { flex: 1 1 220px; }
.hint { color: var(--ink2); font-size: 13.5px; margin: 10px 0 0; }
.err { color: #c62828; font-weight: 700; margin: 14px 0 0; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.result h2 { font-size: 26px; margin: 26px 0 6px; }
.result .conf { font-size: 13.5px; color: var(--ink2); }
.result h3 { margin: 22px 0 8px; font-size: 18px; }
.result ol { padding-left: 22px; margin: 0; }
.result ol li { margin: 0 0 12px; }
.result ol li b { display: block; }
.result .warn { display: block; margin-top: 6px; color: var(--warn); font-weight: 700; font-size: 14.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14.5px; text-decoration: none; color: var(--ink); }
a.chip:hover { border-color: var(--blue); color: var(--blue); }
.aff { color: var(--ink2); font-size: 12.5px; margin-top: 8px; }
.nextbox { margin-top: 26px; padding: 18px; border-radius: 16px; background: var(--bg2); }
.nextbox p { margin: 0 0 12px; }

/* ---------- Novità: "Mi interessa" e lista d'attesa (novita.js) ---------- */
.nv-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.nv-like {
  flex: 1; min-height: 46px; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 800; font-size: 15.5px;
  background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, 0.45);
}
.nv-like.on { background: #fff; color: #12245f; border-color: #fff; }
.nv-count { min-width: 64px; text-align: center; padding: 10px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-weight: 800; }
.nv-mail { margin-top: 12px; }
.nv-mail summary { cursor: pointer; color: #cfe0ff; font-weight: 700; font-size: 14.5px; }
.nv-mail form { display: grid; gap: 10px; margin-top: 10px; }
.nv-mail input[type=email] { min-height: 46px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.25); color: #fff; padding: 0 12px; font: inherit; font-size: 16px; }
.nv-consent { font-size: 13.5px; color: #d7def0; line-height: 1.45; }
.nv-consent a { color: #fff; }
.nv-msg { margin: 0; font-size: 14px; color: #ffd2c2; }
.nv-msg.ok { color: #b8f5c8; font-weight: 700; }

/* ---------- 3D (assets/3d/solverings3d.js) ----------
   Il contenuto 2D (.s3d-alt) resta nella pagina: si nasconde solo quando la
   scena è davvero partita (.s3d-on). Senza WebGL, con poca potenza o con
   "riduci movimento" si vede quello, e nient'altro cambia. */
.s3d-host { position: relative; }
.s3d-host.s3d-on > .s3d-alt { visibility: hidden; }
.hero-logo.s3d-on { background: transparent; box-shadow: none; animation: none; padding: 0; }
.hero-logo.s3d-host { cursor: grab; }
@media (min-width: 861px) { .hero-logo.s3d-host { width: min(480px, 42vw); } }

.showroom { position: relative; height: clamp(360px, 52vw, 480px); border-radius: 22px; overflow: hidden; margin: 6px 0 22px; border: 1px solid rgba(255, 255, 255, 0.14); display: none; }
.showroom.s3d-live { display: block; background: radial-gradient(120% 90% at 50% 35%, #1d3c94 0%, #0d1a46 55%, #070d24 100%); }
.showroom.s3d-fallback { display: none !important; }
.showroom-tip { position: absolute; top: 12px; left: 14px; z-index: 2; font-size: 13px; color: #cfe0ff; background: rgba(7, 13, 36, 0.55); padding: 6px 10px; border-radius: 999px; pointer-events: none; }

.scanbox { position: relative; height: 240px; border-radius: 16px; overflow: hidden; margin-top: 16px;
  background: radial-gradient(120% 90% at 50% 40%, #1d3c94 0%, #0d1a46 60%, #070d24 100%); }
.scanbox .s3d-alt { position: absolute; inset: 0; display: grid; place-items: center; color: #cfe0ff; font-weight: 700; }
.scanbox .scan-label { position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; color: #dfe8ff; font-weight: 700; font-size: 14px; z-index: 2; pointer-events: none; }

/* ---------- Chiedi all'esperto (esperto.js) ---------- */
.chat { display: flex; flex-direction: column; gap: 12px; }
.chat .log { min-height: 320px; max-height: 60vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px; }
.msg { max-width: 86%; padding: 12px 14px; border-radius: 16px; white-space: pre-wrap; line-height: 1.5; font-size: 16px; }
.msg.me { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--bg2); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg .label { font-weight: 800; font-size: 13px; margin-top: 10px; color: var(--ink2); }
.msg .chips { margin-top: 6px; }
.composer { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { min-height: 52px; flex: 1; }
.composer .btn { flex: 0 0 auto; }
.chat-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.linkbtn { background: none; border: 0; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0; }

/* ---------- "Usala subito": riquadri che portano dentro l'app ---------- */
a.feat.go { text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .15s ease, border-color .15s ease; }
a.feat.go:hover { transform: translateY(-2px); border-color: var(--blue); }
a.feat.go .go-arrow { margin-top: auto; padding-top: 12px; color: var(--blue); font-weight: 800; font-size: 15px; }
