/* =========================================================
   nonprofitgest.it — design tokens
   Palette ancorata ai colori reali del gestionale (screenshot):
   teal per la navigazione, verde per le entrate/bilancio,
   ocra per le call to action. Sfondo carta chiaro, non il
   classico crema #F4F1EA.
   ========================================================= */
:root {
    --bg: #F5F6F2;
    --bg-alt: #E9F1EE;
    --ink: #16221F;
    --ink-soft: #4A5854;
    --teal-deep: #0D5F58;
    --teal: #1C9C90;
    --teal-tint: #DCEEEB;
    --green: #2F9E52;
    --amber: #E2892E;
    --amber-deep: #C36F1C;
    --line: #D6DCD8;
    --white: #FFFFFF;

    --font-display: "Newsreader", Georgia, serif;
    --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    --max-width: 1180px;
    --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--ink);
    line-height: 1.15;
    margin: 0 0 0.5em;
    font-weight: 600;
}

h1 { font-size: clamp(2.1rem, 4vw, 3.1rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--teal-deep); }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
    outline: 3px solid var(--amber);
    outline-offset: 2px;
}

img { max-width: 100%; display: block; }

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

/* ---------- Header ---------- */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
}
.brand strong {
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: -0.01em;
}
.brand span {
    font-size: 0.8rem;
    color: var(--ink-soft);
}
.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a {
    text-decoration: none;
    color: var(--ink-soft);
    font-size: 0.95rem;
}
.main-nav a:hover { color: var(--teal-deep); }
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 10px;
    font-size: 1.1rem;
    cursor: pointer;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.98rem;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-body);
}
.btn-primary {
    background: var(--amber);
    color: #241203;
}
.btn-primary:hover { background: var(--amber-deep); }
.btn-ghost {
    background: transparent;
    border-color: var(--ink);
    color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--white); }
.btn-small { padding: 8px 16px; font-size: 0.88rem; }

/* ---------- Hero ---------- */
.hero {
    padding: 64px 0 80px;
    overflow: hidden;
}
.hero .container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
}
.hero-eyebrow {
    display: inline-block;
    background: var(--teal-tint);
    color: var(--teal-deep);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 18px;
}
.hero-kicker { color: var(--ink-soft); font-size: 1.12rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-note { margin-top: 16px; font-size: 0.88rem; color: var(--ink-soft); }

.hero-frame {
    position: relative;
}
.hero-frame::before {
    content: "";
    position: absolute;
    inset: -18px -18px auto auto;
    width: 78%;
    height: 78%;
    background: var(--teal-tint);
    border-radius: 14px;
    z-index: 0;
}
.browser-shot {
    position: relative;
    z-index: 1;
    background: var(--white);
    border-radius: 10px;
    border: 1px solid var(--line);
    box-shadow: 0 24px 50px -20px rgba(13, 95, 88, 0.35);
    overflow: hidden;
    transform: rotate(-1.4deg);
}
.browser-shot .bar {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: #EFEFEC;
    border-bottom: 1px solid var(--line);
}
.browser-shot .bar span {
    width: 9px; height: 9px; border-radius: 50%; background: #C9CDC9;
}
.browser-shot img { width: 100%; }

/* ---------- Sezioni generiche ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 68ch; margin-bottom: 40px; }
.section-head p { color: var(--ink-soft); }

/* ---------- Per chi (ASD/SSD vs APS/ETS) ---------- */
.audience-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}
.audience-col {
    padding: 36px;
    background: var(--white);
}
.audience-col + .audience-col { border-left: 1px solid var(--line); }
.audience-col .tag {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 14px;
}
.audience-col.asd .tag { background: var(--teal-tint); color: var(--teal-deep); }
.audience-col.aps .tag { background: #FCEBDA; color: var(--amber-deep); }
.audience-col ul { margin: 18px 0 0; padding-left: 20px; color: var(--ink-soft); }
.audience-col li { margin-bottom: 8px; }
.audience-col figure { margin: 20px 0 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }

/* ---------- Moduli funzionalità (lista, non card) ---------- */
.module-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-top: 1px solid var(--line);
}
.module-item {
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
    padding-right: 30px;
}
.module-item:nth-child(odd) { padding-right: 40px; border-right: 1px solid var(--line); padding-right: 40px; padding-left:0; }
.module-item:nth-child(even) { padding-left: 40px; }
.module-item h3 { margin-bottom: 6px; font-size: 1.15rem; }
.module-item p { color: var(--ink-soft); margin-bottom: 0; font-size: 0.97rem; }
.module-item .num {
    font-family: var(--font-display);
    color: var(--teal);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 6px;
}

