/* ==========================================================================
   BizTaxCalc — identità visiva istituzionale/fiscale.
   Palette del piano: bianco, accento VERDE #047857 (denaro/fiducia) + NAVY
   #1E3A8A (autorevolezza). NON è il look di pcgamecheck: sobrio, molto bianco,
   "documentazione fiscale/enterprise". Font: Inter se disponibile, poi system-ui
   (nessun CDN esterno per privacy GDPR — Inter va self-hostata in Fase 1).
   ========================================================================== */

:root {
    --bg: #FFFFFF;
    --bg-alt: #F6F8FA;
    --text: #0F172A;      /* titoli */
    --body: #374151;      /* corpo */
    --muted: #6B7280;     /* secondario */
    --border: #E5E7EB;
    --accent: #047857;    /* verde professionale — CTA, netto */
    --accent-dark: #036348;
    --navy: #1E3A8A;      /* intestazioni, link, autorevolezza */
    --danger: #B91C1C;    /* imposte dovute / costo */
    --warn: #B45309;      /* avvisi */
    --warn-bg: #FEF3C7;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
    --maxw: 960px;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    color: var(--body);
    background: var(--bg);
    line-height: 1.6;
    font-size: 16px;
}
h1, h2, h3 { color: var(--text); font-weight: 700; line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1em; }

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

/* ---- Header ---- */
.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    position: sticky; top: 0; z-index: 20;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); font-size: 1.15rem; }
.brand .mark {
    width: 30px; height: 30px; border-radius: 7px;
    background: linear-gradient(135deg, var(--accent), var(--navy));
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: .95rem;
}
.brand .biz { color: var(--navy); }
.brand .tax { color: var(--accent); }
.nav a { color: var(--body); margin-left: 22px; font-size: .95rem; font-weight: 500; }
.nav a:hover { color: var(--navy); text-decoration: none; }
.lang-switch { margin-left: 22px; font-size: .9rem; color: var(--muted); }
.lang-switch a.active { color: var(--navy); font-weight: 700; }

/* ---- Hero ---- */
.hero { background: var(--bg-alt); border-bottom: 1px solid var(--border); padding: 46px 0 40px; }
.hero h1 { font-size: 2.35rem; letter-spacing: -0.02em; }
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 640px; margin: 0; }

/* ---- Layout calcolatore ---- */
.calc-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 34px 0; }
@media (max-width: 760px) { .calc-wrap { grid-template-columns: 1fr; } }

.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
}
.card h2 { font-size: 1.2rem; margin-bottom: 18px; }

/* ---- Form ---- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .9rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field input[type="number"], .field select {
    width: 100%; padding: 10px 12px; font-size: 1rem; font-family: var(--font);
    border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--text);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(4,120,87,.12); }
.field.check { display: flex; align-items: center; gap: 10px; }
.field.check input { width: auto; }
.field.check label { margin: 0; font-weight: 500; color: var(--body); }
.hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }

.btn {
    display: inline-block; width: 100%; padding: 12px 18px; font-size: 1rem; font-weight: 700;
    color: #fff; background: var(--accent); border: none; border-radius: 8px; cursor: pointer;
    font-family: var(--font); transition: background .15s;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: transparent; color: var(--muted); border: 1px solid var(--border); width: auto; padding: 8px 14px; font-weight: 500; }

/* ---- Box risultato (evidente, con scomposizione) ---- */
.result-empty { color: var(--muted); font-size: .95rem; text-align: center; padding: 30px 0; }
.result-net {
    background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: 8px;
    padding: 18px 20px; margin-bottom: 18px; text-align: center;
}
.result-net .label { font-size: .85rem; color: var(--accent-dark); text-transform: uppercase; letter-spacing: .04em; }
.result-net .amount { font-size: 2rem; font-weight: 800; color: var(--accent-dark); }
.result-net .rate { font-size: .9rem; color: var(--muted); }

.breakdown { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.breakdown td { padding: 8px 4px; border-bottom: 1px solid var(--border); font-size: .95rem; }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.breakdown tr.emphasis td { font-weight: 800; color: var(--text); border-top: 2px solid var(--text); border-bottom: none; }
.breakdown td .note { display: block; font-size: .78rem; color: var(--muted); }
.val-neg { color: var(--danger); }

/* ---- Assumptions / disclaimer / fonti ---- */
.assumptions { font-size: .85rem; color: var(--muted); background: var(--bg-alt); border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; }
.assumptions ul { margin: 6px 0 0; padding-left: 18px; }

.sources-box { border: 1px solid var(--border); border-left: 3px solid var(--navy); border-radius: 8px; padding: 14px 16px; background: #fff; margin-bottom: 14px; }
.sources-box h3 { font-size: .95rem; color: var(--navy); margin-bottom: 8px; }
.sources-box ul { margin: 0; padding-left: 18px; font-size: .88rem; }
.sources-box .updated { font-size: .8rem; color: var(--muted); margin-top: 8px; }

/* Riquadro cassa (saldo + acconti) */
.cashflow-box { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 8px; padding: 14px 16px; background: #fff; margin-bottom: 14px; }
.cashflow-box h3 { font-size: .95rem; color: var(--accent-dark); margin-bottom: 8px; }
.cashflow-box .breakdown { margin-bottom: 8px; }
.cashflow-box .updated { font-size: .82rem; color: var(--muted); }

.disclaimer { font-size: .82rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 12px; }

.preview-warning {
    background: var(--warn-bg); border: 1px solid #FCD34D; color: var(--warn);
    border-radius: 8px; padding: 10px 14px; font-size: .85rem; margin-bottom: 16px; font-weight: 500;
}

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-alt); margin-top: 50px; padding: 28px 0; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 12px 30px; justify-content: space-between; align-items: center; }
.site-footer p { margin: 0; font-size: .85rem; color: var(--muted); }

.badge-preview { display: inline-block; background: var(--warn-bg); color: var(--warn); font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; vertical-align: middle; }
