/* POLARIS — stessi colori dell'app (ui/theme.py) */
:root {
  --bg: #F4F5FB; --panel: #FFFFFF; --ink: #1B1E2E; --muted: #7C829A;
  --line: #E5E7F0; --line2: #CFD3E2; --hover: #EEF0FA;
  --accent: #6366F1; --accent2: #14B8A6; --accent-soft: #ECECFE; --accent-ink: #4F46E5;
  --good: #16A34A; --shadow: 0 10px 30px rgba(30, 34, 80, .10), 0 2px 6px rgba(30, 34, 80, .06);
  --shadow-big: 0 30px 80px rgba(30, 34, 80, .18), 0 6px 18px rgba(30, 34, 80, .08);
  --radius: 18px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F111A; --panel: #171A26; --ink: #E6E8F2; --muted: #8A90A8;
    --line: #262A3A; --line2: #353A4E; --hover: #1F2333;
    --accent: #818CF8; --accent2: #2DD4BF; --accent-soft: #23264A; --accent-ink: #A5B4FC;
    --good: #34C77B; --shadow: 0 10px 30px rgba(0, 0, 0, .35); --shadow-big: 0 30px 80px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F111A; --panel: #171A26; --ink: #E6E8F2; --muted: #8A90A8;
  --line: #262A3A; --line2: #353A4E; --hover: #1F2333;
  --accent: #818CF8; --accent2: #2DD4BF; --accent-soft: #23264A; --accent-ink: #A5B4FC;
  --good: #34C77B; --shadow: 0 10px 30px rgba(0, 0, 0, .35); --shadow-big: 0 30px 80px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.grad {
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.eyebrow {
  display: inline-block; margin-bottom: .9rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent-ink);
}

/* ---------------------------------------------------------------- bottoni */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85em 1.5em; border-radius: 12px; font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, box-shadow .15s, background .15s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, .icon-btn:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn.primary { background: var(--accent); color: #fff; box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.primary:hover { background: var(--accent-ink); }
:root[data-theme="dark"] .btn.primary:hover { background: #6366F1; }
.btn.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn.light { background: #fff; color: #4F46E5; }
.btn.small { padding: .55em 1.1em; font-size: .92rem; }
.btn.full { width: 100%; }
.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.i-sun { display: none; }
:root[data-dark="1"] .i-sun { display: block; }
:root[data-dark="1"] .i-moon { display: none; }

/* ---------------------------------------------------------------- nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.links { display: flex; gap: 6px; margin-left: auto; }
.links a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 12px; border-radius: 10px; }
.links a:hover { color: var(--ink); background: var(--hover); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; padding: 56px 0 40px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
              radial-gradient(closest-side at 30% 70%, color-mix(in srgb, var(--accent2) 18%, transparent), transparent 70%);
  z-index: -1; pointer-events: none;
}
.hero-in { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 40em; }
.lead strong { color: var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li {
  font-size: .85rem; font-weight: 600; color: var(--muted); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}
.hero-art { position: relative; display: grid; justify-items: center; }
#slime { width: min(400px, 82vw); height: auto; aspect-ratio: 1; cursor: pointer; touch-action: manipulation; }
.bubble {
  position: relative; max-width: 290px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 12px 18px; border-radius: 18px; font-weight: 600; text-align: center; margin-bottom: -6px; min-height: 50px;
  transition: opacity .3s, transform .3s;
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; background: var(--panel);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg);
}
.bubble.fade { opacity: 0; transform: translateY(4px); }
.hint { font-size: .82rem; color: var(--muted); margin: 0; }
.h-touch { display: none; }
@media (hover: none) { .h-mouse { display: none; } .h-touch { display: inline; } }

/* ---------------------------------------------------------------- finestre con screenshot */
.window {
  margin: 0; background: var(--panel); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-big);
  border: 1px solid var(--line);
}
.win-bar { display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.win-bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--line2); }
.win-bar em { margin-left: 10px; font-style: normal; font-size: .8rem; color: var(--muted); font-weight: 600; }
.shot-hero { margin-top: 56px; }

/* ---------------------------------------------------------------- sezioni */
section { padding: 96px 0; }
.band { background: var(--panel); border-block: 1px solid var(--line); }
.band .window { background: var(--bg); }
.head { text-align: center; max-width: 720px; margin: 0 auto 48px; }
.sub { color: var(--muted); font-size: 1.08rem; }
.split { display: grid; grid-template-columns: 1fr 1.15fr; gap: 56px; align-items: center; }
.split.reverse > :first-child { order: 2; }
.split p { color: var(--muted); font-size: 1.05rem; }
.split p strong { color: var(--ink); }
.ticks { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.ticks li { position: relative; padding-left: 30px; font-weight: 500; }
.ticks li::before {
  content: ""; position: absolute; left: 0; top: .2em; width: 20px; height: 20px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='10'/%3E%3C/svg%3E");
}
.ticks li::after {
  content: ""; position: absolute; left: 6px; top: calc(.2em + 5px); width: 8px; height: 5px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg);
}

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.feat:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.feat p { color: var(--muted); margin: 0; font-size: .97rem; }
.feat .ico {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; margin-bottom: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent2) 16%, transparent));
}
.band .feat { background: var(--bg); }
.versions .feat { display: flex; flex-direction: column; }
.versions .feat p { margin-bottom: .8em; }
.versions .how { font-size: .9rem; }
.versions .how code { font-size: .85em; }
.versions .btn { margin-top: auto; }
.note { text-align: center; color: var(--muted); font-size: .9rem; margin: 32px auto 0; max-width: 720px; }

