@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─── Reset & Variables ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #ffffff;
    --bg-subtle: #f8f8f8;
    --border: #e5e5e5;
    --text: #111111;
    --text-muted: #666666;
    --text-faint: #999999;
    --accent: #111111;
    --accent-hover: #333333;
    --green: #16a34a;
    --blue: #2563eb;
    --warning-bg: #fffbeb;
    --warning-border: #fcd34d;
    --warning-text: #92400e;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --transition: 0.2s ease;
    --max-width: 1100px;
    --content-width: 720px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ─── Layout Helpers ────────────────────────────────────────────────────── */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

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

/* ─── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 56px;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 100;
}

.navbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar.is-home .navbar-inner {
    justify-content: center;
}

.navbar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.navbar-brand span {
    font-weight: 400;
    color: var(--text-muted);
}

.nav-back {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color var(--transition);
}

.nav-back:hover {
    color: var(--text);
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero {
    padding: 80px 24px 64px;
    text-align: center;
    max-width: var(--max-width);
    margin: 0 auto;
}

.hero-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 36px;
}

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.btn-primary {
    background: var(--text);
    color: #fff;
    border-color: var(--text);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* ─── Section ───────────────────────────────────────────────────────────── */
.section {
    padding: 48px 0 64px;
}

.section-title {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 24px;
}

/* ─── Calculator Cards (homepage) ───────────────────────────────────────── */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.calc-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
    background: var(--bg);
}

.calc-card:hover {
    border-color: #bbb;
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.calc-card.coming-soon {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.calc-card-icon {
    font-size: 1.6rem;
    margin-bottom: 14px;
    display: block;
}

.calc-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.calc-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.badge-new {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.badge-soon {
    background: var(--bg-subtle);
    color: var(--text-faint);
    border: 1px solid var(--border);
}

/* ─── Calculator Page ───────────────────────────────────────────────────── */
.calc-header {
    padding: 40px 0 8px;
}

.calc-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.calc-header p {
    font-size: 0.88rem;
    color: var(--text-muted);
}

/* ─── Card ──────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
}

/* ─── Sliders ───────────────────────────────────────────────────────────── */
.slider-group {
    margin-bottom: 20px;
}

.slider-group:last-child {
    margin-bottom: 0;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.slider-label strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

input[type=range] {
    width: 100%;
    height: 4px;
    cursor: pointer;
    accent-color: var(--text);
    border-radius: 2px;
}

/* ─── Results Grid ──────────────────────────────────────────────────────── */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.result-box {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.result-box.highlight {
    border-color: var(--text);
    background: var(--bg-subtle);
}

.result-label {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 6px;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
}

.result-value.green {
    color: var(--green);
}

.result-value.blue {
    color: var(--blue);
}

/* ─── Bar chart ─────────────────────────────────────────────────────────── */
.bar-section {
    margin-bottom: 4px;
}

.bar-section-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.bar-track {
    background: var(--bg-subtle);
    border-radius: 6px;
    height: 24px;
    overflow: hidden;
    display: flex;
    border: 1px solid var(--border);
}

.bar-seg {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 600;
    transition: width 0.4s ease;
    overflow: hidden;
    white-space: nowrap;
}

.seg-capital {
    background: #111111;
    color: #ffffff;
}

.seg-versamenti {
    background: #555555;
    color: #ffffff;
}

.seg-interessi {
    background: #16a34a;
    color: #ffffff;
}

.legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ─── Timeline Table ────────────────────────────────────────────────────── */
.timeline-row {
    display: grid;
    grid-template-columns: 48px 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
}

.timeline-row.head {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1.5px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 2px;
}

.timeline-row span:not(:first-child) {
    text-align: right;
}

.year-badge {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.72rem;
}

/* Variante a 2 colonne: prima colonna adattiva, seconda si espande */
.table-two-col .timeline-row {
    grid-template-columns: auto 1fr;
    align-items: start;
}

.table-two-col .timeline-row span:not(:first-child) {
    text-align: left;
}

/* ─── Rate Note ─────────────────────────────────────────────────────────── */
.rate-note {
    font-size: 0.75rem;
    color: var(--text-faint);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* ─── Disclaimer ────────────────────────────────────────────────────────── */
.disclaimer {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 24px;
}

.disclaimer-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--warning-text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.disclaimer ul {
    padding-left: 16px;
    margin-bottom: 0;
}

.disclaimer li {
    font-size: 0.82rem;
    color: var(--warning-text);
    line-height: 1.6;
    margin-bottom: 4px;
}

.disclaimer li:last-child {
    margin-bottom: 0;
}

/* ─── FAQ ───────────────────────────────────────────────────────────────── */
.faq {
    margin-bottom: 24px;
}

.faq-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-question {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 14px 0;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: color var(--transition);
}

.faq-question:hover {
    color: var(--accent-hover);
}

.faq-chevron {
    font-size: 0.7rem;
    color: var(--text-faint);
    transition: transform var(--transition);
    flex-shrink: 0;
}

.faq-item.open .faq-chevron {
    transform: rotate(180deg);
}

.faq-answer {
    display: none;
    padding: 0 0 16px;
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.65;
}

.faq-item.open .faq-answer {
    display: block;
}

/* ─── Footer ────────────────────────────────────────────────────────────── */
.footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px;
    margin-top: 40px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.footer p {
    font-size: 0.78rem;
    color: var(--text-faint);
}

/* ─── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .hero {
        padding: 56px 20px 48px;
    }

    .results-grid {
        grid-template-columns: 1fr 1fr;
    }

    .timeline-row {
        font-size: 0.72rem;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ─── Cookie Banner ─────────────────────────────────────────────────────── */
#cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 400px;
    background: var(--bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius);
    padding: 24px;
    z-index: 1000;
    display: none;
    animation: slideUp 0.4s easeOutBack;
}

@keyframes slideUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#cookie-banner p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    line-height: 1.5;
}

#cookie-banner a {
    color: var(--text);
    text-decoration: underline;
}

.cookie-btns {
    display: flex;
    gap: 12px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.78rem;
}

/* ─── Salary Calculator — Bar Segments ─────────────────────────────────── */
.seg-inps {
    background: #111111;
    color: #ffffff;
}

.seg-irpef {
    background: #555555;
    color: #ffffff;
}

.seg-add {
    background: #888888;
    color: #ffffff;
}

.seg-netto {
    background: #16a34a;
    color: #ffffff;
}

/* ─── Salary Calculator — Options Row ──────────────────────────────────── */
.options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    align-items: flex-end;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.option-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
}

.toggle-btns {
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.toggle-btn {
    flex: 1;
    padding: 5px 16px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}

.toggle-btn.active {
    background: var(--text);
    color: #fff;
}

.check-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text);
    cursor: pointer;
    padding-bottom: 2px;
}

.check-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--text);
    flex-shrink: 0;
}

