/* ============================================
   Getly - Test visibilità AI
   Stile coerente con getly.it: navy, verde acqua, Work Sans + Inter
   ============================================ */

:root {
    --primary-color: #042C53;      /* navy getly */
    --primary-dark: #021E3A;       /* navy profondo (footer) */
    --secondary-color: #185FA5;    /* blu link/accento testo */
    --accent-color: #5DCAA5;       /* verde acqua CTA */
    --accent-dark: #2E9A78;        /* verde scuro (icone, cookie) */
    --text-dark: #33475B;
    --text-body: #44566A;
    --text-light: #fff;
    --text-muted: #5A6B7B;
    --bg-light: #F4F8FB;
    --bg-dark: #021E3A;
    --border: #E3EAF1;
    --radius: 16px;
    --font-head: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html, body { overflow-x: hidden; max-width: 100vw; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background: #fff;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-head); color: var(--primary-color); }
a { color: var(--secondary-color); }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent-color); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10000; background: var(--primary-color); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Bottoni ---------- */
.btn-getly {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    background: var(--accent-color); color: var(--primary-color);
    font-family: var(--font-head); font-weight: 600; font-size: 1.05rem;
    border: none; border-radius: 11px; padding: 14px 24px;
    box-shadow: 0 10px 22px -8px rgba(93, 202, 165, .7);
    text-decoration: none; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;
}
.btn-getly:hover, .btn-getly:focus { color: var(--primary-color); background: var(--accent-color); transform: translateY(-2px); box-shadow: 0 16px 30px -10px rgba(93, 202, 165, .9); }
.btn-getly-sm { font-size: .95rem; padding: 10px 18px; }
.btn-outline-light-getly {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-head); font-weight: 600; font-size: 1.05rem;
    color: #fff; border: 1px solid rgba(255, 255, 255, .4); border-radius: 11px; padding: 13px 22px;
    text-decoration: none; transition: background .2s ease, border-color .2s ease;
}
.btn-outline-light-getly:hover { color: #fff; background: rgba(255, 255, 255, .08); border-color: #fff; }

/* ---------- Navbar ---------- */
.navbar {
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
    padding-top: 14px; padding-bottom: 14px;
    transition: padding .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.navbar.scrolled { padding-top: 8px; padding-bottom: 8px; border-bottom-color: var(--border); box-shadow: 0 6px 20px -12px rgba(4, 44, 83, .35); }
.navbar-brand { padding: 0; }
.navbar-logo { height: 50px; width: auto; display: block; }
.navbar .nav-link {
    font-family: var(--font-head); font-weight: 500; font-size: .98rem;
    color: var(--text-dark); padding: .5rem .9rem !important;
}
.navbar .nav-link:hover, .navbar .nav-link.active { color: var(--secondary-color); }
.navbar-toggler { border: 1px solid var(--border); padding: 6px 10px; }
.navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(93, 202, 165, .4); }
@media (max-width: 991.98px) {
    .navbar-collapse { background: #fff; border-radius: 12px; margin-top: 10px; padding: 10px 6px 16px; box-shadow: 0 16px 30px -18px rgba(4, 44, 83, .4); }
    .navbar .btn-getly { margin: 10px .9rem 0; }
}
@media (max-width: 575.98px) { .navbar-logo { height: 40px; } }

/* ---------- Hero (solo testo: LCP = H1) ---------- */
.hero {
    background:
        radial-gradient(60rem 30rem at 85% -10%, rgba(93, 202, 165, .16), transparent 60%),
        radial-gradient(50rem 30rem at -10% 110%, rgba(24, 95, 165, .10), transparent 60%),
        linear-gradient(180deg, #FFFFFF 0%, var(--bg-light) 100%);
    padding: 10.5rem 0 4.5rem;
    text-align: center;
}
@media (min-width: 992px) { .hero { padding: 11.5rem 0 6rem; } }
.hero-inner { max-width: 820px; margin: 0 auto; }
.eyebrow {
    display: inline-block; font-family: var(--font-head); font-weight: 600; font-size: .8rem;
    letter-spacing: .1em; text-transform: uppercase; color: #1F7A5F;
    background: #EAF7F1; padding: 6px 12px; border-radius: 999px;
}
.hero h1 {
    font-weight: 700; font-size: clamp(2.3rem, 7vw, 4.2rem); line-height: 1.05;
    letter-spacing: -.025em; margin: 20px 0 0; text-wrap: balance;
}
.hero h1 span { color: var(--secondary-color); }
.hero-lede { font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.65; color: var(--text-body); margin: 22px auto 0; max-width: 36em; }
.hero-cta { margin-top: 30px; }
.ai-chips { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ai-chips li {
    font-family: var(--font-head); font-weight: 500; font-size: .92rem; color: var(--primary-color);
    background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px;
    box-shadow: 0 6px 16px -12px rgba(4, 44, 83, .5);
}
@media (max-width: 575.98px) { .hero-cta .btn-getly { width: 100%; } }

/* ---------- Sezioni ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-light); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto; }
.section-kicker { display: inline-block; font-family: var(--font-head); font-weight: 600; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: #1F7A5F; margin-bottom: 12px; }
.section h2 { font-weight: 600; font-size: clamp(1.65rem, 3.6vw, 2.4rem); line-height: 1.15; letter-spacing: -.01em; margin: 0; text-wrap: balance; }
.section-sub { font-size: clamp(1rem, 1.8vw, 1.13rem); line-height: 1.65; color: var(--text-body); margin: 14px auto 0; max-width: 40em; }

/* Storia di Davide */
.story { background: var(--primary-color); }
.story .section-kicker { color: var(--accent-color); }
.story h2 { color: #fff; }
.story-text { font-size: clamp(1.08rem, 2vw, 1.3rem); line-height: 1.7; color: #D3E0EE; margin: 18px 0 0; max-width: 32em; }
.btn-yt {
    display: inline-flex; align-items: center; gap: 10px; margin-top: 26px;
    background: #FF0000; color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 1rem;
    text-decoration: none; padding: 13px 22px; border-radius: 10px; transition: transform .2s ease;
}
.btn-yt i { font-size: 1.2rem; }
.btn-yt:hover { color: #fff; transform: translateY(-2px); }
.story-video {
    position: relative; display: block; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9;
    background: var(--primary-dark); box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .6);
}
.story-video img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.story-video:hover img { transform: scale(1.03); }
.story-video .play {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 76px; height: 76px; border-radius: 50%; background: rgba(255, 0, 0, .92); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem; padding-left: 5px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}

/* Cosa controlliamo */
.check-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; height: 100%; transition: transform .25s ease, box-shadow .25s ease; }
.check-card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -24px rgba(4, 44, 83, .45); }
.check-icon { width: 50px; height: 50px; border-radius: 13px; background: #EAF7F1; color: var(--accent-dark); display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.check-card h3 { font-weight: 600; font-size: 1.12rem; margin: 16px 0 6px; }
.check-card p { font-size: .98rem; line-height: 1.6; color: var(--text-body); margin: 0; }

/* ---------- Form test ---------- */
.section-test { background: linear-gradient(180deg, var(--bg-light) 0%, #EAF2FA 100%); }
.form-card {
    background: #fff; border: 1px solid var(--border); border-radius: 20px;
    padding: clamp(24px, 4vw, 44px);
    box-shadow: 0 30px 60px -32px rgba(4, 44, 83, .35);
}
.form-card h2 { font-weight: 600; font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 0 6px; }
.form-card .form-intro { font-size: 1rem; color: var(--text-muted); margin: 0 0 22px; }
.form-card .form-label { font-family: var(--font-head); font-weight: 500; font-size: .88rem; color: var(--text-dark); margin-bottom: 5px; }
.form-card .form-control, .form-card .form-select {
    font-size: 1rem; color: var(--primary-color); padding: 11px 14px;
    border: 1.5px solid #D5E0EA; border-radius: 10px;
}
.form-card .form-control-lg { font-size: 1.12rem; padding: 14px 16px; }
.form-card .form-control:focus, .form-card .form-select:focus { border-color: var(--secondary-color); box-shadow: 0 0 0 3px rgba(24, 95, 165, .15); }
.form-card .form-control::placeholder { color: #8796A5; }
.form-card .form-check-label { font-size: .88rem; color: var(--text-muted); line-height: 1.5; }
.form-card .form-check-input { margin-top: .2rem; }
.form-card .form-check-input:checked { background-color: var(--primary-color); border-color: var(--primary-color); }
.form-card .alert { font-size: .98rem; border-radius: 10px; }
#formSuccess { display: flex; gap: 12px; align-items: center; }
#formSuccess.d-none { display: none !important; }
#formSuccess .ok-mark { flex: 0 0 34px; height: 34px; border-radius: 999px; background: var(--accent-dark); color: #fff; display: inline-flex; align-items: center; justify-content: center; }

.btn-submit {
    width: 100%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-color); color: var(--primary-color);
    font-family: var(--font-head); font-weight: 600; font-size: 1.1rem;
    border: none; border-radius: 11px; padding: 15px 20px;
    box-shadow: 0 10px 22px -8px rgba(93, 202, 165, .7);
    transition: transform .2s ease, background .2s ease;
}
.btn-submit:hover, .btn-submit:focus { background: #4DBB96; color: var(--primary-color); transform: translateY(-1px); }
.btn-submit:disabled { opacity: .75; transform: none; }
.form-small { font-size: .84rem; color: var(--text-muted); text-align: center; margin: 10px 0 0; }
.recaptcha-note { font-size: .75rem; color: #5A6B7B; text-align: center; margin: 8px 0 0; line-height: 1.5; }
.recaptcha-note a { color: #3D5266; text-decoration: underline; }
.grecaptcha-badge { visibility: hidden !important; }

/* Contenitore risultato test (da collegare al servizio di audit) */
.test-risultato { border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 20px; background: var(--bg-light); }
.test-risultato .tr-score { font-family: var(--font-head); color: var(--primary-color); text-align: center; }
.test-risultato .tr-score-value { font-size: 3.5rem; font-weight: 700; line-height: 1; }
.test-risultato .tr-score-max { font-size: 1.3rem; color: var(--text-muted); }
.test-risultato .tr-sub { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; text-align: center; }
.test-risultato .tr-sub li { background: #fff; border-radius: 10px; padding: 10px; font-size: .88rem; color: var(--text-muted); }
.test-risultato .tr-sub strong { display: block; font-family: var(--font-head); font-size: 1.4rem; color: var(--primary-color); }
.test-risultato .tr-problems-title { font-size: 1.05rem; font-weight: 600; margin: 20px 0 8px; }
.test-risultato .tr-problems { margin: 0; padding-left: 1.2rem; color: var(--text-body); }
.test-risultato .tr-note { margin: 14px 0 0; font-size: .95rem; color: var(--text-dark); }

/* Validazione */
.form-control.is-invalid, .form-check-input.is-invalid { border-color: #dc3545 !important; box-shadow: 0 0 0 0.2rem rgba(220,53,69,0.25) !important; }
.form-check-input.is-invalid ~ .form-check-label { color: #dc3545; }
.form-select.is-invalid { border-color: #dc3545 !important; box-shadow: 0 0 0 0.2rem rgba(220,53,69,0.25) !important; }

/* Come funziona */
.steps { list-style: none; padding: 0; margin: 44px 0 0; counter-reset: passo; }
.step { counter-increment: passo; background: var(--bg-light); border-radius: var(--radius); padding: 26px; height: 100%; position: relative; }
.step::before {
    content: counter(passo); display: inline-flex; width: 42px; height: 42px; border-radius: 12px;
    background: var(--primary-color); color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem;
    align-items: center; justify-content: center;
}
.step h3 { font-weight: 600; font-size: 1.15rem; line-height: 1.35; margin: 16px 0 6px; }
.step p { font-size: .98rem; line-height: 1.6; color: var(--text-body); margin: 0; }

/* FAQ */
.faq-list { max-width: 780px; margin: 36px auto 0; display: grid; gap: 12px; }
.faq-list details { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 0 20px; }
.faq-list summary { cursor: pointer; padding: 16px 28px 16px 0; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; color: var(--primary-color); list-style: none; position: relative; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 1.4rem; font-weight: 400; color: var(--secondary-color); }
.faq-list details[open] summary::after { content: "\2212"; }
.faq-list details p { margin: 0 0 16px; font-size: .98rem; line-height: 1.65; color: var(--text-body); }

/* Chiusura */
.final { background: linear-gradient(135deg, var(--primary-color) 0%, #0A3A66 100%); text-align: center; }
.final h2 { color: #fff; max-width: 26em; margin: 0 auto; }
.final-cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* Contatti */
.contact-item { display: flex; gap: 14px; align-items: flex-start; background: var(--bg-light); border-radius: 14px; padding: 18px; height: 100%; }
.contact-item .ci-icon { flex: 0 0 44px; height: 44px; border-radius: 12px; background: #EAF2FA; color: var(--secondary-color); display: inline-flex; align-items: center; justify-content: center; }
.contact-item h3 { font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 2px; }
.contact-item a, .contact-item p { font-size: 1rem; color: var(--primary-color); text-decoration: none; margin: 0; }
.contact-item a:hover { color: var(--secondary-color); text-decoration: underline; }

/* ---------- Footer ---------- */
.site-footer { background: var(--primary-dark); color: #A9BCD0; font-size: .93rem; padding: 64px 0 0; }
.site-footer h3, .site-footer h2 { font-family: var(--font-head); color: #fff; font-size: .9rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 16px; }
.site-footer a { color: #C3D4E6; text-decoration: none; }
.site-footer a:hover { color: var(--accent-color); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; }
.site-footer p { margin: 0 0 10px; line-height: 1.6; }
.footer-brand .footer-logo-wrap { display: inline-block; background: #fff; padding: 10px 16px; border-radius: 10px; margin-bottom: 1rem; }
.footer-brand .footer-logo-wrap img { height: 42px; width: auto; display: block; max-width: 100%; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 44px; padding: 20px 0 26px; font-size: .84rem; color: #8FA6BE; }
.footer-bottom a { color: #C3D4E6; }

/* ---------- WhatsApp FAB ---------- */
.wa-fab { position: fixed; right: 20px; bottom: 20px; width: 60px; height: 60px; border-radius: 50%; background: #25D366; color: #fff !important; display: flex; align-items: center; justify-content: center; font-size: 28px; box-shadow: 0 4px 12px rgba(0,0,0,0.25); z-index: 9998; transition: transform 0.2s; text-decoration: none; animation: waPulse 2s infinite; }
.wa-fab:hover { transform: scale(1.08); color: #fff; }
@keyframes waPulse { 0% { box-shadow: 0 0 0 0 rgba(37,211,102,.45), 0 4px 12px rgba(0,0,0,.25); } 70% { box-shadow: 0 0 0 14px rgba(37,211,102,0), 0 4px 12px rgba(0,0,0,.25); } 100% { box-shadow: 0 0 0 0 rgba(37,211,102,0), 0 4px 12px rgba(0,0,0,.25); } }
@media (prefers-reduced-motion: reduce) { .wa-fab { animation: none; } html { scroll-behavior: auto; } }
@media (max-width: 576px) { .wa-fab { width: 50px; height: 50px; font-size: 24px; right: 15px; bottom: 15px; } }

/* Cookie icon: verde getly scuro, mai rosso */
#cookie-settings-icon { background: var(--accent-dark, #2E9A78) !important; }
#cookie-settings-icon:hover { background: var(--primary-color) !important; }
@media (max-width: 576px) { .cookie-settings-btn { left: 15px; bottom: 15px; width: 50px; height: 50px; } }

/* Modali legali e pagine legali */
.modal-body h6, .legal-page h2 { font-family: var(--font-head); color: var(--primary-color); font-weight: 600; margin-top: 1.4rem; }
.modal-body h6:first-child { margin-top: 0; }
.modal-body table, .legal-page table { font-size: .88rem; }
.legal-page { padding: 9.5rem 0 4rem; }
.legal-page h1 { font-weight: 700; font-size: clamp(1.8rem, 4vw, 2.5rem); margin-bottom: 1rem; }
.legal-page h2 { font-size: 1.15rem; }
.legal-page .legal-body { max-width: 820px; }

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

/* ---------- 404 e pagine interne: navbar sempre solida ---------- */
.page-solid .navbar { background: #fff; border-bottom-color: var(--border); }
.error-wrap { padding: 11rem 0 5rem; text-align: center; background: linear-gradient(180deg, #FFFFFF 0%, var(--bg-light) 100%); min-height: 70vh; }
.error-icon { width: 88px; height: 88px; border-radius: 24px; background: #EAF2FA; color: var(--secondary-color); display: inline-flex; align-items: center; justify-content: center; font-size: 2.2rem; }
.error-code { font-family: var(--font-head); font-weight: 700; font-size: clamp(3.5rem, 10vw, 6rem); color: var(--primary-color); line-height: 1; margin: 22px 0 0; letter-spacing: -.03em; }
.error-wrap h1 { font-weight: 600; font-size: clamp(1.5rem, 3vw, 2rem); margin: 12px 0 0; }
.error-wrap p { color: var(--text-body); font-size: 1.05rem; max-width: 34em; margin: 12px auto 0; }

/* ===== Test automatico: avanzamento e risultato ===== */
.test-risultato .tr-progress { text-align: center; padding: 8px 0; }
.test-risultato .tr-spinner { display: inline-block; width: 44px; height: 44px; border-radius: 50%; border: 4px solid #DCE6EF; border-top-color: var(--accent-dark); animation: tr-spin .9s linear infinite; }
@keyframes tr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .test-risultato .tr-spinner { animation-duration: 3s; } }
.test-risultato .tr-progress-title { font-family: var(--font-head); font-size: 1.1rem; color: var(--primary-color); margin: 14px 0 12px; word-break: break-word; }
.test-risultato .tr-steps { list-style: none; padding: 0; margin: 0 auto; max-width: 440px; text-align: left; }
.test-risultato .tr-steps li { position: relative; padding: 7px 0 7px 30px; color: var(--text-muted); font-size: .95rem; }
.test-risultato .tr-steps li::before { content: ""; position: absolute; left: 4px; top: 12px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #C3D0DC; }
.test-risultato .tr-steps li.is-active { color: var(--text-dark); font-weight: 500; }
.test-risultato .tr-steps li.is-active::before { border-color: var(--accent-dark); background: #EAF7F1; }
.test-risultato .tr-steps li.is-done { color: var(--text-dark); }
.test-risultato .tr-steps li.is-done::before { border-color: var(--accent-dark); background: var(--accent-dark); }
.test-risultato .tr-host { text-align: center; color: var(--text-muted); margin: 0 0 6px; word-break: break-word; }
.test-risultato .tr-verdict { font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; margin: 8px 0 0; color: var(--primary-color); }
.test-risultato .is-good { color: #1E8E3E !important; }
.test-risultato .is-mid { color: #B26A00 !important; }
.test-risultato .is-bad { color: #C5221F !important; }
.test-risultato .tr-sub strong.is-pending { font-size: .85rem; font-weight: 500; color: var(--text-muted); padding-top: 8px; }
.test-risultato .tr-problems li { margin-bottom: 10px; }
.test-risultato .tr-problems li strong { display: block; color: var(--text-dark); }
.test-risultato .tr-problems li span { font-size: .93rem; color: var(--text-muted); }
.test-risultato .tr-aiview { list-style: none; padding: 0; margin: 0; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.test-risultato .tr-aiview li { display: flex; gap: 10px; padding: 9px 12px; font-size: .93rem; align-items: baseline; }
.test-risultato .tr-aiview li + li { border-top: 1px solid #EEF2F6; }
.test-risultato .tr-aiview .tr-k { flex: 0 0 96px; color: var(--text-muted); }
.test-risultato .tr-aiview .tr-v { flex: 1; min-width: 0; color: var(--text-dark); overflow-wrap: anywhere; }
.test-risultato .tr-aiview .tr-v.is-missing { color: #C5221F; }
.test-risultato .tr-cta { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; }
.test-risultato .tr-again { color: var(--text-muted); font-size: .92rem; }
@media (max-width: 575.98px) {
    .test-risultato { padding: 18px 14px; }
    .test-risultato .tr-sub { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .test-risultato .tr-aiview .tr-k { flex-basis: 80px; }
}