.steps { list-style: none; padding: 0; margin: 0 0 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.steps li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.steps p { color: var(--muted); margin: 0; }
.n {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 800;
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 24px; }
.year { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; padding: 40px; }
.year p { color: var(--muted); margin: 0; }
.year h3 { font-size: 1.5rem; }
.year img { border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- prezzi */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-radius: 22px; padding: 32px 28px;
}
.plan .ticks { margin: 20px 0 28px; flex: 1; }
.plan.best { border: 2px solid var(--accent); box-shadow: var(--shadow-big); }
.tag {
  position: absolute; top: -13px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: linear-gradient(120deg, var(--accent), var(--accent2)); color: #fff; font-size: .78rem; font-weight: 700;
  padding: 4px 14px; border-radius: 999px;
}
.price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; margin: 6px 0 0; line-height: 1.1; }
.per { color: var(--muted); font-size: .92rem; margin: 4px 0 0; }

/* ---------------------------------------------------------------- requisiti + faq */
.faq-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; }
.reqs { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.reqs li {
  display: flex; justify-content: space-between; gap: 12px; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 18px;
}
.reqs span { color: var(--muted); text-align: right; }
details { border-bottom: 1px solid var(--line); }
summary {
  list-style: none; cursor: pointer; font-weight: 700; padding: 18px 36px 18px 0; position: relative; border-radius: 6px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 500;
  color: var(--accent-ink); transition: transform .2s;
}
details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
details p { color: var(--muted); margin: 0 0 18px; }

/* ---------------------------------------------------------------- cta finale + footer */
.final { padding: 0; }
.final-in {
  margin-block: 96px; padding: 64px 32px; border-radius: 28px; text-align: center; color: #fff;
  background: linear-gradient(135deg, #6366F1, #14B8A6); box-shadow: var(--shadow-big);
  display: grid; justify-items: center;
}
.final-in img { filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .2)); margin-bottom: 12px; }
.final-in p { opacity: .92; font-size: 1.1rem; max-width: 34em; margin-bottom: 26px; }
.foot { border-top: 1px solid var(--line); padding: 36px 0 44px; }
.foot-in { display: grid; justify-items: center; gap: 6px; text-align: center; }
.foot p { margin: 0; }
.foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin: 10px 0; }
.foot nav a { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .92rem; }
.foot nav a:hover { color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 12px; font-weight: 600; max-width: calc(100% - 32px);
  transition: opacity .25s, transform .25s; z-index: 100; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------------------------- comparsa allo scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- finestra di acquisto */
.checkout {
  width: min(520px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: 22px; padding: 30px 28px 22px;
  background: var(--panel); color: var(--ink); box-shadow: var(--shadow-big);
}
.checkout::backdrop { background: rgba(15, 17, 26, .55); backdrop-filter: blur(4px); }
.checkout h2 { font-size: 1.5rem; margin-bottom: .2em; }
.checkout .eyebrow { margin-bottom: .4rem; }
.co-x { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; }
.co-plan { color: var(--accent-ink); font-weight: 700; margin-bottom: 1em; }
.co-steps { padding-left: 1.3em; margin: 0 0 1.2em; display: grid; gap: .7em; }
.co-steps li { color: var(--muted); }
.co-steps strong { color: var(--ink); }
.co-tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent-ink); border-radius: 6px;
  padding: 0 7px; font-weight: 700;
}
.co-consent {
  display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: .9rem; cursor: pointer;
}
.co-consent input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
#co-go[aria-disabled="true"] { opacity: .45; box-shadow: none; }
.co-note { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; font-size: .88rem; color: var(--muted); }
.co-note strong, .co-note em { color: var(--ink); }
.co-foot { text-align: center; color: var(--muted); font-size: .82rem; margin: 12px 0 0; }

