/* ==========================================================================
   Licsly — tema pubblico (landing).
   Palette e forme dal design system dell'app (ds.dart): brand blu "Otto",
   teal, corallo, ambra; superfici crema; card molto arrotondate, ombre
   soffici; tipografia Nunito extra-bold; bottoni "3D" (UX percorso Duolingo).
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,600;0,700;0,800;0,900;1,700&display=swap');

:root {
    --blu: #3D7BFF;
    --blu-scuro: #2E63E0;
    --teal: #16C79A;
    --corallo: #EF476F;
    --ambra: #FFC93C;
    --verde: #58CC02;
    --verde-scuro: #46A302;
    --sfondo: #ECE7E0;
    --superficie: #FFFFFF;
    --tinta-blu: #E3ECFA;
    --tinta-crema: #EEF4FC;
    --testo: #3D3D3D;
    --testo-soft: #8A8A8A;
    --muto: #B6B2AE;
    --bordo: #EDE8E4;
    --scuro: #22203A;

    --t-lavanda: #B6B2D7;
    --t-sole: #F4D26B;
    --t-cielo: #95E3FA;
    --t-pesca: #EFC7B5;
    --t-teal: #9BD5C6;

    --r-grande: 24px;
    --r-medio: 18px;
    --r-pill: 100px;
    --ombra: 0 14px 40px -12px rgba(32, 40, 64, .18);
    --ombra-soft: 0 8px 24px -12px rgba(32, 40, 64, .16);
    --container: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.site {
    margin: 0;
    font-family: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    font-weight: 600;
    color: var(--testo);
    background-color: var(--sfondo);
    background-image:
        radial-gradient(1200px 700px at 82% -12%, rgba(61, 123, 255, .10), transparent 62%),
        radial-gradient(900px 560px at -8% 4%, rgba(22, 199, 154, .06), transparent 60%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    line-height: 1.55;
    overflow-x: hidden;
}

/* Sezioni con fondo alternato (invece del bianco pieno) */
.section-alt { background: linear-gradient(180deg, var(--tinta-blu), rgba(234, 241, 255, .35)); }
.section-cream { background: var(--tinta-crema); }

h1, h2, h3, h4 { font-weight: 900; line-height: 1.1; color: var(--testo); margin: 0 0 .4em; letter-spacing: -.02em; }
h1 { font-size: clamp(2.2rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1rem; }
a { color: var(--blu); text-decoration: none; }

.container-site {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 22px;
}

.section { padding: clamp(56px, 8vw, 104px) 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto clamp(32px, 5vw, 56px); }
.section-head p { color: var(--testo-soft); font-size: 1.12rem; }

.eyebrow {
    display: inline-block;
    font-weight: 800;
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--blu);
    background: rgba(61, 123, 255, .1);
    padding: 6px 14px;
    border-radius: var(--r-pill);
    margin-bottom: 14px;
}

/* --- Bottoni "3D" (stile percorso app) --------------------------------- */
.btn-otto {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: inherit;
    font-weight: 800;
    font-size: 1.02rem;
    padding: 15px 28px;
    border: none;
    border-radius: var(--r-pill);
    cursor: pointer;
    transition: transform .08s ease, box-shadow .08s ease, filter .15s ease;
    text-decoration: none;
    line-height: 1;
}
.btn-otto:active { transform: translateY(3px); }

