/* ─── FiscoPedia.it — Design tokens & components ─────────────────── */

:root {
  /* Brand */
  --accent:        #6366f1;       /* indigo primary */
  --accent-2:      #4f46e5;
  --accent-soft:   #eff0ff;
  --green:         #10b981;
  --green-soft:    #ecfdf5;
  --red:           #e11d48;
  --red-soft:      #fef2f2;
  --amber:         #d97706;
  --amber-soft:    #fffbeb;
  --purple:        #7c3aed;

  /* Surfaces */
  --bg:        #fbfbfd;
  --surface:   #ffffff;
  --surface2:  #f5f6fa;
  --border:    #e7e8ef;
  --border-2:  #d8dae3;

  /* Text */
  --text:      #0f0f1a;
  --sub:       #5d6275;
  --muted:     #8a8fa3;

  /* Radii */
  --r-sm:  8px;
  --r:     12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 28px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15,15,26,.04), 0 1px 1px rgba(15,15,26,.02);
  --shadow:    0 6px 24px -8px rgba(15,15,26,.10), 0 2px 6px -2px rgba(15,15,26,.04);
  --shadow-lg: 0 24px 60px -20px rgba(15,15,26,.18);

  /* Type */
  --font-display: "Syne", ui-sans-serif, system-ui, sans-serif;
  --font-body:    "DM Sans", ui-sans-serif, system-ui, sans-serif;

  /* Layout */
  --maxw: 1180px;
  --maxw-narrow: 760px;
}

/* ─── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: transparent; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* ─── Typography ──────────────────────────────────────────────────────── */
.font-display { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; color: var(--text); line-height: 1.15; }

h1 { font-size: clamp(2rem, 1.4rem + 2.8vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
p  { color: var(--text); text-wrap: pretty; }
.lead { font-size: 1.125rem; color: var(--sub); max-width: 60ch; }
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent);
  padding: 6px 12px;
  border-radius: 999px;
}

/* ─── Layout ──────────────────────────────────────────────────────────── */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-tight { padding: 48px 0; }
.center { text-align: center; }
.divider { height: 1px; background: var(--border); margin: 0; border: 0; }

/* ─── Navbar ──────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,251,253,0.82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}
.brand .dot { color: var(--accent); }
.brand-logo {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800; font-size: 15px;
  font-family: var(--font-display);
  box-shadow: 0 4px 12px -4px color-mix(in oklab, var(--accent) 70%, transparent);
}
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-link {
  font-size: 14px; font-weight: 500;
  color: var(--sub);
  padding: 8px 12px;
  border-radius: 8px;
  transition: color .15s, background .15s;
}
.nav-link:hover, .nav-link.active { color: var(--text); background: var(--surface2); }
.nav-cta {
  background: var(--text); color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  transition: opacity .15s, transform .15s;
}
.nav-cta:hover { opacity: .9; transform: translateY(-1px); }
.nav-mobile-toggle { display: none; }

@media (max-width: 880px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 16px;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav-links.open .nav-link, .nav-links.open .nav-cta {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
  }
  .nav-mobile-toggle {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--surface2);
    color: var(--text);
  }
}

/* ─── Hero ────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: 64px 0 40px;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 600px 300px at 80% 0%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%),
    radial-gradient(ellipse 500px 280px at 10% 20%, color-mix(in oklab, var(--green) 10%, transparent), transparent 60%);
  pointer-events: none;
  z-index: 0;
}
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 760px; margin: 0 auto; padding: 0 24px; }
.hero h1 { margin: 18px 0 16px; }
.hero h1 .accent { color: var(--accent); }
.hero .lead { margin: 0 auto; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 28px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 600px;
  margin: 48px auto 0;
}
.hero-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  text-align: left;
}
.hero-stat .v { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--text); }
.hero-stat .l { font-size: 11px; color: var(--sub); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  border-radius: var(--r);
  font-weight: 600; font-size: 14.5px;
  transition: all .18s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--accent) 60%, transparent);
}
.btn-primary:hover { background: var(--accent-2); transform: translateY(-1px); box-shadow: 0 10px 24px -8px color-mix(in oklab, var(--accent) 65%, transparent); }
.btn-secondary {
  background: var(--surface); color: var(--text);
  border-color: var(--border-2);
}
.btn-secondary:hover { background: var(--surface2); border-color: var(--accent); color: var(--accent); }
.btn-ghost { color: var(--sub); padding: 10px 14px; }
.btn-ghost:hover { color: var(--accent); }
.btn-sm { padding: 9px 16px; font-size: 13px; }

/* ─── Calculator card ─────────────────────────────────────────────────── */
.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 380px 1fr;
}
@media (max-width: 920px) { .calc { grid-template-columns: 1fr; } }

