/* ==========================================================================
   Ripetizioni Apricena - stile landing page
   Palette ispirata alla locandina: blu notte, verde acqua, giallo.
   ========================================================================== */

:root {
    --navy: #13294b;
    --navy-deep: #0c1d37;
    --teal: #2bb3a3;
    --teal-dark: #1f8a7e;
    --teal-light: #dff3f0;
    --yellow: #f5c242;
    --yellow-dark: #e0ab24;
    --bg: #f3f6f9;
    --surface: #ffffff;
    --ink: #172640;
    --muted: #5a6a80;
    --line: #e1e8ef;
    --danger: #d64545;
    --success: #1f8a7e;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(19, 41, 75, .06), 0 8px 24px rgba(19, 41, 75, .08);
    --shadow-lg: 0 2px 4px rgba(19, 41, 75, .06), 0 18px 40px rgba(19, 41, 75, .16);
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --header-h: 68px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--teal-dark); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; color: var(--navy); }
p { margin: 0 0 1em; }

.container { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.container--narrow { width: min(820px, 100% - 2.5rem); }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 100;
    background: var(--yellow); color: var(--navy); padding: .6rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ---------- Bottoni ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
    border: 2px solid transparent; border-radius: 999px;
    padding: .7rem 1.4rem; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-sm { padding: .5rem 1.05rem; font-size: .95rem; }
.btn-lg { padding: .9rem 1.8rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.btn-accent { background: var(--yellow); color: var(--navy); box-shadow: 0 6px 18px rgba(245, 194, 66, .35); }
.btn-accent:hover { background: #ffd05a; }

.btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- Header ---------- */

.site-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(19, 41, 75, .92);
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 8px 24px rgba(12, 29, 55, .25); }

.header-inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { height: 44px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a:not(.btn) { color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 600; font-size: .98rem; }
.site-nav a:not(.btn):hover { color: var(--teal); }

.nav-toggle { display: none; }

@media (max-width: 860px) {
    .nav-toggle {
        display: grid; place-items: center; width: 44px; height: 44px;
        background: transparent; border: 0; cursor: pointer;
    }
    .nav-toggle-bar,
    .nav-toggle-bar::before,
    .nav-toggle-bar::after {
        display: block; width: 24px; height: 2.5px; border-radius: 2px; background: #fff;
        transition: transform .2s ease, opacity .2s ease; content: "";
    }
    .nav-toggle-bar { position: relative; }
    .nav-toggle-bar::before { position: absolute; top: -7px; }
    .nav-toggle-bar::after { position: absolute; top: 7px; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }

    .site-nav {
        position: absolute; top: var(--header-h); left: 0; right: 0;
        flex-direction: column; align-items: stretch; gap: 0;
        background: var(--navy); padding: .5rem 1.25rem 1.25rem;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
        transform: translateY(-8px); opacity: 0; visibility: hidden;
        transition: transform .2s ease, opacity .2s ease, visibility .2s;
    }
    .site-nav.is-open { transform: none; opacity: 1; visibility: visible; }
    .site-nav a:not(.btn) { padding: .85rem 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
    .site-nav .btn { margin-top: 1rem; }
}

/* ---------- Hero ---------- */

.hero {
    position: relative; overflow: hidden;
    background: radial-gradient(1100px 500px at 50% -10%, #1d3b68 0%, var(--navy) 55%, var(--navy-deep) 100%);
    color: #fff; text-align: center;
    padding: clamp(4rem, 9vw, 7rem) 0 clamp(6rem, 11vw, 9rem);
}
.hero-pattern {
    position: absolute; inset: 0;
    background: url("../img/pattern.svg") center / 900px auto repeat;
    opacity: .07; pointer-events: none;
}
.hero-inner { position: relative; }

.eyebrow {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .4rem 1rem; border-radius: 999px;
    background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
    font-size: .92rem; font-weight: 600; color: rgba(255, 255, 255, .85); margin-bottom: 1.6rem;
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(43, 179, 163, .25); }

.hero h1 {
    color: #fff; text-transform: uppercase; font-weight: 800;
    font-size: clamp(2.3rem, 6.4vw, 4.6rem); letter-spacing: .01em; margin-bottom: .2em;
}
.hero-subtitle { color: var(--teal); font-size: clamp(1.3rem, 3vw, 2rem); font-weight: 600; margin-bottom: 1.2rem; }
.hero-lead { max-width: 680px; margin: 0 auto 2rem; color: rgba(255, 255, 255, .78); font-size: 1.1rem; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .9rem; margin-bottom: 2.6rem; }

.hero-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem 2rem; list-style: none; margin: 0; padding: 0; color: rgba(255, 255, 255, .7); font-size: .98rem; }
.hero-badges strong { color: var(--yellow); }

@media (min-width: 700px) { .br-desktop { display: none; } }

/* ---------- Intestazioni sezioni ---------- */

section { padding: clamp(4rem, 8vw, 6rem) 0; }

.section-head { text-align: center; max-width: 680px; margin: 0 auto 3rem; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); font-weight: 800; }
.section-head p { color: var(--muted); }

.kicker {
    display: inline-block; margin-bottom: .8rem; padding: .25rem .8rem; border-radius: 999px;
    background: var(--teal-light); color: var(--teal-dark);
    font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
}
.kicker--light { background: rgba(43, 179, 163, .18); color: var(--teal); }

/* ---------- Materie ---------- */

.subjects {
    position: relative; margin-top: -5rem; padding-top: 0;
    background: linear-gradient(var(--bg), var(--bg)) 0 5rem / 100% 100% no-repeat;
}
.subjects::before {
    content: ""; position: absolute; inset: 5rem 0 0;
    background: url("../img/pattern.svg") center / 900px auto repeat;
    opacity: .05; pointer-events: none;
}
.subjects .container { position: relative; }
.subjects .section-head {
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 2rem 2rem 1.6rem; max-width: 760px;
}

.subject-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem;
    list-style: none; margin: 0; padding: 0;
}
.subject-card { flex: 0 1 255px; display: flex; }

.subject-link {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; width: 100%;
    padding: 1.8rem 1.3rem 1.4rem; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
    color: inherit; text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.subject-link:hover,
.subject-link:focus-visible { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(43, 179, 163, .45); }

.subject-icon {
    display: grid; place-items: center; width: 84px; height: 84px; margin-bottom: 1rem;
    border-radius: 22px; background: linear-gradient(145deg, #f7fbfb, var(--teal-light));
}
.subject-icon svg { width: 58px; height: 58px; }
.subject-name { font-weight: 800; color: var(--navy); font-size: 1.12rem; line-height: 1.25; margin-bottom: .5rem; }
.subject-desc { color: var(--muted); font-size: .93rem; line-height: 1.5; margin-bottom: 1rem; }
.subject-cta { margin-top: auto; color: var(--teal-dark); font-weight: 700; font-size: .92rem; }
.subject-link:hover .subject-cta span { display: inline-block; transform: translateX(3px); transition: transform .2s ease; }

/* ---------- Nastro giallo ---------- */

.ribbon { background: var(--yellow); color: var(--navy); overflow: hidden; padding: 1rem 0; font-weight: 800; font-size: clamp(1.05rem, 2vw, 1.35rem); }
.ribbon-track { display: flex; gap: 1.4rem; width: max-content; white-space: nowrap; animation: ribbon 38s linear infinite; }
.ribbon .sep { color: var(--teal-dark); }
@keyframes ribbon { to { transform: translateX(-50%); } }

/* ---------- Per chi ---------- */

.audience-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.audience-card {
    padding: 2.2rem; border-radius: var(--radius); background: var(--surface);
    border: 1px solid var(--line); box-shadow: var(--shadow);
}
.audience-card h3 { font-size: 1.4rem; }
.audience-tag {
    display: inline-block; margin-bottom: 1rem; padding: .3rem .85rem; border-radius: 8px;
    background: var(--yellow); color: var(--navy); font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em;
}
.audience-card--dark { background: var(--navy); border-color: var(--navy); color: rgba(255, 255, 255, .85); }
.audience-card--dark h3 { color: #fff; }
.audience-card--dark .audience-tag { background: var(--teal); }

.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.check-list li { position: relative; padding-left: 2rem; }
.check-list li::before {
    content: ""; position: absolute; left: 0; top: .2em; width: 1.3rem; height: 1.3rem; border-radius: 50%;
    background: var(--teal-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3L15 7' fill='none' stroke='%231f8a7e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat;
}
.audience-card--dark .check-list li::before { background-color: rgba(43, 179, 163, .25); }

/* ---------- Metodo ---------- */

.method { background: var(--surface); }

.steps { list-style: none; margin: 0 0 3.5rem; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; counter-reset: step; }
.step { position: relative; padding: 2rem 1.8rem; border-radius: var(--radius); background: var(--bg); }
.step h3 { font-size: 1.25rem; }
.step p { color: var(--muted); margin: 0; }
.step-num {
    display: grid; place-items: center; width: 46px; height: 46px; margin-bottom: 1rem; border-radius: 14px;
    background: var(--navy); color: var(--yellow); font-weight: 800; font-size: 1.25rem;
}

.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.feature { padding-top: 1.2rem; border-top: 3px solid var(--teal); }
.feature h3 { font-size: 1.08rem; }
.feature p { color: var(--muted); font-size: .97rem; margin: 0; }

/* ---------- FAQ ---------- */

.faq-list { display: grid; gap: .8rem; }
.faq details {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
    box-shadow: 0 1px 2px rgba(19, 41, 75, .04); transition: border-color .2s ease;
}
.faq details[open] { border-color: rgba(43, 179, 163, .5); }
.faq summary {
    position: relative; cursor: pointer; list-style: none;
    padding: 1.1rem 3.2rem 1.1rem 1.4rem; font-weight: 700; color: var(--navy);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+"; position: absolute; right: 1.2rem; top: 50%; transform: translateY(-50%);
    width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
    background: var(--teal-light); color: var(--teal-dark); font-size: 1.2rem; font-weight: 700; transition: transform .2s ease;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { padding: 0 1.4rem 1.2rem; margin: 0; color: var(--muted); }

/* ---------- Contatti ---------- */

.contact { background: var(--navy); color: rgba(255, 255, 255, .82); position: relative; overflow: hidden; }
.contact::before {
    content: ""; position: absolute; inset: 0;
    background: url("../img/pattern.svg") center / 900px auto repeat; opacity: .05; pointer-events: none;
}
.contact-inner { position: relative; display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact h2 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 800; }

.contact-points { list-style: none; margin: 2rem 0 0; padding: 0; display: grid; gap: 1rem; }
.contact-points li { display: flex; align-items: center; gap: .8rem; font-weight: 600; }
.contact-points a { color: #fff; }
.cp-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .08); }

.contact-form {
    background: var(--surface); color: var(--ink); border-radius: calc(var(--radius) + 4px);
    padding: clamp(1.5rem, 4vw, 2.4rem); box-shadow: 0 30px 60px rgba(0, 0, 0, .25);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: flex; flex-direction: column; margin-bottom: 1rem; }
.field label { font-weight: 700; font-size: .92rem; color: var(--navy); margin-bottom: .35rem; }

.field input,
.field select,
.field textarea {
    font: inherit; font-size: 1rem; color: var(--ink); width: 100%;
    padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: #fbfcfd;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.field textarea { resize: vertical; min-height: 130px; }
.field select {
    appearance: none; -webkit-appearance: none; padding-right: 2.4rem;
    background: #fbfcfd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 7.5l5 5 5-5' fill='none' stroke='%2313294b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") right .8rem center / 18px no-repeat;
}
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--teal); background-color: #fff; box-shadow: 0 0 0 4px rgba(43, 179, 163, .16); }

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .85rem; margin-top: .3rem; min-height: 0; }
.field-error:empty { display: none; }

.field--check { margin-top: .3rem; }
.check { display: flex; gap: .7rem; align-items: flex-start; font-weight: 500 !important; font-size: .92rem !important; color: var(--muted) !important; cursor: pointer; }
.check input { width: 20px; height: 20px; flex: none; margin-top: .15rem; accent-color: var(--teal-dark); }

.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-note { margin: .8rem 0 0; font-size: .85rem; color: var(--muted); text-align: center; }

.form-alert { display: none; margin-bottom: 1.2rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm); font-weight: 600; }
.form-alert.is-visible { display: block; }
.form-alert--success { background: var(--teal-light); color: var(--teal-dark); border: 1px solid rgba(31, 138, 126, .3); }
.form-alert--error { background: #fdecec; color: #a82e2e; border: 1px solid rgba(214, 69, 69, .3); }

.spinner {
    display: none; width: 18px; height: 18px; border-radius: 50%;
    border: 2.5px solid rgba(19, 41, 75, .25); border-top-color: var(--navy); animation: spin .7s linear infinite;
}
.is-loading .spinner { display: inline-block; }
.is-loading { pointer-events: none; opacity: .85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */

.site-footer { background: var(--navy-deep); color: rgba(255, 255, 255, .6); font-size: .92rem; }
.footer-band { background: var(--yellow); color: var(--navy); font-weight: 800; text-align: center; padding: 1.1rem 0; font-size: clamp(1.1rem, 2.4vw, 1.5rem); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; padding: 1.6rem 0; }
.footer-logo { height: 40px; width: auto; }
.footer-inner p { margin: 0; }
.site-footer a { color: rgba(255, 255, 255, .8); }

/* ---------- Pagina privacy ---------- */

.legal { padding: 3.5rem 0 4.5rem; }
.legal h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); }
.legal h2 { font-size: 1.2rem; margin-top: 2rem; }
.legal p { color: var(--muted); }

/* ---------- Animazioni di comparsa ---------- */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .reveal { opacity: 1; transform: none; transition: none; }
    .ribbon-track { animation: none; }
    .btn, .subject-link { transition: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
    .features { grid-template-columns: repeat(2, 1fr); }
    .contact-inner { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .audience-grid,
    .steps { grid-template-columns: 1fr; }
    .subject-card { flex-basis: calc(50% - .65rem); }
    .subject-link { padding: 1.4rem 1rem 1.2rem; }
    .subject-desc { display: none; }
}

@media (max-width: 560px) {
    .form-row,
    .features { grid-template-columns: 1fr; gap: 0 1rem; }
    .features { gap: 1.5rem; }
    .subject-icon { width: 70px; height: 70px; }
    .subject-icon svg { width: 48px; height: 48px; }
    .subject-name { font-size: 1rem; }
    .hero-actions .btn { width: 100%; }
}