/* ---------- Banda convenzione ASC ---------- */
.convenzione {
    background: var(--teal-deep);
    color: #EAF4F2;
    padding: 56px 0;
}
.convenzione .container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    align-items: center;
}
.convenzione h2 { color: #fff; }
.convenzione p { color: #CFE6E2; }
.convenzione .price {
    text-align: right;
}
.convenzione .price .amount {
    font-family: var(--font-display);
    font-size: 3rem;
    color: #fff;
    line-height: 1;
}
.convenzione .price .was {
    text-decoration: line-through;
    color: #8FBFB8;
    font-size: 0.95rem;
}
.convenzione .logos {
    display: flex;
    gap: 22px;
    margin-top: 24px;
    flex-wrap: wrap;
    align-items: center;
}
.convenzione .logos img { height: 46px; width: auto; filter: brightness(0) invert(1); opacity: 0.9; }

/* ---------- Bilanci (screenshot doppio) ---------- */
.balances { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.balance-card { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--white); }
.balance-card figure { margin: 0; }
.balance-card figcaption { padding: 16px 20px; font-size: 0.92rem; color: var(--ink-soft); border-top: 1px solid var(--line); }
.balance-card figcaption strong { color: var(--ink); }

/* ---------- CTA finale ---------- */
.cta-band {
    background: var(--ink);
    color: var(--white);
    padding: 60px 0;
    text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #C6CDC9; margin: 0 auto 26px; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--line);
    padding: 48px 0 28px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.footer-grid h4 { font-size: 0.95rem; color: var(--ink); margin-bottom: 10px; }
.footer-grid a { display: block; color: var(--ink-soft); text-decoration: none; margin-bottom: 6px; }
.footer-grid a:hover { color: var(--teal-deep); }
.footer-partners { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.footer-partners img { height: 34px; width: auto; opacity: 0.85; }
.footer-bottom {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* ---------- Form ---------- */
.form-page-head { max-width: 70ch; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 36px;
    margin-top: 30px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 0.8rem; color: var(--ink-soft); font-weight: 400; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field select {
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.97rem;
    background: var(--bg);
}
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 6px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 400;
}
.checkbox-item input { width: 17px; height: 17px; }
.field-inline { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--ink-soft);
}
.consent-row input { margin-top: 4px; width: 17px; height: 17px; flex-shrink: 0; }
.form-alert {
    grid-column: 1 / -1;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 0.92rem;
}
.form-alert.error { background: #FBEAE8; color: #8A2A20; border: 1px solid #EBC3BC; }
.form-alert.success { background: #E4F3E9; color: #1D6B37; border: 1px solid #BFE2CC; }
.recaptcha-note { grid-column: 1 / -1; font-size: 0.78rem; color: var(--ink-soft); }

/* ---------- Pagine legali ---------- */
.legal-page .container { max-width: 820px; }
.legal-page h2 { margin-top: 2em; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 0.92rem; }
.legal-page th, .legal-page td { text-align: left; padding: 10px 12px; border: 1px solid var(--line); vertical-align: top; }
.legal-page th { background: var(--bg-alt); }

/* ---------- Cookie banner ---------- */
#cookie-banner {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    max-width: 640px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 20px 50px -20px rgba(0,0,0,0.35);
    padding: 24px;
    z-index: 100;
}
#cookie-banner p { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 16px; }
#cookie-banner .actions { display: flex; gap: 10px; flex-wrap: wrap; }
#cookie-modal {
    position: fixed;
    inset: 0;
    background: rgba(22, 34, 31, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 110;
    padding: 20px;
}
#cookie-modal .box {
    background: var(--white);
    border-radius: 12px;
    max-width: 560px;
    width: 100%;
    padding: 30px;
    max-height: 85vh;
    overflow-y: auto;
}
.cookie-category { border-top: 1px solid var(--line); padding: 16px 0; display: flex; justify-content: space-between; gap: 20px; }
.cookie-category h4 { margin: 0 0 6px; font-size: 1rem; }
.cookie-category p { font-size: 0.85rem; margin: 0; color: var(--ink-soft); }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: 0.2s;
}
.switch .slider::before {
    content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
    background: var(--white); border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--teal); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

/* ---------- Utilità skip-link ---------- */
.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--ink);
    color: #fff;
    padding: 10px 16px;
    z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

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

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero .container { grid-template-columns: 1fr; }
    .hero-frame { order: -1; }
    .audience-grid { grid-template-columns: 1fr; }
    .audience-col + .audience-col { border-left: none; border-top: 1px solid var(--line); }
    .module-list { grid-template-columns: 1fr; }
    .module-item:nth-child(odd) { border-right: none; padding-right: 0; }
    .module-item:nth-child(even) { padding-left: 0; }
    .convenzione .container { grid-template-columns: 1fr; text-align: left; }
    .convenzione .price { text-align: left; }
    .balances { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; padding: 24px; }
    .checkbox-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .main-nav { display: none; }
    .nav-toggle { display: inline-flex; }
    .main-nav.open {
        display: flex;
        position: absolute;
        top: 72px; left: 0; right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--line);
        flex-direction: column;
        padding: 16px 24px;
        gap: 16px;
    }
    .footer-grid { grid-template-columns: 1fr; }
    .checkbox-grid { grid-template-columns: 1fr; }
}