.calc-inputs { padding: 28px; background: var(--surface2); border-right: 1px solid var(--border); }
.calc-results { padding: 28px; }
@media (max-width: 920px) { .calc-inputs { border-right: 0; border-bottom: 1px solid var(--border); } }

.calc-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.calc-field:last-child { margin-bottom: 0; }
.calc-label {
  font-size: 11px; font-weight: 600;
  color: var(--sub);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.calc-value-display {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 28px;
  color: var(--text);
  line-height: 1.1;
}
.calc-helper { font-size: 12px; color: var(--muted); }

/* Slider */
.salary-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--slider-pct, 0%), var(--border-2) var(--slider-pct, 0%), var(--border-2) 100%);
  border-radius: 999px;
  outline: none;
  margin: 6px 0 4px;
}
.salary-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(99,102,241,.35);
  cursor: pointer;
  transition: transform .12s;
}
.salary-slider::-webkit-slider-thumb:hover { transform: scale(1.12); }
.salary-slider::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(99,102,241,.35);
  cursor: pointer;
}
.slider-range {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted);
}

/* Select */
.calc-select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%235d6275' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color .15s;
}
.calc-select:focus { outline: none; border-color: var(--accent); }

/* Segmented */
.segmented {
  display: flex; gap: 6px;
  background: var(--surface);
  padding: 4px;
  border-radius: var(--r);
  border: 1px solid var(--border);
}
.segmented button {
  flex: 1;
  padding: 9px 8px;
  border-radius: 9px;
  font-size: 13px; font-weight: 500;
  color: var(--sub);
  transition: all .15s;
}
.segmented button.on {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 6px -2px color-mix(in oklab, var(--accent) 50%, transparent);
}
.segmented button:not(.on):hover { color: var(--text); background: var(--surface2); }

/* Results */
.result-hero {
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in oklab, var(--green) 6%, var(--surface)));
  border: 1px solid color-mix(in oklab, var(--accent) 18%, transparent);
  border-radius: var(--r-xl);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.result-hero .label { font-size: 11px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.result-hero .big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 1.6rem + 2vw, 3.4rem);
  color: var(--accent);
  line-height: 1;
}
.result-hero .sub { font-size: 13px; color: var(--sub); margin-top: 8px; }

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.result-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 14px 16px;
}
.result-card .l { font-size: 11px; color: var(--sub); text-transform: uppercase; letter-spacing: 0.08em; }
.result-card .v { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--text); margin-top: 4px; }

.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.breakdown td { padding: 10px 4px; border-bottom: 1px solid var(--border); }
.breakdown tr:last-child td { border-bottom: 0; }
.breakdown td:first-child { color: var(--sub); }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 500; }
.breakdown tr.negative td:last-child { color: var(--red); }
.breakdown tr.total td { font-weight: 700; font-size: 14.5px; padding-top: 14px; }
.breakdown tr.total td:last-child { color: var(--accent); font-family: var(--font-display); font-size: 17px; }

/* ─── Cards / sections ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}
.card-hover { transition: transform .18s, box-shadow .18s, border-color .18s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in oklab, var(--accent) 25%, var(--border)); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
@media (max-width: 820px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.section-head { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-head p { color: var(--sub); margin-top: 12px; }

/* Feature card */
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 12px;
}
.feature .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid; place-items: center;
}
.feature h3 { font-size: 17px; font-weight: 700; }
.feature p { color: var(--sub); font-size: 14.5px; }

/* FAQ */
.faq-item {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r);
  margin-bottom: 10px;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  padding: 18px 20px;
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  gap: 16px;
}
.faq-q .chev { color: var(--sub); transition: transform .2s; flex-shrink: 0; }
.faq-item[open] .faq-q .chev { transform: rotate(180deg); }
.faq-a {
  padding: 0 20px 20px;
  color: var(--sub);
  font-size: 14.5px;
  line-height: 1.65;
}