.btn-primario { background: var(--blu); color: #fff; box-shadow: 0 5px 0 var(--blu-scuro); }
.btn-primario:active { box-shadow: 0 2px 0 var(--blu-scuro); }
.btn-primario:hover { filter: brightness(1.04); color: #fff; }

.btn-verde { background: var(--verde); color: #fff; box-shadow: 0 5px 0 var(--verde-scuro); }
.btn-verde:active { box-shadow: 0 2px 0 var(--verde-scuro); }
.btn-verde:hover { color: #fff; filter: brightness(1.03); }

.btn-ghost {
    background: var(--superficie);
    color: var(--testo);
    box-shadow: 0 5px 0 var(--bordo);
    border: 2px solid var(--bordo);
    padding: 13px 26px;
}
.btn-ghost:active { box-shadow: 0 2px 0 var(--bordo); }
.btn-ghost:hover { color: var(--testo); border-color: #ddd6cf; }

/* --- Navbar ------------------------------------------------------------ */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 247, 245, .82);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--bordo);
}
.site-nav .container-site {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 74px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.35rem; color: var(--testo); }
.brand svg { width: 40px; height: 40px; }
.brand span { letter-spacing: -.03em; }
.nav-links { display: flex; align-items: center; gap: 30px; list-style: none; margin: 0; padding: 0; }
.nav-links a { color: var(--testo); font-weight: 700; }
.nav-links a:hover { color: var(--blu); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; width: 44px; height: 44px; }
.nav-toggle span { display: block; width: 24px; height: 3px; border-radius: 3px; background: var(--testo); margin: 5px auto; transition: .25s; }

/* --- Hero -------------------------------------------------------------- */
.hero { position: relative; padding: clamp(40px, 6vw, 76px) 0 clamp(60px, 8vw, 96px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero-copy .eyebrow { margin-bottom: 18px; }
.hero-copy p.lead { font-size: 1.22rem; color: #4d4a47; max-width: 520px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }
.hero-note { margin-top: 16px; color: var(--testo-soft); font-size: .95rem; font-weight: 700; }

.hero-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 340px; }
/* Alone morbido dietro Otto: nessun disco netto, solo un bagliore diffuso */
.hero-blob {
    position: absolute; inset: 0; margin: auto;
    width: 540px; height: 540px; max-width: 108%; aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%,
        rgba(120, 178, 255, .34) 0%,
        rgba(140, 195, 255, .18) 42%,
        rgba(149, 227, 250, 0) 72%);
    filter: blur(6px);
    animation: haloPulse 6.5s ease-in-out infinite;
}
@keyframes haloPulse {
    0%,100% { transform: scale(1); opacity: .92; }
    50%     { transform: scale(1.05); opacity: 1; }
}
.hero-otto { position: relative; z-index: 2; width: min(320px, 74%); filter: drop-shadow(0 18px 26px rgba(46,99,224,.22)); animation: float 3.6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-16px) rotate(1.5deg); } }

.hero-chip {
    position: absolute; z-index: 3;
    background: var(--superficie); border-radius: var(--r-pill);
    box-shadow: var(--ombra-soft);
    padding: 9px 15px; font-weight: 800; font-size: .9rem;
    display: inline-flex; align-items: center; gap: 8px;
}
.hero-chip .dot { width: 12px; height: 12px; border-radius: 50%; }
.hero-chip.c1 { top: 12%; left: 2%; animation: float 4.2s ease-in-out infinite; }
.hero-chip.c2 { bottom: 14%; right: 0%; animation: float 5s ease-in-out .6s infinite; }

/* --- Store badges ------------------------------------------------------ */
.store-badge {
    display: inline-flex; align-items: center; gap: 10px;
    background: var(--scuro); color: #fff;
    padding: 10px 18px; border-radius: 14px; font-weight: 700;
    box-shadow: 0 5px 0 #14121f;
    transition: transform .08s ease, box-shadow .08s ease;
}
.store-badge:active { transform: translateY(3px); box-shadow: 0 2px 0 #14121f; }
.store-badge:hover { color: #fff; }
.store-badge svg { width: 26px; height: 26px; }
.store-badge small { display: block; font-size: .68rem; font-weight: 600; opacity: .8; line-height: 1; margin-bottom: 2px; }
.store-badge b { font-size: 1.05rem; line-height: 1; }

/* --- Barra statistiche ------------------------------------------------- */
.stats-bar { background: var(--superficie); border-radius: var(--r-grande); box-shadow: var(--ombra); padding: 30px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { text-align: center; }
.stat .num { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; color: var(--blu); letter-spacing: -.03em; }
.stat .lbl { color: var(--testo-soft); font-weight: 700; }
.stat + .stat { border-left: 2px solid var(--bordo); }

/* --- Card generiche ---------------------------------------------------- */
.card-soft { background: var(--superficie); border-radius: var(--r-grande); box-shadow: var(--ombra-soft); padding: 30px; height: 100%; border: 1px solid var(--bordo); }

/* --- Come funziona (percorso) ----------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; position: relative; }
.step { background: var(--superficie); border-radius: var(--r-grande); box-shadow: var(--ombra-soft); padding: 32px 26px; text-align: center; border: 1px solid var(--bordo); position: relative; }
.step .step-num {
    width: 58px; height: 58px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 1.5rem; color: #fff;
    margin: 0 auto 18px; box-shadow: var(--ombra-soft);
}
.step:nth-child(1) .step-num { background: var(--blu); }
.step:nth-child(2) .step-num { background: var(--teal); }
.step:nth-child(3) .step-num { background: var(--corallo); }
.step p { color: var(--testo-soft); margin: 0; }

/* --- Patenti ----------------------------------------------------------- */
.patenti-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.patente-card { border-radius: var(--r-grande); padding: 30px 26px; text-align: center; border: 1px solid var(--bordo); background: var(--superficie); box-shadow: var(--ombra-soft); transition: transform .18s ease, box-shadow .18s ease; }
.patente-card:hover { transform: translateY(-6px); box-shadow: var(--ombra); }
.patente-ico { width: 118px; height: 118px; margin: 0 auto 12px; }
.patente-card.tint-b { background: linear-gradient(180deg, rgba(149,227,250,.35), #fff); }
.patente-card.tint-moto { background: linear-gradient(180deg, rgba(239,199,181,.4), #fff); }
.patente-card.tint-naut { background: linear-gradient(180deg, rgba(155,213,198,.4), #fff); }
.patente-card p { color: var(--testo-soft); margin: 0; }

/* --- Features ---------------------------------------------------------- */
.features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.feature { display: flex; gap: 18px; align-items: flex-start; background: var(--superficie); border: 1px solid var(--bordo); border-radius: var(--r-grande); padding: 26px; box-shadow: var(--ombra-soft); }
.feature .f-ico { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; }
.feature:nth-child(4n+1) .f-ico { background: rgba(61,123,255,.12); color: var(--blu); }
.feature:nth-child(4n+2) .f-ico { background: rgba(22,199,154,.14); color: var(--teal); }
.feature:nth-child(4n+3) .f-ico { background: rgba(239,71,111,.12); color: var(--corallo); }
.feature:nth-child(4n) .f-ico { background: rgba(255,201,60,.2); color: #C9970A; }
.feature h3 { margin-bottom: 4px; }
.feature p { color: var(--testo-soft); margin: 0; }

/* --- Premium band ------------------------------------------------------ */
.band { border-radius: var(--r-grande); padding: clamp(36px, 6vw, 64px); position: relative; overflow: hidden; }
.band-premium { background: linear-gradient(120deg, var(--blu), var(--teal)); color: #fff; }
.band-premium h2, .band-premium p { color: #fff; }
.band-premium p { opacity: .95; max-width: 560px; font-size: 1.12rem; }
.band-inner { position: relative; z-index: 2; }
.band .ambra-star { position: absolute; right: -20px; top: -20px; font-size: 220px; opacity: .12; z-index: 1; }

/* --- CTA finale -------------------------------------------------------- */
.cta-final { text-align: center; }
.cta-final .cta-otto { width: 150px; margin: 0 auto 6px; animation: float 3.6s ease-in-out infinite; }

/* --- FAQ (accordion) --------------------------------------------------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item { background: var(--superficie); border: 1px solid var(--bordo); border-radius: var(--r-medio); margin-bottom: 14px; overflow: hidden; box-shadow: var(--ombra-soft); }
.faq-q { width: 100%; text-align: left; background: none; border: 0; padding: 20px 24px; font-family: inherit; font-weight: 800; font-size: 1.08rem; color: var(--testo); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq-q .chev { transition: transform .25s ease; color: var(--blu); flex: 0 0 auto; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 24px 20px; color: var(--testo-soft); }

/* --- Footer ------------------------------------------------------------ */
.site-footer { background: var(--scuro); color: #cfcde0; padding: 64px 0 30px; }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: 16px; letter-spacing: .02em; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer-brand .brand { color: #fff; }
.footer-brand .brand span { color: #fff; }
.footer-brand p { color: #a9a6c2; max-width: 340px; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { color: #cfcde0; font-weight: 600; }
.footer-links a:hover { color: #fff; }
.footer-socials { display: flex; gap: 12px; margin-top: 6px; }
.footer-socials a { width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: #fff; }
.footer-socials a:hover { background: var(--blu); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 44px; padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: #8f8ca8; font-size: .9rem; }
.footer-legal a { color: #cfcde0; text-decoration: underline; }
.footer-legal a:hover { color: #fff; }

/* --- Pagine legali (privacy / termini) --- */
.legal-content { max-width: 780px; margin: 0 auto; color: var(--testo); }
.legal-content h1 { font-size: 1.9rem; margin: 0 0 6px; }
.legal-content h1.head { border-bottom: 3px solid var(--blu); padding-bottom: 12px; margin-bottom: 6px; }
.legal-content h2 { font-size: 1.2rem; margin-top: 2rem; color: var(--blu); }
.legal-content h3 { font-size: 1.05rem; margin-top: 1.4rem; }
.legal-content p, .legal-content li { line-height: 1.7; }
.legal-content ul { margin: .5rem 0 .5rem 1.3rem; }
.legal-content a { color: var(--blu); }
.legal-content .muted { color: var(--testo-soft); font-size: .92rem; }
.legal-content code { background: var(--tinta-blu); padding: 1px 6px; border-radius: 6px; }

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

/* --- Responsive -------------------------------------------------------- */
@media (max-width: 900px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-copy .eyebrow, .hero-cta { justify-content: center; }
    .hero-copy p.lead { margin-left: auto; margin-right: auto; }
    .hero-art { order: -1; min-height: 300px; }
    .steps, .patenti-grid { grid-template-columns: 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 720px) {
    .nav-links { position: fixed; inset: 74px 0 auto 0; background: var(--sfondo); flex-direction: column; padding: 20px; gap: 18px; border-bottom: 1px solid var(--bordo); transform: translateY(-120%); transition: transform .3s ease; }
    .site-nav.open .nav-links { transform: none; }
    .nav-toggle { display: block; }
    .nav-desktop-cta { display: none; }
    .stats-bar { grid-template-columns: 1fr; gap: 22px; }
    .stat + .stat { border-left: 0; border-top: 2px solid var(--bordo); padding-top: 22px; }
}

/* --- App in azione: mockup telefono (iOS + Android) --- */
.shots-grid { display: flex; gap: 48px; justify-content: center; align-items: flex-start; flex-wrap: wrap; }
.shot-item { text-align: center; }
.phone { position: relative; width: 232px; height: 472px; background: #191c28; border-radius: 40px; padding: 12px; box-shadow: 0 30px 60px -24px rgba(32,40,64,.5); border: 2px solid #2a2e3f; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 30px; overflow: hidden; background: radial-gradient(circle at 50% 30%, #EAF1FF, #D3E4FF); }
.phone-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s ease; }
.phone-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--testo-soft); font-weight: 800; text-align: center; padding: 24px; }
.phone-cam { position: absolute; z-index: 3; background: #191c28; }
.phone-ios .phone-cam { top: 12px; left: 50%; transform: translateX(-50%); width: 92px; height: 22px; border-radius: 0 0 16px 16px; }
.phone-android .phone-cam { top: 22px; left: 50%; transform: translateX(-50%); width: 11px; height: 11px; border-radius: 50%; }
.shot-cap { margin-top: 18px; display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 800; }
.shot-os { font-size: .72rem; font-weight: 900; letter-spacing: .03em; padding: 3px 10px; border-radius: 100px; color: #fff; }
.shot-os-ios { background: #22203A; }
.shot-os-android { background: var(--teal); }
.shot-cap-txt { color: var(--testo); }
@media (max-width: 520px) {
    .phone { width: 190px; height: 388px; }
}

.shots-band { padding: clamp(40px, 7vw, 84px) 0; }
.phone-sm { width: 208px; height: 424px; }
@media (max-width: 520px) { .phone-sm { width: 178px; height: 364px; } }

/* --- Otto interattivo (fumetto al clic) --- */
.otto-interactive { cursor: pointer; position: relative; }
.otto-bubble {
    position: absolute; left: 50%; top: 6px; transform: translate(-50%, -100%) scale(.7);
    background: #fff; border: 2px solid rgba(61,123,255,.35); border-radius: 16px;
    padding: 10px 15px; font-weight: 800; font-size: .95rem; color: var(--scuro);
    box-shadow: var(--ombra); max-width: 230px; width: max-content; text-align: center;
    line-height: 1.25; opacity: 0; pointer-events: none; z-index: 6;
    transition: opacity .2s ease, transform .28s cubic-bezier(.2,1.5,.4,1);
}
.otto-bubble.show { opacity: 1; transform: translate(-50%, -100%) scale(1); }
.otto-bubble::after { content: ''; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); border: 9px solid transparent; border-top-color: #fff; }
.otto-pop { animation: ottoPop .5s ease; transform-origin: center; }
@keyframes ottoPop { 0% { transform: scale(1); } 30% { transform: scale(1.12) rotate(-5deg); } 60% { transform: scale(.95) rotate(4deg); } 100% { transform: scale(1); } }

/* --- Toggle tema --- */
.theme-toggle { background: var(--superficie); border: 1.5px solid var(--bordo); width: 42px; height: 42px; border-radius: 50%; cursor: pointer; font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; transition: transform .1s ease; }
.theme-toggle:active { transform: scale(.92); }
.theme-toggle .ico-sun { display: none; }
.theme-toggle .ico-moon { display: inline; }

/* --- Dark mode --- */
html[data-theme="dark"] {
    --sfondo: #14151d;
    --superficie: #1E2030;
    --testo: #E7E9F1;
    --testo-soft: #9AA0B4;
    --muto: #6B6F82;
    --bordo: #2B2E40;
    --tinta-blu: #1A2233;
    --tinta-crema: #181A26;
}
html[data-theme="dark"] .theme-toggle .ico-sun { display: inline; }
html[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
html[data-theme="dark"] .site-nav { background: rgba(18,19,27,.82); }
html[data-theme="dark"] .hero-copy p.lead { color: #C7CAD6; }
html[data-theme="dark"] .site-footer { background: #0F1016; }
html[data-theme="dark"] .btn-ghost { box-shadow: 0 5px 0 #0d0e15; }
html[data-theme="dark"] .otto-bubble { background: #1E2030; border-color: rgba(120,178,255,.45); color: var(--testo); }
html[data-theme="dark"] .otto-bubble::after { border-top-color: #1E2030; }