.select-input {
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 5px 8px;
    cursor: pointer;
}

.select-input:focus {
    outline: none;
    border-color: var(--text);
}

/* ─── Salary Calculator — Detail Table ─────────────────────────────────── */
.detail-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 7px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text);
}

.detail-row span:last-child {
    text-align: right;
    white-space: nowrap;
}

.detail-head {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1.5px solid var(--border) !important;
    padding-bottom: 10px;
}

.detail-row.detail-sub {
    color: var(--text-faint);
    font-style: italic;
    font-size: 0.75rem;
}

.detail-row.detail-neg span:last-child {
    color: #dc2626;
}

.detail-row.detail-pos span:last-child {
    color: var(--green);
}

.detail-row.detail-total {
    font-weight: 700;
    font-size: 0.85rem;
    border-top: 2px solid var(--border);
    border-bottom: none;
    padding-top: 10px;
    margin-top: 2px;
}

.detail-row.detail-total span:last-child {
    color: var(--blue);
}

/* ─── Codice Fiscale — Form ─────────────────────────────────────────────── */
.cf-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cf-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cf-field label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
}

.cf-field-full {
    grid-column: 1 / -1;
}

.text-input {
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    width: 100%;
    transition: border-color var(--transition);
}

.text-input:focus {
    outline: none;
    border-color: var(--text);
}

.comune-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: start;
}

.belfiore-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.belfiore-inp {
    width: 96px;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.field-note {
    font-size: 0.72rem;
    color: var(--text-faint);
    line-height: 1.4;
    max-width: 160px;
}

/* ─── Codice Fiscale — Autocomplete ─────────────────────────────────────── */
.ac-wrap {
    position: relative;
}

.ac-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 200;
    overflow: hidden;
}

.ac-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background var(--transition);
}

.ac-item:hover {
    background: var(--bg-subtle);
}

.ac-code {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-faint);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 5px;
}

/* ─── Codice Fiscale — Result Card ──────────────────────────────────────── */
.cf-result-card {
    text-align: center;
}

.cf-full-code {
    font-family: 'Courier New', monospace;
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 20px 0 16px;
    word-break: break-all;
}

.cf-sep {
    color: var(--border);
    font-weight: 400;
    margin: 0 2px;
}