/* ─── Blog cards ──────────────────────────────────────────────────────── */
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  transition: all .18s;
  height: 100%;
}
.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); }
.blog-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.tag {
  display: inline-block;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 18%, transparent);
}
.tag.tag-green { background: var(--green-soft); color: var(--green); border-color: color-mix(in oklab, var(--green) 25%, transparent); }
.tag.tag-amber { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in oklab, var(--amber) 25%, transparent); }
.tag.tag-red { background: var(--red-soft); color: var(--red); border-color: color-mix(in oklab, var(--red) 25%, transparent); }
.tag.tag-purple { background: color-mix(in oklab, var(--purple) 8%, var(--surface)); color: var(--purple); border-color: color-mix(in oklab, var(--purple) 25%, transparent); }
.blog-card h3 { font-size: 17px; font-weight: 700; line-height: 1.3; }
.blog-card p { color: var(--sub); font-size: 14px; flex: 1; }
.blog-card .read-more { color: var(--accent); font-weight: 600; font-size: 13px; margin-top: auto; }

/* ─── AdSense slot ────────────────────────────────────────────────────── */
.ad-wrap {
  margin: 32px 0;
  text-align: center;
}
.ad-wrap .ad-label {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}
.ad-slot {
  display: block;
  min-height: 90px;
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  font-size: 12px;
  padding: 16px;
}
.ad-slot.ad-rect { max-width: 336px; min-height: 280px; margin-left: auto; margin-right: auto; }
.ad-slot.ad-leader { min-height: 90px; max-width: 728px; margin-left: auto; margin-right: auto; }

/* ─── Article content ─────────────────────────────────────────────────── */
.article {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}
.article-head { padding: 56px 0 32px; text-align: center; }
.article-head .meta { display: flex; gap: 12px; justify-content: center; align-items: center; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.article-head h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.8rem); margin-bottom: 14px; }
.article-head .lead { margin: 0 auto; font-size: 17px; }
.prose { font-size: 16.5px; line-height: 1.75; color: var(--text); }
.prose h2 { margin: 40px 0 16px; font-size: 1.6rem; }
.prose h3 { margin: 32px 0 12px; font-size: 1.2rem; }
.prose p { margin-bottom: 18px; color: #2a2d3a; }
.prose ul, .prose ol { margin: 0 0 18px 24px; }
.prose ul li, .prose ol li { margin-bottom: 8px; color: #2a2d3a; }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose a { color: var(--accent); border-bottom: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); }
.prose a:hover { border-bottom-color: var(--accent); }
.prose strong { font-weight: 600; color: var(--text); }
.prose code { background: var(--surface2); padding: 2px 6px; border-radius: 4px; font-size: 14px; font-family: ui-monospace, monospace; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  padding: 18px 22px;
  border-radius: 0 var(--r) var(--r) 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--text);
}
.prose table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 14.5px; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.prose th { background: var(--surface2); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }

/* ─── Footer ──────────────────────────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; color: var(--text); font-family: var(--font-body); font-weight: 600; }
.footer ul li { margin-bottom: 8px; }
.footer ul li a { font-size: 14px; color: var(--sub); transition: color .15s; }
.footer ul li a:hover { color: var(--accent); }
.footer-about p { font-size: 14px; color: var(--sub); margin-top: 14px; max-width: 36ch; }
.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--muted);
  gap: 16px; flex-wrap: wrap;
}

/* ─── Cookie banner ───────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px 22px;
  display: flex; align-items: center; gap: 18px;
  z-index: 100;
  max-width: 820px;
  margin: 0 auto;
  font-size: 14px;
}
.cookie-banner p { color: var(--sub); flex: 1; }
.cookie-banner p a { color: var(--accent); }
.cookie-banner .actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-banner.hidden { display: none; }
@media (max-width: 640px) { .cookie-banner { flex-direction: column; align-items: stretch; } .cookie-banner .actions { justify-content: stretch; } .cookie-banner .actions .btn { flex: 1; } }

/* ─── Breadcrumb ──────────────────────────────────────────────────────── */
.crumb { font-size: 13px; color: var(--muted); padding: 16px 0 0; }
.crumb a { color: var(--sub); }
.crumb a:hover { color: var(--accent); }
.crumb .sep { margin: 0 6px; opacity: 0.5; }

/* ─── Utilities ───────────────────────────────────────────────────────── */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-6 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.text-sub { color: var(--sub); }
.text-accent { color: var(--accent); }
.text-center { text-align: center; }
