/* AptaTwin — foglio di stile unico del sito (nessun framework, nessun font esterno).
   Colori presi dall'icona dell'app: navy #0f172a, arancio del prodotto #ea580c,
   blu del gemello digitale #2563eb / #38bdf8. Tema chiaro di default, scuro
   automatico da prefers-color-scheme. */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --text: #0f172a;
    --text-dim: #475569;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, .08);
    --green: #16a34a;
    --accent: #ea580c;
    --sky: #0284c7;
    --navy: #0f172a;
    --danger: #dc2626;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 8px 24px rgba(15, 23, 42, .06);
    --phone-frame: #0f172a;
    --nav-h: 64px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1120;
        --surface: #111a2e;
        --surface-2: #17223a;
        --text: #f1f5f9;
        --text-dim: #cbd5e1;
        --text-muted: #94a3b8;
        --border: #1f2c45;
        --primary: #3b82f6;
        --primary-hover: #60a5fa;
        --primary-soft: rgba(59, 130, 246, .14);
        --green: #22c55e;
        --accent: #fb923c;
        --sky: #38bdf8;
        --danger: #f87171;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
        --phone-frame: #020617;
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 17px;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* ---------- navigazione ---------- */
.site-nav {
    position: sticky; top: 0; z-index: 50;
    height: var(--nav-h);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.2rem; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--text-dim); text-decoration: none; font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-links .lang { font-weight: 600; font-size: .85rem; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.nav-links .btn { color: #fff; }
.nav-hide-sm { display: none; }
@media (min-width: 860px) { .nav-hide-sm { display: inline; } }
.btn-sm { white-space: nowrap; }
.cta-long { display: none; }
@media (min-width: 440px) { .cta-long { display: inline; } .cta-short { display: none; } }
@media (max-width: 439px) { .nav-links { gap: 12px; } }

/* ---------- bottoni ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 22px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
    transition: background .2s, border-color .2s, color .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: .9rem; }

/* ---------- hero ---------- */
.hero { padding: 48px 0 56px; overflow: hidden; }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 72px 0 80px; } .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 56px; } }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2rem, 5.2vw, 3.3rem); line-height: 1.1; letter-spacing: -.025em; margin-bottom: 18px; }
.hero .lead { font-size: 1.15rem; color: var(--text-dim); max-width: 36em; margin-bottom: 28px; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.checks { list-style: none; display: grid; gap: 8px; color: var(--text-dim); font-size: .97rem; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks svg { flex: none; margin-top: 4px; color: var(--accent); }

/* ---------- cornice telefono ---------- */
.phone {
    position: relative; width: 100%; max-width: 290px; margin: 0 auto;
    padding: 10px; border-radius: 42px; background: var(--phone-frame);
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .45), 0 0 0 1px rgba(255, 255, 255, .06) inset;
}
.phone > img, .phone > video, .phone picture img { width: 100%; aspect-ratio: 1170 / 2532; object-fit: cover; border-radius: 32px; background: #e2e8f0; }
.phone > video { aspect-ratio: 780 / 1688; }
.hero .phone { max-width: 300px; }
.hero-visual { position: relative; }
.hero-visual::before {
    content: ""; position: absolute; inset: 8% -10% 0; z-index: -1;
    background: radial-gradient(closest-side, var(--primary-soft), transparent 70%);
}

/* ---------- sezioni ---------- */
section { padding: 64px 0; }
@media (min-width: 900px) { section { padding: 88px 0; } }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 720px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.2; letter-spacing: -.02em; margin-bottom: 12px; }
.section-head p { color: var(--text-dim); font-size: 1.08rem; }

/* problemi */
.cards-3 { display: grid; gap: 18px; }
@media (min-width: 760px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.section-alt .card { background: var(--bg); }
.card .ico { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: 14px; }
.card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.card p { color: var(--text-dim); font-size: .98rem; }

/* funzionalità a righe alterne */
.feature { display: grid; gap: 32px; align-items: center; }
.feature + .feature { margin-top: 72px; }
.feature > *, .hero-grid > *, .contact-grid > * { min-width: 0; }
@media (min-width: 860px) {
    .feature { grid-template-columns: 1fr 1fr; gap: 64px; }
    .feature:nth-child(even) .feature-media { order: -1; }
}
.feature-text .tag { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sky); margin-bottom: 8px; }
.feature-text h3 { font-size: clamp(1.35rem, 2.8vw, 1.8rem); line-height: 1.25; letter-spacing: -.015em; margin-bottom: 12px; }
.feature-text p { color: var(--text-dim); }
.feature-text ul { margin-top: 14px; padding-left: 1.1em; color: var(--text-dim); }
.feature-text li + li { margin-top: 4px; }
.doc-shot { width: 100%; max-width: min(520px, 100%); margin: 0 auto; border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); background: #fff; }

/* cornice browser (screenshot e clip del back office) */
.browser {
    width: 100%; border-radius: 12px; overflow: hidden; background: var(--surface);
    border: 1px solid var(--border); box-shadow: var(--shadow); padding-top: 26px; position: relative;
}
.browser::before {
    content: ""; position: absolute; top: 9px; left: 12px; width: 8px; height: 8px; border-radius: 50%;
    background: #f87171; box-shadow: 14px 0 0 #fbbf24, 28px 0 0 #34d399;
}
.browser > img, .browser > video { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: #f4f6f9; }
.feature-wide .feature-media { display: grid; gap: 18px; }
@media (min-width: 860px) { .feature-wide { grid-template-columns: 1.25fr .75fr; } }  /* 6ª riga: media a sinistra */
.labels-shot { max-width: 100%; border-radius: 8px; }
.clip-wide { max-width: 920px; margin: 56px auto 0; }
.clip-wide figcaption { text-align: center; margin-top: 14px; font-weight: 600; }
.clip-wide figcaption span { display: block; font-weight: 400; color: var(--text-muted); font-size: .92rem; }
.rules-note { max-width: 720px; margin: 32px auto 0; text-align: center; color: var(--text-muted); font-size: .95rem; }

/* griglia piccola */
.cards-4 { display: grid; gap: 18px; margin-top: 72px; }
@media (min-width: 640px) { .cards-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .cards-4 { grid-template-columns: repeat(4, 1fr); } }

/* clip */
.launch { display: grid; gap: 28px; align-items: center; justify-items: center; max-width: 880px; margin: 0 auto 64px; }
@media (min-width: 760px) { .launch { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 48px; justify-items: start; } }
.launch > * { min-width: 0; }
.launch-video { width: 100%; max-width: 340px; }
.launch-video video { display: block; width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: 22px; background: #0b1220; box-shadow: 0 18px 50px rgba(15, 23, 42, .18); }
.launch-text h3 { font-size: 1.5rem; margin: 0 0 12px; }
.launch-text p { color: var(--text-dim); margin: 0 0 12px; }
.launch-text .launch-note { color: var(--text-muted); font-size: .9rem; margin-bottom: 20px; }
.clips { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.clip figcaption { text-align: center; margin-top: 14px; font-weight: 600; }
.clip figcaption span { display: block; font-weight: 400; color: var(--text-muted); font-size: .92rem; }
.clips .phone { max-width: 240px; }
.feature .phone { max-width: 260px; }

/* per chi */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; max-width: 860px; margin: 0 auto; }
.chips li { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 9px 18px; color: var(--text-dim); font-weight: 500; }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 4px 20px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--text-dim); padding-bottom: 16px; }

/* contatti */
.contact-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: .9fr 1.1fr; gap: 64px; } }
.contact-intro h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); line-height: 1.2; letter-spacing: -.02em; margin-bottom: 14px; }
.contact-intro p { color: var(--text-dim); margin-bottom: 18px; }
.contact-intro .direct { font-size: .97rem; }
form.contact { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.row-2 { display: grid; gap: 16px; }
@media (min-width: 560px) { .row-2 { grid-template-columns: 1fr 1fr; } }
label { display: block; font-size: .92rem; font-weight: 600; }
label > input, label > textarea { display: block; margin-top: 6px; }
label .opt { font-weight: 400; color: var(--text-muted); }
input, textarea {
    font: inherit; font-size: 1rem; color: var(--text); background: var(--bg);
    border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }
textarea { min-height: 120px; resize: vertical; }
.captcha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.captcha input { width: 90px; }
.captcha label { font-size: 1rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.privacy-note { font-size: .85rem; color: var(--text-muted); }
.alert { border-radius: 10px; padding: 12px 14px; font-size: .95rem; }
.alert-ok { background: rgba(22, 163, 74, .12); color: var(--green); border: 1px solid rgba(22, 163, 74, .3); }
.alert-err { background: rgba(220, 38, 38, .1); color: var(--danger); border: 1px solid rgba(220, 38, 38, .3); }

/* footer */
.site-footer { padding: 48px 0 32px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: .9rem; line-height: 1.6; }
.footer-grid { display: grid; gap: 28px 24px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.footer-about, .footer-social { grid-column: 1 / -1; }
@media (min-width: 860px) {
    .footer-grid { grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); }
    .footer-about, .footer-social { grid-column: auto; }
}
.site-footer .brand { font-size: 1.05rem; margin-bottom: 12px; }
.site-footer .brand img { width: 28px; height: 28px; }
.site-footer p { margin: 0 0 8px; }
.footer-title { color: var(--text); font-weight: 600; font-size: .85rem; letter-spacing: .02em; margin-bottom: 10px !important; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-col a { color: var(--text-dim); text-decoration: none; }
.footer-contact a { color: inherit; text-decoration: none; }
.footer-col a:hover, .footer-contact a:hover { color: var(--text); text-decoration: underline; }
.social-icons { display: flex; flex-wrap: wrap; gap: 8px; }
.social-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--border); color: var(--text-dim); transition: color .15s, border-color .15s, background-color .15s; }
.social-icon:hover, .social-icon:focus-visible { color: var(--text); border-color: var(--text-dim); text-decoration: none; }
.footer-bottom { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: space-between; }
.footer-bottom p { margin: 0; }
.footer-bottom span { white-space: nowrap; }

/* 404 */
.notfound { text-align: center; padding: 120px 0; }
.notfound h1 { font-size: 2.4rem; margin-bottom: 10px; }
.notfound p { color: var(--text-dim); margin-bottom: 24px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
