/* ============================================
   Bandi Lazio 2026 - public page
   Estende ../zls_zes/style.css
   ============================================ */

/* --- Sticky event banner (apertura sportello) --- */
.event-banner {
    background: linear-gradient(90deg, #164068 0%, #1e5384 50%, #164068 100%);
    color: #f1f5f9;
    padding: 8px 0;
    font-size: 0.84rem;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 60;
}
.event-banner-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.event-banner-pill {
    background: #d4a444;
    color: #1f1304;
    border-radius: 999px;
    padding: 2px 10px;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.event-banner-text { opacity: 0.96; }
.event-banner-text a {
    color: #fde68a;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.event-banner-text a:hover { color: #fff; }

/* Push the navbar below the event banner */
.navbar { top: 33px; }
@media (max-width: 600px) { .navbar { top: 56px; } }

/* --- Container narrow for the wizard --- */
.container-narrow {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   BANDO BLOCKS (descrizione dettagliata)
   ============================================ */

.bando-summary {
    background: #fff;
    border: 1px solid rgba(22, 64, 104, 0.1);
    border-radius: 16px;
    padding: 8px;
    margin: 0 0 36px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.bando-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0;
}
.bando-summary-cell {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid #f1f5f9;
}
.bando-summary-cell:last-child { border-right: none; }
@media (max-width: 700px) {
    .bando-summary-cell { border-right: none; border-bottom: 1px solid #f1f5f9; }
    .bando-summary-cell:last-child { border-bottom: none; }
}
.bando-summary-label {
    font-size: 0.72rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
}
.bando-summary-value {
    font-size: 1.4rem;
    color: #164068;
    font-weight: 800;
    line-height: 1.15;
}
.bando-summary-foot {
    font-size: 0.76rem;
    color: #64748b;
    line-height: 1.4;
}

/* Bando blocks (paragraphs with heading) */
.bando-block {
    margin: 0 0 32px;
    padding-bottom: 32px;
    border-bottom: 1px dashed #e2e8f0;
}
.bando-block:last-of-type { border-bottom: none; padding-bottom: 0; }
.bando-block h3 {
    color: #164068;
    font-size: 1.25rem;
    margin: 0 0 12px;
    font-weight: 700;
    line-height: 1.3;
}
.bando-block h4 {
    color: #1f3a5f;
    font-size: 1rem;
    margin: 18px 0 8px;
    font-weight: 600;
}
.bando-block p {
    color: #334155;
    line-height: 1.65;
    margin: 0 0 12px;
}
.bando-block p:last-child { margin-bottom: 0; }
.bando-foot {
    font-size: 0.86rem;
    color: #64748b;
    margin-top: 12px;
}

.bando-list {
    list-style: none;
    padding: 0;
    margin: 0 0 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bando-list li {
    padding: 10px 14px 10px 36px;
    background: #f8fafc;
    border-radius: 8px;
    color: #334155;
    line-height: 1.55;
    position: relative;
    font-size: 0.94rem;
}
.bando-list li::before {
    content: "•";
    position: absolute;
    left: 14px;
    top: 9px;
    color: #164068;
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1;
}
.bando-list-checked li {
    background: #f0f9f4;
    border-left: 3px solid #10b981;
}
.bando-list-checked li::before {
    content: "✓";
    color: #047857;
    font-size: 1rem;
    top: 11px;
}
.bando-list-x li {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
}
.bando-list-x li::before {
    content: "✕";
    color: #b91c1c;
    font-size: 0.95rem;
    top: 11px;
}

/* Timeline (tempistiche) */
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 8px;
}
.timeline-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 700px) { .timeline-grid, .timeline-grid-3 { grid-template-columns: 1fr; } }
.timeline-step {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    border-top: 4px solid #cbd5e1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.timeline-step-key { border-top-color: #d4a444; background: #fffbf3; }
.timeline-when {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.timeline-what {
    font-size: 1rem;
    color: #164068;
    font-weight: 700;
    line-height: 1.3;
}
.timeline-what-pct {
    font-size: 1.6rem;
    color: #b45309;
    font-weight: 800;
}
.timeline-desc {
    font-size: 0.86rem;
    color: #475569;
    line-height: 1.5;
}

/* Bando CTA row (pulsanti documenti, secondari) */
.bando-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
    justify-content: center;
}

/* Bando CTA simulatore: pulsante centrato, prominente, con gradient + arrow animata */
.bando-cta-sim {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}
.btn-sim-cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 18px 38px;
    font-size: 1.02rem;
    font-weight: 700;
    font-family: inherit;
    color: #fff;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: linear-gradient(135deg, #164068 0%, #1e5384 55%, #d4a444 180%);
    background-size: 180% 180%;
    background-position: 0% 50%;
    border: none;
    border-radius: 999px;
    box-shadow:
        0 12px 28px rgba(22, 64, 104, 0.32),
        0 4px 8px rgba(22, 64, 104, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition:
        transform 0.25s cubic-bezier(.22, 1, .36, 1),
        box-shadow 0.25s ease,
        background-position 0.6s ease;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.btn-sim-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.7s cubic-bezier(.22, 1, .36, 1);
    z-index: -1;
}
.btn-sim-cta:hover {
    transform: translateY(-3px);
    background-position: 100% 50%;
    box-shadow:
        0 18px 38px rgba(22, 64, 104, 0.45),
        0 6px 12px rgba(212, 164, 68, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
    color: #fff;
}
.btn-sim-cta:hover::before {
    transform: translateX(100%);
}
.btn-sim-cta:active {
    transform: translateY(-1px);
}
.btn-sim-cta-text { white-space: nowrap; }
.btn-sim-cta-arrow {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.35s cubic-bezier(.22, 1, .36, 1);
    animation: btn-sim-cta-bounce 2.4s ease-in-out infinite;
}
.btn-sim-cta:hover .btn-sim-cta-arrow {
    animation: none;
    transform: translateY(4px) scale(1.08);
}
@keyframes btn-sim-cta-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40%           { transform: translateY(4px); }
}
@media (prefers-reduced-motion: reduce) {
    .btn-sim-cta,
    .btn-sim-cta::before,
    .btn-sim-cta-arrow { transition: none; animation: none; }
    .btn-sim-cta:hover { transform: none; }
}
@media (max-width: 600px) {
    .btn-sim-cta {
        padding: 16px 28px;
        font-size: 0.92rem;
        width: 100%;
        max-width: 360px;
        justify-content: center;
    }
}

/* ============================================
   WIZARD (riprendo dalla demo + adattamenti)
   ============================================ */

/* Progress bar */
.wizard-progress { margin-bottom: 32px; }
.wizard-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(22, 64, 104, 0.1);
    border-radius: 999px;
    overflow: hidden;
}
.wizard-progress-bar > span {
    display: block;
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #164068, #d4a444);
    border-radius: 999px;
    transition: width 0.4s ease;
}
.wizard-steps {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
    overflow-x: auto;
}
.wizard-steps li {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    opacity: 0.55;
    transition: opacity 0.3s ease, color 0.3s ease;
}
.wizard-steps li > span {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.72rem;
    flex-shrink: 0;
    transition: background 0.3s ease, color 0.3s ease;
}
.wizard-steps li.active { opacity: 1; color: #164068; }
.wizard-steps li.active > span {
    background: #164068; color: #fff;
    box-shadow: 0 0 0 4px rgba(22, 64, 104, 0.12);
}
.wizard-steps li.done { opacity: 1; color: #047857; }
.wizard-steps li.done > span { background: #047857; color: #fff; }

/* Card */
.wizard-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 36px 36px 28px;
    box-shadow: 0 14px 38px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(22, 64, 104, 0.08);
    margin-bottom: 24px;
}
@media (max-width: 600px) { .wizard-card { padding: 24px 18px; } }

.wizard-eyebrow {
    display: inline-block;
    background: rgba(22, 64, 104, 0.08);
    color: #164068;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.wizard-card h2 {
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    margin: 0 0 12px;
    color: #0f172a;
    line-height: 1.2;
}
.wizard-lead {
    color: #475569;
    font-size: 0.98rem;
    line-height: 1.55;
    margin: 0 0 24px;
}

/* Eligibility questionnaire: each fieldset diventa una card numerata
   automaticamente via CSS counter (counter-reset sulle wrap NFPC/NFF). */
[data-eligibility] {
    counter-reset: q;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.wizard-fieldset {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px 18px;
    margin: 0;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    counter-increment: q;
}
.wizard-fieldset:hover { border-color: #cbd5e1; }
.wizard-fieldset:focus-within {
    border-color: #164068;
    box-shadow: 0 0 0 3px rgba(22, 64, 104, 0.08);
}
.wizard-fieldset > legend {
    font-weight: 600;
    color: #0f2944;
    font-size: 1rem;
    line-height: 1.35;
    padding: 0;
    margin: 0 0 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}
[data-eligibility] .wizard-fieldset > legend::before {
    content: counter(q);
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #164068 0%, #1e5384 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.78rem;
    box-shadow: 0 2px 6px rgba(22, 64, 104, 0.25);
    margin-top: -1px;
}
.wizard-fieldset .hint-text {
    font-size: 0.82rem;
    color: #64748b;
    margin: 0 0 12px 36px;
    line-height: 1.5;
}
[data-eligibility] .wizard-fieldset .option-row,
[data-eligibility] .wizard-fieldset .wizard-input {
    margin-left: 36px;
}
@media (max-width: 600px) {
    .wizard-fieldset { padding: 16px 16px 14px; }
    .wizard-fieldset .hint-text,
    [data-eligibility] .wizard-fieldset .option-row,
    [data-eligibility] .wizard-fieldset .wizard-input {
        margin-left: 0;
    }
    [data-eligibility] .wizard-fieldset > legend::before {
        width: 24px; height: 24px; font-size: 0.74rem;
    }
}

/* Option grid (big cards) */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.option-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.option-card:hover {
    border-color: #d4a444;
    background: #fffbf3;
    transform: translateY(-1px);
}
.option-card input[type="radio"] {
    margin-top: 4px;
    accent-color: #164068;
    flex-shrink: 0;
}
.option-card > div { display: flex; flex-direction: column; gap: 2px; }
.option-card strong { color: #0f172a; font-size: 0.95rem; }
.option-card span { color: #64748b; font-size: 0.82rem; line-height: 1.4; }
.option-card:has(input:checked) {
    border-color: #164068;
    background: #f1f5fb;
    box-shadow: inset 0 0 0 1px #164068;
}

/* Option pills (compact) */
.option-row { display: flex; flex-wrap: wrap; gap: 8px; }
.option-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.86rem;
    color: #334155;
    transition: all 0.18s;
    user-select: none;
}
.option-pill:hover { border-color: #d4a444; background: #fffbf3; }
.option-pill input[type="radio"] { accent-color: #164068; margin: 0; }
.option-pill:has(input:checked) {
    background: #164068;
    border-color: #164068;
    color: #fff;
    font-weight: 600;
}
.option-pill:has(input:checked) input { accent-color: #fff; }

/* Inputs */
.wizard-input {
    width: 100%;
    max-width: 200px;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: #0f172a;
    background: #f8fafc;
    transition: border-color 0.2s, background 0.2s;
}
.wizard-input:focus {
    outline: none;
    border-color: #164068;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 64, 104, 0.12);
}

.wizard-routing-hint {
    margin: 16px 0 0;
    padding: 12px 16px;
    background: #fff8e1;
    border-left: 3px solid #d4a444;
    border-radius: 6px;
    font-size: 0.88rem;
    color: #5a4214;
    line-height: 1.5;
}

.wizard-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    flex-wrap: wrap;
}
.wizard-actions .btn-outline { margin-right: auto; }
.wizard-actions .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* Back button: chip prominente, sempre alla sinistra del pulsante "Avanti" */
.wizard-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #fff;
    border: 1.5px solid #cbd5e1;
    color: #475569;
    cursor: pointer;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    line-height: 1;
    margin-right: auto;
    transition:
        background 0.18s ease,
        border-color 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s cubic-bezier(.22, 1, .36, 1);
    -webkit-tap-highlight-color: transparent;
}
.wizard-back-btn span { white-space: nowrap; }
.wizard-back-btn svg {
    flex-shrink: 0;
    transition: transform 0.25s cubic-bezier(.22, 1, .36, 1);
}
.wizard-back-btn:hover {
    border-color: #164068;
    background: #f1f5fb;
    color: #164068;
    box-shadow: 0 4px 12px rgba(22, 64, 104, 0.12);
    transform: translateY(-1px);
}
.wizard-back-btn:hover svg { transform: translateX(-3px); }
.wizard-back-btn:active { transform: translateY(0); }
.wizard-back-btn:focus-visible {
    outline: none;
    border-color: #164068;
    box-shadow: 0 0 0 3px rgba(22, 64, 104, 0.18);
}
@media (prefers-reduced-motion: reduce) {
    .wizard-back-btn,
    .wizard-back-btn svg { transition: none; }
    .wizard-back-btn:hover { transform: none; }
}
@media (max-width: 600px) {
    .wizard-actions { gap: 10px; }
    .wizard-back-btn {
        order: 2;
        width: 100%;
        justify-content: center;
        padding: 11px 18px;
        margin-right: 0;
    }
    .wizard-actions .btn-primary {
        order: 1;
        width: 100%;
    }
}

/* ============================================
   RESULT (esito eligibility)
   ============================================ */
.result-card {
    border-radius: 16px;
    padding: 0;
    margin-top: 4px;
    border-left: 6px solid currentColor;
    overflow: hidden;
    background: #fff;
}
.result-card.result-green { color: #047857; border-color: #10b981; }
.result-card.result-yellow { color: #b45309; border-color: #f59e0b; }
.result-card.result-red { color: #b91c1c; border-color: #ef4444; }

/* Spotlight: il bando in grande, con badge stato */
.result-spotlight {
    padding: 28px 28px 24px;
    text-align: center;
    background: #fff;
    position: relative;
}
.result-card.result-green .result-spotlight {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
}
.result-card.result-yellow .result-spotlight {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.10) 0%, rgba(245, 158, 11, 0.02) 100%);
}
.result-card.result-red .result-spotlight {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.08) 0%, rgba(239, 68, 68, 0.02) 100%);
}
.result-spotlight-label {
    display: block;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    margin-bottom: 10px;
}
.result-spotlight-name-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
}
.result-spotlight-name {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 1.95rem);
    font-weight: 800;
    color: #0f2944;
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.result-spotlight-short {
    display: inline-flex;
    align-items: center;
    background: #164068;
    color: #fff;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 4px 10px;
    border-radius: 6px;
}
.result-spotlight-status {
    display: inline-block;
    margin-top: 14px;
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: currentColor;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}
.result-card.result-green .result-spotlight-status { background: #10b981; }
.result-card.result-yellow .result-spotlight-status { background: #f59e0b; }
.result-card.result-red .result-spotlight-status { background: #ef4444; }

/* Verdict: titolo + descrizione */
.result-verdict {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 28px;
    background: rgba(255, 255, 255, 0.8);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.result-verdict .result-emoji {
    flex-shrink: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: currentColor;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
}
.result-card.result-green .result-emoji { background: #10b981; }
.result-card.result-yellow .result-emoji { background: #f59e0b; }
.result-card.result-red .result-emoji { background: #ef4444; }
.result-verdict-body { flex: 1; min-width: 0; }
.result-verdict-title {
    margin: 0 0 6px;
    font-size: 1.08rem;
    font-weight: 700;
    color: inherit;
    line-height: 1.3;
}
.result-verdict-summary {
    margin: 0;
    color: #334155;
    line-height: 1.55;
    font-size: 0.94rem;
}

/* Punto per punto */
.result-checks-title {
    margin: 22px 28px 12px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}
.result-checks {
    list-style: none;
    padding: 0 28px 28px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.result-checks li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    color: #1f2937;
    font-size: 0.9rem;
    line-height: 1.45;
    border: 1px solid #f1f5f9;
}
.result-checks li .ck {
    flex-shrink: 0;
    width: 20px; height: 20px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}
.result-checks .ck-ok { background: #10b981; }
.result-checks .ck-warn { background: #f59e0b; }
.result-checks .ck-ko { background: #ef4444; }

@media (max-width: 600px) {
    .result-spotlight { padding: 22px 18px 20px; }
    .result-verdict { padding: 18px; gap: 12px; }
    .result-verdict .result-emoji { width: 36px; height: 36px; font-size: 1.15rem; }
    .result-checks-title { margin: 18px 18px 10px; }
    .result-checks { padding: 0 18px 22px; }
}

/* SIMULATOR */
.sim-controls { margin: 4px 0 28px; }
.sim-amount-label { font-size: 0.95rem; color: #475569; }
.sim-amount-label strong { color: #164068; font-size: 1.4rem; font-weight: 800; }

.sim-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #164068, #d4a444);
    outline: none;
    margin: 14px 0 6px;
    cursor: pointer;
}
.sim-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #164068;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(22, 64, 104, 0.3);
    transition: transform 0.15s;
}
.sim-slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.sim-slider::-moz-range-thumb {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #164068;
    cursor: grab;
    box-shadow: 0 2px 8px rgba(22, 64, 104, 0.3);
}
.sim-amount-bounds {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: #94a3b8;
}

.sim-toggle { margin-top: 22px; padding-top: 18px; border-top: 1px dashed #e2e8f0; }
.switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch-track {
    width: 44px; height: 24px;
    background: #cbd5e1;
    border-radius: 999px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}
.switch-track::before {
    content: "";
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-track { background: #d4a444; }
.switch input:checked + .switch-track::before { transform: translateX(20px); }
.switch-text { font-size: 0.9rem; color: #334155; }

.sim-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.sim-kpi {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px 18px;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sim-kpi-label {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.sim-kpi-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #164068;
    line-height: 1.1;
}
.sim-kpi-foot { font-size: 0.76rem; color: #94a3b8; line-height: 1.4; }
.sim-kpi-highlight {
    background: linear-gradient(135deg, #fff8e1, #fffbf3);
    border-color: #d4a444;
}
.sim-kpi-highlight .sim-kpi-value { color: #b45309; }

.sim-chart-block { margin: 18px 0 22px; }
.sim-chart-block h3 { font-size: 1rem; color: #164068; margin: 0 0 12px; }
.sim-chart-wrap {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px 12px 12px;
    overflow: hidden;
}
.sim-chart-wrap svg { width: 100%; height: 220px; display: block; }
.sim-chart-legend {
    margin-top: 10px;
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}
.sim-chart-legend .lg {
    display: inline-block;
    width: 14px; height: 4px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}
.lg-preamm { background: #cbd5e1; }
.lg-ammort { background: #164068; }
.lg-abb { background: #d4a444; }

.sim-tranche { margin: 18px 0 22px; }
.sim-tranche h3 { font-size: 1rem; color: #164068; margin: 0 0 12px; }
.tranche-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 600px) { .tranche-grid { grid-template-columns: 1fr; } }
.tranche-step {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #d4a444;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tranche-pct { font-size: 1.4rem; font-weight: 800; color: #b45309; }
.tranche-when { font-size: 0.82rem; color: #64748b; }
.tranche-amt { font-size: 1.05rem; font-weight: 700; color: #164068; }

.sim-table-wrap {
    margin-top: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    padding: 0;
}
.sim-table-wrap > summary {
    cursor: pointer;
    padding: 12px 16px;
    font-weight: 600;
    color: #164068;
    font-size: 0.9rem;
    list-style-position: inside;
}
.sim-table-wrap[open] > summary { border-bottom: 1px solid #e2e8f0; }
.sim-table-scroll { max-height: 320px; overflow-y: auto; }
.sim-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.sim-table th, .sim-table td {
    padding: 8px 14px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}
.sim-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #475569;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 1;
}
.sim-table td:nth-child(3),
.sim-table td:nth-child(4),
.sim-table th:nth-child(3),
.sim-table th:nth-child(4) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.sim-table tr.preamm-row td { color: #94a3b8; font-style: italic; }
.sim-table tr.abbuono-row td { color: #b45309; font-weight: 600; }

.wizard-disclaimer {
    margin-top: 18px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.5;
    border-left: 3px solid #cbd5e1;
}

/* LEAD FORM */
.lead-summary {
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #f1f5fb;
    border: 1px solid rgba(22, 64, 104, 0.15);
    border-radius: 10px;
    font-size: 0.88rem;
    color: #1e3a5f;
    line-height: 1.6;
}
.lead-summary strong { color: #164068; }
.lead-summary .lead-summary-pill {
    display: inline-block;
    background: #164068;
    color: #fff;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-right: 6px;
}

.wizard-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 0; }
@media (max-width: 600px) { .wizard-form .form-row { grid-template-columns: 1fr; gap: 0; } }
.wizard-form .form-group { margin-bottom: 14px; }
.wizard-form .form-group label {
    display: block;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 6px;
    font-weight: 500;
}
.wizard-form .form-group input[type="text"],
.wizard-form .form-group input[type="email"],
.wizard-form .form-group input[type="tel"] {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #0f172a;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.wizard-form .form-group input:focus {
    outline: none;
    border-color: #164068;
    box-shadow: 0 0 0 3px rgba(22, 64, 104, 0.12);
}
.wizard-form .form-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 8px;
}
.wizard-form .form-check input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #164068;
}
.wizard-form .form-check label {
    font-size: 0.82rem;
    color: #475569;
    line-height: 1.45;
    margin-bottom: 0;
    font-weight: 400;
}
.form-optional { color: #94a3b8; font-weight: 400; font-size: 0.78rem; }

/* CTA single (no form on the right) */
.cta-single { grid-template-columns: 1fr !important; }
.cta-single .cta-text { max-width: 720px; margin: 0 auto; text-align: center; }
.cta-single .contact-info { justify-content: center; }

/* ============================================
   MOBILE IMPROVEMENTS
   Tutto il fine-tuning responsive in fondo per comodita: niente
   override sparpagliati, basta scrollare qui per vedere come la
   pagina si comporta sotto 1024px (tablet), 640px (smartphone medi)
   e 380px (smartphone piccoli).
   ============================================ */
@media (max-width: 1024px) {
    /* Tablet portrait + smartphone landscape: la pagina si stringe ma
       resta a 2 colonne dove ha senso. */
    .container { padding: 0 20px; }
    .container-narrow { padding: 0 20px; }
    .hero h1 { font-size: clamp(2rem, 5.5vw, 3rem); }
    .hero-subtitle { font-size: 1.05rem; }
    .section { padding: 72px 0; }
    .bando-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .bando-summary-cell { padding: 14px 16px; }
    .bando-summary-value { font-size: 1.25rem; line-height: 1.2; }
    .area-cards { grid-template-columns: 1fr 1fr; gap: 20px; }
    .area-card { padding: 36px 28px; }
    .area-card .area-percent { font-size: 2rem; line-height: 1.2; }
    .area-card h3 { font-size: 1.4rem; }
}

@media (max-width: 640px) {
    /* Container piu stretto: recupero ~16px per lato sui display piccoli */
    .container,
    .container-narrow { padding: 0 16px; }

    /* Event banner: font piu piccolo, padding ridotto, allineamento
       a colonna se non ci sta in una riga */
    .event-banner {
        padding: 7px 0;
        font-size: 0.78rem;
        line-height: 1.35;
    }
    .event-banner-inner {
        gap: 8px;
        padding: 0 12px;
    }
    .event-banner-pill {
        font-size: 0.62rem;
        padding: 2px 8px;
    }

    /* Navbar offset: la altezza dell'event banner cambia in base a
       quante righe occupa. Calcolata in modo che la navbar non si
       sovrapponga mai al banner anche se il testo va a 2-3 righe. */
    .navbar { top: 60px; }

    /* Hero: titoli piu piccoli, sottotitolo con respiro coerente.
       I <br> nell'HTML diventano spazi cosi il testo si compone in
       maniera fluida senza spezzature innaturali. */
    .hero h1 { font-size: clamp(1.7rem, 8vw, 2.4rem); }
    .hero-subtitle { font-size: 0.95rem; line-height: 1.55; }
    .hero-subtitle br { display: none; }
    .hero-actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .hero-actions .btn { width: 100%; text-align: center; }

    /* Hero stats: impilati in colonna come righe scannabili. Numero
       grande a sinistra, label a destra: a colpo d'occhio si capisce
       subito il "quanto puoi avere", che e' il vero valore della pagina. */
    .hero-stats {
        flex-direction: column;
        gap: 8px;
        margin-top: 28px;
        align-items: stretch;
    }
    .hero-stats .stat {
        display: flex;
        align-items: baseline;
        justify-content: flex-start;
        gap: 14px;
        padding: 12px 16px;
        text-align: left;
        background: rgba(255, 255, 255, 0.06);
        border-left: 3px solid #d4a444;
        border-radius: 8px;
    }
    .hero-stats .stat-divider { display: none; }
    .hero-stats .stat-number {
        font-size: 1.6rem;
        flex-shrink: 0;
        min-width: 80px;
    }
    .hero-stats .stat-label {
        font-size: 0.84rem;
        line-height: 1.35;
        opacity: 0.85;
    }

    /* Area-cards "Quale dei due bandi fa al caso tuo?": ridotti
       padding e tipografia per stare bene sul telefono. La voce
       "da 10.000 a 50.000 euro" non puo restare a 3rem (48px), va
       sotto i 24px per non andare a capo brutto. */
    .area-cards { gap: 16px; max-width: 100%; }
    .area-card {
        padding: 26px 22px;
        border-radius: 14px;
        text-align: left;
    }
    .area-card h3 { font-size: 1.3rem; margin-bottom: 6px; }
    .area-card .area-label {
        font-size: 0.82rem;
        margin-bottom: 12px;
        line-height: 1.4;
    }
    .area-card .area-percent {
        font-size: 1.45rem;
        line-height: 1.2;
        margin-bottom: 10px;
        letter-spacing: -0.5px;
    }
    .area-card .area-desc {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 18px;
    }
    .area-card .btn { padding: 12px 18px; font-size: 0.9rem; }

    /* Bando block headings: piu compatti */
    .bando-block { margin-bottom: 24px; padding-bottom: 24px; }
    .bando-block h3 { font-size: 1.1rem; }
    .bando-block h4 { font-size: 0.95rem; }
    .bando-list li { font-size: 0.9rem; padding: 10px 12px 10px 32px; }
    .bando-list li::before { left: 12px; }

    /* Bando-summary cells: piu respiro verticale */
    .bando-summary { margin-bottom: 28px; }
    .bando-summary-cell { padding: 14px 16px; }
    .bando-summary-value { font-size: 1.25rem; }

    /* Bando-cta (PDF + Lazio Innova): impilati full-width per touch */
    .bando-cta { flex-direction: column; gap: 10px; }
    .bando-cta .btn { width: 100%; text-align: center; }

    /* Bando-cta-sim: la pillola CTA gia diventa full-width grazie
       alla regola sopra, ma riduco il padding verticale per riempire
       meno spazio */
    .btn-sim-cta { padding: 14px 22px; gap: 10px; }
    .btn-sim-cta-arrow { width: 18px; height: 18px; }

    /* Wizard progress: testo dei passi piu piccolo, scroll-x sicuro */
    .wizard-progress { margin-bottom: 24px; }
    .wizard-steps {
        font-size: 0.7rem;
        gap: 4px;
        margin-top: 10px;
        padding-bottom: 4px; /* spazio per scrollbar */
    }
    .wizard-steps li > span { width: 20px; height: 20px; font-size: 0.66rem; }

    /* Wizard card: padding leggermente piu compatto */
    .wizard-card { padding: 22px 16px 20px; border-radius: 14px; }
    .wizard-eyebrow { font-size: 0.68rem; padding: 3px 10px; margin-bottom: 14px; }
    .wizard-card h2 { font-size: 1.3rem; }
    .wizard-lead { font-size: 0.92rem; margin-bottom: 18px; }

    /* Routing: option-card a colonna unica (non c'e abbastanza spazio
       per due da 220px). Touch target di almeno ~56px sull'altezza. */
    .option-grid { grid-template-columns: 1fr; gap: 10px; }
    .option-card { padding: 16px; }

    /* Option-pill (eligibility): full-width per dito facile, evita
       le righe orfane a pillola singola che spaccano l'allineamento.
       Tap area di almeno 44px (linee guida iOS / Android). */
    .option-row { flex-direction: column; gap: 8px; }
    .option-pill {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 16px;
        font-size: 0.92rem;
        min-height: 44px;
        box-sizing: border-box;
    }

    /* Wizard input ATECO: full-width sotto i 640px */
    .wizard-input { max-width: none; padding: 12px 14px; font-size: 0.95rem; }

    /* Routing hint balloon: piu respiro */
    .wizard-routing-hint {
        margin-top: 12px;
        padding: 12px 14px;
        font-size: 0.85rem;
    }

    /* Slider thumb piu grasso per il touch (32px invece di 22px) */
    .sim-slider { height: 8px; }
    .sim-slider::-webkit-slider-thumb {
        width: 30px; height: 30px;
        border-width: 4px;
    }
    .sim-slider::-moz-range-thumb {
        width: 30px; height: 30px;
        border-width: 4px;
    }
    .sim-amount-bounds { font-size: 0.74rem; }

    /* Toggle abbuono: piu padding per accomodare il pollice */
    .sim-toggle { margin-top: 18px; padding-top: 16px; }
    .switch { gap: 14px; align-items: flex-start; }
    .switch-text { font-size: 0.86rem; line-height: 1.4; }

    /* KPI grid: 1 colonna piu leggibile */
    .sim-kpi-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 20px; }
    .sim-kpi { padding: 14px 16px; }
    .sim-kpi-value { font-size: 1.4rem; }

    /* Chart leggermente piu basso per non occupare mezzo schermo */
    .sim-chart-wrap svg { height: 180px; }
    .sim-chart-block h3 { font-size: 0.92rem; }
    .sim-chart-legend { font-size: 0.72rem; gap: 10px; }

    /* Tabella ammortamento: font piu piccolo + padding ridotto per
       far stare 4 colonne in larghezza ridotta */
    .sim-table { font-size: 0.78rem; }
    .sim-table th, .sim-table td { padding: 7px 10px; }
    .sim-table-wrap > summary { font-size: 0.86rem; padding: 10px 14px; }

    /* Disclaimer */
    .wizard-disclaimer { font-size: 0.74rem; padding: 10px 14px; }

    /* Lead form summary */
    .lead-summary { padding: 12px 14px; font-size: 0.84rem; }

    /* Section padding generale: l'editorialita guadagna 16px verticali */
    .section { padding: 56px 0; }
    .section-header { margin-bottom: 28px; }
}

@media (max-width: 380px) {
    /* Smartphone molto piccoli (es. iPhone SE 1a gen, 320px): un'altra
       passata di compressione per il primo viewport. */
    .container,
    .container-narrow { padding: 0 14px; }

    .hero h1 { font-size: 1.55rem; }
    .hero-subtitle { font-size: 0.9rem; }
    .hero-stats .stat-number { font-size: 1.6rem; }
    .hero-stats .stat-label { font-size: 0.78rem; }

    .wizard-card { padding: 20px 14px 16px; }
    .bando-summary-value { font-size: 1.15rem; }
    .bando-block h3 { font-size: 1.05rem; }

    .area-card { padding: 22px 16px; }
    .area-card h3 { font-size: 1.2rem; }
    .area-card .area-percent { font-size: 1.3rem; }
    .area-card .area-desc { font-size: 0.86rem; }

    .option-pill { font-size: 0.88rem; padding: 11px 14px; }

    .sim-kpi-value { font-size: 1.3rem; }
    .sim-chart-wrap svg { height: 160px; }

    .btn-sim-cta {
        padding: 13px 18px;
        font-size: 0.85rem;
        letter-spacing: 0.04em;
    }
}