/* ---------------------------------------------------------------- pagine legali */
.legal { padding: 48px 0 80px; }
.legal .wrap { max-width: 800px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.7rem); margin-bottom: .2em; }
.legal h2 { font-size: 1.3rem; margin: 2.2em 0 .6em; }
.legal p, .legal li { color: var(--ink); }
.legal ul { padding-left: 1.3em; }
.legal li { margin-bottom: .4em; }
.legal .updated { color: var(--muted); margin-bottom: 2em; }
.legal .table-wrap { overflow-x: auto; }
.legal table { min-width: 600px; width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .95rem; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.legal th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.todo {
  background: #FFF4E2; color: #8A5A00; border: 1px dashed #E99A2C; border-radius: 6px; padding: 0 6px;
  font-weight: 600;
}
:root[data-dark="1"] .todo { background: #3A2E1A; color: #F0AA45; }
.draft {
  background: #FFF4E2; color: #8A5A00; border: 1px solid #E99A2C; border-radius: 14px; padding: 14px 18px;
  margin-bottom: 2em; font-weight: 500;
}
:root[data-dark="1"] .draft { background: #3A2E1A; color: #F0AA45; }
.back { font-weight: 600; text-decoration: none; }

/* ---------------------------------------------------------------- chi siamo */
.about .lead { font-size: 1.15rem; color: var(--muted); margin-bottom: 2em; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.about .feat h2 { margin: 0 0 .4em; font-size: 1.15rem; }
.about-me {
  margin-top: 2.4em; padding: 4px 28px 22px; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, var(--panel)), color-mix(in srgb, var(--accent2) 8%, var(--panel)));
}
.about-me h2 { margin-top: 1.2em; }
.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; }
.contact {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); min-width: 0;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.contact:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); }
.contact .ico {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent2) 16%, transparent));
}
.contact > span:last-child { display: grid; min-width: 0; }
.contact em { font-style: normal; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .about-me { padding: 4px 20px 18px; }
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .hero-in, .split, .faq-grid, .year { grid-template-columns: 1fr; }
  .split.reverse > :first-child { order: 0; }
  .hero-art { order: -1; }
  .grid, .plans, .steps { grid-template-columns: 1fr 1fr; }
  .plans .plan.best { order: -1; grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .links {
    display: none; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--bg); border-bottom: 1px solid var(--line);
  }
  .links.open { display: flex; }
  .links a { padding: 12px; }
  .menu-btn { display: grid; }
  .nav-right { margin-left: auto; }
  .nav-right .btn { display: none; }
  section { padding: 64px 0; }
  .grid, .grid.three, .plans, .steps { grid-template-columns: 1fr; }
  .year { padding: 24px; }
  .hero { padding-top: 24px; }
  .shot-hero { margin-top: 32px; }
  .final-in { margin-block: 64px; padding: 48px 20px; }
  .reqs li { flex-direction: column; gap: 2px; }
  .reqs span { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .feat { transition: none; }
}