.cf-seg-cog { color: var(--blue); }
.cf-seg-nom { color: #7c3aed; }
.cf-seg-dat { color: #d97706; }
.cf-seg-com { color: var(--green); }
.cf-seg-ctl { color: var(--text-faint); }

.cf-segs-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.cf-seg-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cf-seg-val {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--bg-subtle);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    letter-spacing: 0.08em;
}

.cf-seg-lbl {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-faint);
}

/* ─── Codice Fiscale — Breakdown Table ──────────────────────────────────── */
.breakdown-row {
    display: grid;
    grid-template-columns: 140px 48px 72px 1fr;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.78rem;
}

.breakdown-head {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-faint);
    border-bottom: 1.5px solid var(--border) !important;
    padding-bottom: 10px;
}

.breakdown-pos {
    color: var(--text-faint);
    font-size: 0.72rem;
    text-align: center;
}

.breakdown-code {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
}

.breakdown-note {
    color: var(--text-muted);
    font-size: 0.76rem;
}

/* ─── Responsive — Codice Fiscale ───────────────────────────────────────── */
@media (max-width: 600px) {
    .cf-form {
        grid-template-columns: 1fr;
    }

    .comune-row {
        grid-template-columns: 1fr;
    }

    .belfiore-inp {
        width: 100%;
    }

    .field-note {
        max-width: 100%;
    }

    .breakdown-row {
        grid-template-columns: 1fr 40px 56px;
    }

    .breakdown-note {
        display: none;
    }
}

/* ─── Coffee Link ───────────────────────────────────────────────────────── */
.coffee-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-faint);
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    white-space: nowrap;
    transition: color var(--transition), border-color var(--transition);
    flex-shrink: 0;
}

.coffee-link:hover {
    color: var(--text);
    border-color: #999;
}

/* ─── Ad Unit placeholder ───────────────────────────────────────────────── */
.ad-unit {
    width: 100%;
    overflow: hidden;
}

/* ─── Homepage — Category Sections ──────────────────────────────────────── */
.calc-category {
    margin-bottom: 48px;
}

.calc-category-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ─── Number Input ───────────────────────────────────────────────────────── */
.num-input {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    width: 100%;
    transition: border-color var(--transition);
    -moz-appearance: textfield;
    appearance: textfield;
}

.num-input::-webkit-inner-spin-button,
.num-input::-webkit-outer-spin-button {
    opacity: 1;
}

.num-input:focus {
    outline: none;
    border-color: var(--text);
}

.input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.input-field label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.input-with-unit {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color var(--transition);
}

.input-with-unit:focus-within {
    border-color: var(--text);
}

.input-with-unit .num-input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.input-with-unit .num-input:focus {
    outline: none;
}

.input-unit {
    padding: 8px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border-left: 1.5px solid var(--border);
    white-space: nowrap;
}

/* ─── Product Comparison (Confronto Prezzi) ──────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.product-card {
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color var(--transition);
}

.product-card.winner {
    border-color: var(--green);
    background: #f0fdf4;
}

.product-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.winner-tag {
    background: var(--green);
    color: #fff;
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.05em;
}

.product-price-per {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--blue);
    margin-top: 8px;
}

.product-saving {
    font-size: 0.78rem;
    color: var(--green);
    font-weight: 600;
    margin-top: 4px;
}

/* ─── Alcolemia Meter ────────────────────────────────────────────────────── */
.alco-meter-wrap {
    margin: 20px 0 8px;
}

.alco-meter-track {
    height: 12px;
    background: var(--bg-subtle);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.alco-meter-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s ease, background 0.4s ease;
    background: var(--green);
}

.alco-meter-fill.warn  { background: #f59e0b; }
.alco-meter-fill.danger { background: #ef4444; }

.alco-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    color: var(--text-faint);
    margin-top: 4px;
}

.alco-status {
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 8px;
}

.alco-status.ok     { color: var(--green); }
.alco-status.warn   { color: #b45309; }
.alco-status.danger { color: #dc2626; }

/* ─── Energia — Scenario Comparison ─────────────────────────────────────── */
.scenario-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 16px 0;
}

.scenario-card {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    font-size: 0.82rem;
}

.scenario-card-title {
    font-weight: 700;
    font-size: 0.78rem;
    margin-bottom: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.scenario-card-cost {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blue);
}

/* ─── Policy Page ───────────────────────────────────────────────────────── */
.policy-content {
    padding: 40px 0 80px;
}

.policy-content h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 32px 0 16px;
}

.policy-content p,
.policy-content ul {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.policy-content ul {
    padding-left: 20px;
}