:root {
  /* Palette verdino/arancione centralizzata: le pagine usano queste variabili invece di colori sparsi. */
  --bg: #f5fbf3;
  --surface: #ffffff;
  --surface-soft: #edf7e8;
  --text: #173323;
  --muted: #64766a;
  --line: #d8e7d0;
  --navy: #123b2a;
  --navy-2: #17613f;
  --blue: #2e8f55;
  --teal: #34b96f;
  --gold: #f28c28;
  --orange: #f28c28;
  --mint: #b9f2c7;
  --red: #c83c3c;
  --green: #158453;
  --violet: #6d52c7;
  --shadow: 0 22px 60px rgba(18, 59, 42, .12);
  --shadow-small: 0 10px 28px rgba(18, 59, 42, .09);
  --radius: 24px;
  --radius-small: 16px;
}

/* Base tipografica e variabili condivise tra tema chiaro e scuro. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.dark {
  --bg: #07150f;
  --surface: #0f2118;
  --surface-soft: #14291e;
  --text: #effff4;
  --muted: #acc2b3;
  --line: #274433;
  --navy: #0b2d20;
  --navy-2: #1b754b;
  --shadow: 0 22px 60px rgba(0, 0, 0, .24);
  --shadow-small: 0 10px 28px rgba(0, 0, 0, .20);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { max-width: 100%; }
h1, h2, h3, h4 { color: var(--text); line-height: 1.14; }
p { margin-top: 0; }
.container { width: min(1180px, calc(100% - 36px)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 999; padding: 10px 14px;
  color: #fff; background: var(--navy); border-radius: 10px; transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.trust-bar { color: #ecfff1; background: #0c2c20; font-size: .78rem; }
.trust-bar .container { display: flex; justify-content: flex-end; gap: 26px; padding: 7px 0; }
.trust-bar span::before { content: "•"; margin-right: 8px; color: var(--gold); }

.site-header {
  position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(220, 229, 238, .85);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  backdrop-filter: blur(16px);
}
.nav-wrap {
  width: min(100% - 48px, 1360px);
  min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: max-content; }
.brand-mark {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px;
  color: #fff; font-weight: 900; letter-spacing: -.04em;
  background: linear-gradient(145deg, var(--navy-2), var(--gold));
  box-shadow: 0 10px 24px rgba(242, 140, 40, .20);
}
.brand b { display: block; font-size: .98rem; }
.brand small { display: block; margin-top: -2px; color: var(--muted); font-size: .68rem; font-weight: 650; }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 9px 10px; border-radius: 10px; color: var(--muted); font-size: .88rem; font-weight: 700;
}
.main-nav a:hover, .main-nav a.active { color: var(--navy-2); background: var(--surface-soft); }
.dark .main-nav a:hover, .dark .main-nav a.active { color: #8dc3ff; }
.main-nav .pill, .pill {
  margin-left: 5px; padding: 10px 17px; color: #fff; border-radius: 999px;
  background: var(--navy-2); box-shadow: none;
}
.theme-toggle, .nav-toggle {
  border: 1px solid var(--line); color: var(--text); background: var(--surface);
  border-radius: 12px; cursor: pointer;
}
.theme-toggle { width: 38px; height: 38px; margin-left: 5px; }
.nav-toggle { display: none; padding: 9px 12px; font-weight: 900; }

/* Hero e pannello dimostrativo della homepage. */
.hero {
  position: relative; overflow: hidden; padding: 76px 0 62px;
  background:
    radial-gradient(circle at 80% 12%, rgba(242, 140, 40, .18), transparent 28%),
    radial-gradient(circle at 10% 80%, rgba(52, 185, 111, .16), transparent 26%),
    linear-gradient(180deg, var(--surface), var(--bg));
}
.hero::after {
  content: ""; position: absolute; right: -130px; top: -170px; width: 420px; height: 420px;
  border: 1px solid rgba(242, 140, 40, .20); border-radius: 50%; box-shadow: 0 0 0 65px rgba(52, 185, 111, .055);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.08fr .92fr; gap: 64px; align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 999px;
  color: var(--navy-2); background: rgba(52, 185, 111, .13); font-size: .76rem; font-weight: 850;
  letter-spacing: .04em; text-transform: uppercase;
}
.dark .eyebrow { color: #9ff2bd; }
.eyebrow.light { color: #d9fff9; background: rgba(255, 255, 255, .09); }
.hero h1 { max-width: 720px; margin: 18px 0; font-size: clamp(2.65rem, 5.8vw, 5.35rem); letter-spacing: -.055em; }
.lead { max-width: 780px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 27px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 11px 20px;
  border: 1px solid var(--navy-2); border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--navy-2), #1f9b5d);
  box-shadow: 0 12px 28px rgba(23, 97, 63, .20); font-weight: 800; cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(23, 97, 63, .24); }
.btn.secondary { color: var(--navy-2); background: var(--surface); border-color: var(--line); box-shadow: none; }
.dark .btn.secondary { color: #d7eaff; }
.btn.light { color: var(--navy); background: #fff; border-color: #fff; box-shadow: none; }
.btn.compact { min-height: 38px; padding: 8px 14px; font-size: .85rem; }
.btn.full { width: 100%; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 31px; color: var(--muted); font-size: .8rem; font-weight: 700; }
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust b { color: var(--teal); }

.hero-dashboard {
  position: relative; padding: 24px; border: 1px solid rgba(255, 255, 255, .75); border-radius: 28px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 93%, transparent); box-shadow: 0 30px 90px rgba(18, 59, 42, .18);
}
.dashboard-head, .goal-card, .dashboard-row, .mini-chart-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dashboard-head span, .goal-card span, .mini-chart-card span { display: block; color: var(--muted); font-size: .72rem; }
.dashboard-head strong, .goal-card strong, .mini-chart-card b { display: block; }
.live-chip { padding: 5px 10px; color: var(--green) !important; background: rgba(7, 132, 93, .11); border-radius: 999px; font-weight: 800; }
.goal-card { margin: 20px 0 14px; padding: 18px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--navy-2), #ea7d20); }
.goal-card strong { color: #fff; font-size: 1.18rem; }
.goal-card small { color: #fff3df; }
.goal-ring {
  flex: 0 0 62px; width: 62px; height: 62px; display: grid; place-items: center; border-radius: 50%;
  background: conic-gradient(#c8f7a4 0 72%, rgba(255, 255, 255, .18) 72% 100%);
}
.goal-ring::before { content: ""; position: absolute; width: 48px; height: 48px; border-radius: 50%; background: #196542; }
.goal-ring span { position: relative; z-index: 1; color: #fff; font-size: 1rem; font-weight: 900; }
.dashboard-row { align-items: stretch; }
.dashboard-row a { flex: 1; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.dashboard-row b, .dashboard-row small { display: block; }
.dashboard-row small { color: var(--muted); font-size: .7rem; }
.mini-icon { width: 30px; height: 30px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 9px; font-weight: 900; }
.mini-icon.blue { color: var(--blue); background: rgba(23, 105, 224, .10); }
.mini-icon.teal { color: var(--teal); background: rgba(12, 155, 142, .10); }
.mini-chart-card { margin-top: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; }
.mini-chart-card .chart { width: 42%; height: 74px; }
.dashboard-note { margin: 12px 0 0; color: var(--muted); font-size: .7rem; text-align: center; }

.market-strip { border-block: 1px solid var(--line); background: var(--surface); }
.market-strip-grid { display: grid; grid-template-columns: 1.2fr repeat(5, 1fr); align-items: stretch; }
.market-strip-grid > * { min-width: 0; padding: 16px 14px; border-right: 1px solid var(--line); }
.market-strip-grid > *:last-child { border-right: 0; }
.strip-title { display: grid; grid-template-columns: auto 1fr; align-content: center; gap: 0 8px; }
.strip-title .status-dot { grid-row: 1 / 3; }
.strip-title small { color: var(--muted); font-size: .67rem; }
.market-strip a span, .market-strip a b, .market-strip a small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.market-strip a span { color: var(--muted); font-size: .68rem; }
.market-strip a b { font-size: .92rem; }
.market-strip a small { font-size: .7rem; font-weight: 900; }

/* Sezioni, griglie e card riutilizzate dalle pagine pubbliche. */
.section, .page-hero { padding: 66px 0; }
.page-hero { padding-bottom: 20px; background: linear-gradient(180deg, var(--surface), var(--bg)); }
.page-hero h1 { max-width: 900px; margin: 16px 0; font-size: clamp(2.25rem, 5vw, 4.4rem); letter-spacing: -.045em; }
.section-soft { border-block: 1px solid var(--line); background: var(--surface-soft); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 27px; }
.section-heading > div { max-width: 720px; }
.section-heading h2 { margin: 13px 0 0; font-size: clamp(2rem, 4vw, 3.35rem); letter-spacing: -.04em; }
.section-heading > p { max-width: 390px; margin: 0; color: var(--muted); }
.section-heading.compact h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
.text-link { color: var(--navy-2); font-weight: 850; white-space: nowrap; }
.dark .text-link { color: #88c3ff; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.path-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; }
.path-card {
  position: relative; min-height: 255px; display: flex; flex-direction: column; justify-content: space-between;
  padding: 24px; overflow: hidden; border-radius: var(--radius); color: #fff; box-shadow: var(--shadow-small);
}
.path-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -75px; bottom: -75px; border: 1px solid rgba(255,255,255,.19); border-radius: 50%; }
.path-card.blue { background: linear-gradient(145deg, #123b2a, #1f8f55); }
.path-card.teal { background: linear-gradient(145deg, #138453, #55c978); }
.path-card.gold { background: linear-gradient(145deg, #b35b15, #f28c28); }
.path-number { font-size: .72rem; font-weight: 900; opacity: .75; }
.path-card small, .path-card h3, .path-card p { color: #fff; }
.path-card small { font-size: .74rem; text-transform: uppercase; font-weight: 850; letter-spacing: .06em; }
.path-card h3 { margin: 7px 0; font-size: 1.55rem; }
.path-card p { margin: 0; opacity: .82; font-size: .9rem; }
.path-arrow { position: absolute; right: 24px; top: 23px; font-size: 1.3rem; }

.card, .tool-card, .article-card, .news-card, .market-card {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-small);
}
.card, .article-card, .news-card, .market-card { padding: 23px; }
.tool-card { min-height: 275px; display: flex; flex-direction: column; padding: 22px; transition: transform .2s, box-shadow .2s; }
.tool-card:hover, .article-card:hover, .market-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tool-card.featured { color: #fff; background: linear-gradient(150deg, var(--navy-2), #f28c28); border-color: transparent; }
.tool-card.featured h3, .tool-card.featured p, .tool-card.featured small, .tool-card.featured b { color: #fff; }
.tool-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 42px; border-radius: 14px; color: var(--teal); background: rgba(12,155,142,.11); font-weight: 900; }
.featured .tool-icon { color: #fff; background: rgba(255,255,255,.12); }
.tool-card small { color: var(--teal); font-size: .72rem; font-weight: 850; text-transform: uppercase; }
.tool-card h3 { margin: 6px 0 9px; font-size: 1.3rem; }
.tool-card p { color: var(--muted); font-size: .86rem; }
.tool-card b { margin-top: auto; color: var(--navy-2); font-size: .78rem; }

.content-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, .5fr); gap: 28px; align-items: start; }
.article-list { border-top: 1px solid var(--line); }
.article-row { display: grid; grid-template-columns: 42px 1fr 42px; gap: 16px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); }
.article-index { color: var(--muted); font-size: .72rem; font-weight: 850; }
.article-row h3 { margin: 8px 0 5px; font-size: 1.15rem; }
.article-row p { margin: 0; color: var(--muted); font-size: .86rem; }
.circle-link { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.news-panel { position: sticky; top: 100px; padding: 28px; border-radius: var(--radius); color: #e9fff0; background: linear-gradient(155deg, #0c2c20, #17613f); box-shadow: var(--shadow); }
.news-panel h2 { margin: 14px 0; color: #fff; font-size: 2rem; }
.news-panel > p { color: #b7dec2; }
.news-list { margin-top: 22px; }
.news-list article { padding: 17px 0; border-top: 1px solid rgba(255,255,255,.13); }
.news-list span { color: #ffc07d; font-size: .68rem; font-weight: 850; text-transform: uppercase; }
.news-list h3 { margin: 5px 0; color: #fff; font-size: .98rem; }
.news-list small { color: #b9d8c2; }
.news-source-link { display: block; margin-top: 16px; }

.scam-banner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 28px; border: 1px solid rgba(200,60,60,.25); border-radius: var(--radius); background: rgba(200,60,60,.055); }
.scam-icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; color: #fff; background: var(--red); font-size: 1.8rem; font-weight: 900; }
.scam-banner h2 { margin: 8px 0; }
.scam-banner p { margin: 0; color: var(--muted); }
.danger-label { color: var(--red); background: rgba(200,60,60,.10); }

.market-card { display: flex; flex-direction: column; }
.market-card-head { display: flex; justify-content: space-between; gap: 12px; }
.data-state { padding: 5px 9px; border-radius: 999px; font-size: .7rem; font-weight: 850; text-transform: uppercase; }
.data-state.live { color: var(--green); background: rgba(7,132,93,.10); }
.data-state.demo { color: #996810; background: rgba(216,155,40,.13); }
.market-card h2 { margin: 18px 0 0; font-size: 1.35rem; }
.market-symbol { color: var(--muted); font-size: .75rem; }
.market-value { margin: 15px 0; font-size: 2rem; font-weight: 900; }
.market-card .chart { margin-bottom: 18px; }
.market-meta { margin: auto 0 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.market-meta div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: .75rem; }
.market-meta dt { color: var(--muted); }
.market-meta dd { margin: 0; text-align: right; }

.chart {
  position: relative; height: 140px; overflow: hidden; border-radius: 15px; color: var(--teal);
  background:
    linear-gradient(180deg, rgba(12,155,142,.13), transparent),
    repeating-linear-gradient(to right, transparent 0 39px, rgba(102,117,138,.1) 40px),
    repeating-linear-gradient(to bottom, transparent 0 34px, rgba(102,117,138,.09) 35px);
}
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.badge { display: inline-flex; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--navy-2); background: var(--surface-soft); font-size: .68rem; font-weight: 850; }
.dark .badge { color: #a7d4ff; }
.up { color: var(--green); font-weight: 900; }
.down { color: var(--red); font-weight: 900; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.wide { grid-column: 1 / -1; }
.ticker-line { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }

/* Form accessibili con stato focus ben visibile. */
.input, select, textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); background: var(--surface); outline: 0; transition: border .2s, box-shadow .2s;
}
textarea { min-height: 100px; resize: vertical; }
.input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(23,105,224,.10); }
label { display: block; margin: 13px 0 6px; font-size: .82rem; font-weight: 800; }
.form-help { margin: 6px 0 14px; color: var(--muted); font-size: .76rem; }
.result-box { margin-top: 16px; padding: 18px; border: 1px solid rgba(12,155,142,.18); border-radius: 16px; background: rgba(12,155,142,.08); }
.notice { margin-bottom: 16px; padding: 14px 16px; border-left: 4px solid var(--gold); border-radius: 12px; background: rgba(216,155,40,.10); }
.notice.danger, .danger { border-left-color: var(--red); background: rgba(200,60,60,.09); }
.notice.success { border-left-color: var(--green); background: rgba(7,132,93,.09); }
.ghost { padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--text); background: var(--surface); cursor: pointer; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
.video-box { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 17px; background: #000; }
.consent-embed, .embed-placeholder { min-height: 280px; margin-bottom: 18px; border-radius: 17px; overflow: hidden; }
.consent-embed { background: #071b31; }
.embed-placeholder { display: grid; place-items: center; align-content: center; gap: 8px; padding: 28px; color: #d9e9f7; background: linear-gradient(145deg, #071b31, #0b4269); text-align: center; }
.embed-placeholder > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(255,255,255,.12); font-size: 1.4rem; }
.embed-placeholder strong { color: #fff; }
.embed-placeholder p { max-width: 460px; margin: 0 0 8px; color: #aac1d4; }
.article-layout { max-width: 920px; }
.article-meta { color: var(--muted); font-size: .82rem; }
.article-cover { width: 100%; max-height: 480px; margin-bottom: 25px; border-radius: 18px; object-fit: cover; }
.article-content { font-size: 1.04rem; }
.article-content h2, .article-content h3 { margin-top: 1.8em; }
.article-content a { color: var(--blue); text-decoration: underline; }
.article-content table { width: 100%; border-collapse: collapse; }
.article-content th, .article-content td { padding: 10px; border: 1px solid var(--line); }
.box-note, .box-warning, .box-example { margin: 20px 0; padding: 17px; border-left: 4px solid var(--blue); border-radius: 12px; background: rgba(23,105,224,.07); }
.box-warning { border-left-color: var(--red); background: rgba(200,60,60,.07); }
.box-example { border-left-color: var(--teal); background: rgba(12,155,142,.07); }
.feature-gate-card { max-width: 820px; border-left: 5px solid var(--gold); }
.feature-gate-card h2 { margin-top: 0; }
.account-grid,
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}
.subscription-status-card { border-left: 6px solid var(--green); }
.pricing-card { display: flex; flex-direction: column; gap: .7rem; }
.pricing-card .price {
    font-size: clamp(1.7rem, 4vw, 2.6rem);
    font-weight: 900;
    color: var(--green);
    margin: 0;
}
.pricing-card .price small {
    font-size: .9rem;
    color: var(--muted);
    font-weight: 700;
}
.payment-form,
.stacked-form { display: grid; gap: .85rem; }
.terms-check {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    font-size: .92rem;
    color: var(--muted);
}
.payment-instructions { border-left: 6px solid var(--gold); }
.payment-reference {
    display: inline-block;
    padding: .65rem .85rem;
    border-radius: 14px;
    background: var(--soft);
    color: var(--green);
    font-weight: 900;
    letter-spacing: .04em;
}
.compact-section { padding-top: 1rem; padding-bottom: 1rem; }
.inline-heading { margin-bottom: 1rem; }
.legal-page h2 { margin-top: 1.4rem; }
details { padding: 13px 0; border-bottom: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 800; }

/* Chiusura editoriale e footer istituzionale. */
.pre-footer { padding: 42px 0; color: #fff; background: linear-gradient(135deg, var(--navy), #1d7c4e 58%, #d96f1c); }
.pre-footer-grid { display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.pre-footer h2 { max-width: 800px; margin: 13px 0 0; color: #fff; font-size: clamp(1.7rem, 4vw, 3rem); }
.site-footer { padding: 58px 0 20px; color: #c5ddcb; background: #0a241a; }
.site-footer h3 { color: #fff; font-size: .9rem; }
.site-footer a { display: block; margin: 8px 0; color: #e5ffe9; font-size: .86rem; }
.footer-cookie-button { display: block; margin: 8px 0; padding: 0; border: 0; color: #e5ffe9; background: transparent; font-size: .86rem; cursor: pointer; }
.site-footer p, .site-footer span { font-size: .82rem; }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 44px; }
.footer-about > p { max-width: 450px; }
.footer-brand { margin-bottom: 18px; }
.footer-brand b { color: #fff; }
.footer-brand small { color: #b4d0ba; }
.footer-disclaimer { color: #a5bea9; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; margin-top: 38px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); }

.cookie-banner {
  position: fixed; z-index: 200; right: 20px; bottom: 20px; left: 20px; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; max-width: 1120px; margin-inline: auto; padding: 19px 21px;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 24px 80px rgba(0,0,0,.24);
}
.cookie-banner[hidden], .cookie-modal-backdrop[hidden] { display: none; }
.cookie-banner strong { display: block; }
.cookie-banner p { max-width: 660px; margin: 4px 0 0; color: var(--muted); font-size: .82rem; }
.cookie-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.cookie-modal-backdrop { position: fixed; z-index: 210; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(7,21,15,.74); }
.cookie-modal { width: min(650px, 100%); max-height: 90vh; overflow-y: auto; padding: 27px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.cookie-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.cookie-modal h2 { margin: 10px 0 0; }
.cookie-close { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--text); background: var(--surface); font-size: 1.35rem; cursor: pointer; }
.cookie-options { display: grid; margin: 20px 0; border-top: 1px solid var(--line); }
.cookie-options label { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0; padding: 15px 0; border-bottom: 1px solid var(--line); }
.cookie-options strong, .cookie-options small { display: block; }
.cookie-options small { color: var(--muted); font-weight: 400; }
.cookie-options input { width: 21px; height: 21px; accent-color: var(--teal); }
.modal-open { overflow: hidden; }

/* Adattamento progressivo per tablet e smartphone. */
@media (max-width: 980px) {
  .trust-bar { display: none; }
  .nav-toggle { display: block; }
  .main-nav {
    display: none; position: absolute; top: 66px; left: 18px; right: 18px; padding: 14px;
    border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow);
    flex-direction: column; align-items: stretch;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 12px; }
  .main-nav .pill { margin: 4px 0 0; text-align: center; }
  .theme-toggle { width: 100%; margin: 4px 0 0; }
  .hero-grid, .content-layout { grid-template-columns: 1fr; }
  .hero-grid { gap: 38px; }
  .news-panel { position: static; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .path-grid { grid-template-columns: 1fr; }
  .market-strip-grid { grid-template-columns: repeat(3, 1fr); }
  .strip-title { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
  .footer-grid > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .container { width: min(100% - 28px, 1180px); }
  .brand small { display: none; }
  .hero { padding: 50px 0 42px; }
  .hero h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .hero-dashboard { padding: 16px; }
  .dashboard-row { flex-direction: column; }
  .hero-trust { display: grid; }
  .section, .page-hero { padding: 48px 0; }
  .section-heading { display: block; }
  .section-heading > p, .section-heading .text-link { display: block; margin-top: 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .market-strip-grid { grid-template-columns: repeat(2, 1fr); }
  .market-strip-grid > * { border-bottom: 1px solid var(--line); }
  .article-row { grid-template-columns: 32px 1fr; }
  .article-row .circle-link { display: none; }
  .scam-banner { grid-template-columns: 1fr; }
  .scam-icon { width: 50px; height: 50px; border-radius: 15px; }
  .pre-footer-grid, .footer-bottom { align-items: flex-start; flex-direction: column; }
  .cookie-banner { align-items: stretch; flex-direction: column; }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .btn { flex: 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .footer-about, .footer-grid > div:last-child { grid-column: 1 / -1; }
  .card, .article-card, .news-card, .market-card { padding: 18px; }
  .table { min-width: 620px; }
}

@media print {
  .trust-bar, .site-header, .site-footer, .pre-footer, .cta-row, .ghost { display: none !important; }
  body { background: #fff; }
  .card, .market-card { box-shadow: none; }
}

/* Componenti della fase Soldi in Tasca: ricerca, schede e grafici accessibili. */
.header-search{display:flex;align-items:center;gap:4px;min-width:190px}.header-search input{width:150px;border:1px solid var(--line);border-radius:999px;padding:9px 12px;background:var(--surface);color:var(--text)}.header-search button{border:0;border-radius:50%;width:38px;height:38px;background:var(--navy);color:#fff;cursor:pointer}.search-form{display:flex;gap:10px;max-width:720px;margin:24px 0}.search-form .input{flex:1}.article-header{max-width:900px}.article-body{max-width:900px}.article-body>p,.article-body li{font-size:1.05rem;line-height:1.75}.article-body h2{margin-top:2.2rem}.article-body details{border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin:10px 0;background:var(--surface)}.article-body summary{cursor:pointer;font-weight:700}.real-series-chart{min-height:170px}.chart-loading{display:block;padding:50px 12px;text-align:center;color:var(--muted)}.chart svg{display:block;width:100%;height:180px;color:var(--navy)}.chart-caption{font-size:.82rem;color:var(--muted);margin:.5rem 0}.chart-data{margin-top:10px;max-height:300px;overflow:auto}.chart-data summary{cursor:pointer;font-weight:700}.formula{padding:10px 12px;border-left:4px solid var(--gold);background:var(--surface-soft);font-size:.92rem}.content-page .notice{margin-bottom:24px}

.content-hero { margin: 28px 0 0; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-soft); }
.content-hero img { display: block; width: 100%; height: auto; aspect-ratio: 15 / 7; object-fit: cover; }
.content-hero figcaption { padding: 8px 14px; color: var(--muted); font-size: .78rem; }
.content-quiz { margin: 36px 0; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface-soft); }
.content-quiz h2 { margin-top: 0; }
.quiz-question { font-weight: 750; }
.quiz-answers { display: grid; gap: 10px; margin: 16px 0; }
.quiz-answer { padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface); text-align: left; cursor: pointer; }
.quiz-answer:hover:not(:disabled), .quiz-answer:focus-visible { border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(23,105,224,.12); }
.quiz-answer.is-correct { border-color: #188557; background: #e7f7ef; color: #0e5b3b; }
.quiz-answer.is-wrong { border-color: #bd3f4d; background: #fff0f1; color: #852532; }
.dark .quiz-answer.is-correct { background: #123d2c; color: #baf2d4; }
.dark .quiz-answer.is-wrong { background: #471f27; color: #ffd4d8; }
.quiz-feedback { min-height: 1.5em; margin-bottom: 0; font-weight: 700; }
.related-content { margin-top: 42px; padding-top: 8px; border-top: 1px solid var(--line); }

/* Su portatili e desktop stretti la ricerca occupa una seconda riga senza creare overflow. */
@media (max-width:1360px){.nav-wrap{flex-wrap:wrap;padding-bottom:10px}.header-search{order:4;width:100%}.header-search input{width:100%;flex:1}}
@media (max-width:700px){.search-form{flex-direction:column}.article-body>p,.article-body li{font-size:1rem}.header-search{display:none}}

/* I 25 calcolatori condividono una struttura stabile, leggibile e stampabile. */
.calculator-jump { max-width: 520px; }
.calculator-grid { align-items: start; }
.calculator-card { min-width: 0; scroll-margin-top: 110px; }
.calculator-card form { display: grid; }
.calculator-card .formula { min-height: 47px; }
.calculator-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.calculator-actions .btn, .calculator-actions .ghost { min-height: 44px; }
.calculator-status { min-height: 1.5em; margin: 10px 0 0; color: var(--muted); }
.calculator-chart { margin-top: 18px; }
.calculator-table { margin-top: 14px; }
.calculator-card .table-wrap { max-width: 100%; }
.calculator-table caption { padding: 8px 0; color: var(--muted); font-weight: 800; text-align: left; }
.calculator-notes { margin-top: 12px; }
.calculator-notes p { margin-bottom: 8px; }

@media (max-width: 700px) {
  .calculator-actions > * { flex: 1 1 100%; }
  .calculator-card .table { min-width: 460px; }
}

@media print {
  .calculator-hero label, .calculator-jump, .calculator-actions, .calculator-status { display: none !important; }
  .calculator-card { break-inside: avoid; border: 1px solid #bbb; }
  .calculator-notes { display: block; }
}

/* Dashboard di mercato: controlli separati dall'area dati e tabelle scorrevoli. */
.dashboard-tabs { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 24px; }
.dashboard-tab { min-height: 42px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: var(--surface); font-weight: 800; cursor: pointer; }
.dashboard-tab[aria-pressed="true"] { color: #fff; border-color: var(--navy); background: var(--navy); }
.dashboard-tab-link { display: inline-flex; align-items: center; text-decoration: none; }
.dashboard-workbench { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.dashboard-controls { position: sticky; top: 88px; min-width: 0; max-height: calc(100vh - 110px); overflow-y: auto; }
.dashboard-controls h2 { margin-bottom: 6px; }
.dashboard-series { margin: 20px 0 0; padding: 0; border: 0; }
.dashboard-series legend { margin-bottom: 10px; font-weight: 850; }
[data-dashboard-series-list] { max-height: 330px; overflow-y: auto; border-block: 1px solid var(--line); }
.series-option { display: grid; grid-template-columns: minmax(0, 1fr) 40px; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.series-option[hidden] { display: none; }
.series-option label { display: flex; gap: 9px; align-items: flex-start; margin: 0; cursor: pointer; }
.series-option input { flex: 0 0 auto; width: 19px; height: 19px; margin-top: 2px; accent-color: var(--teal); }
.series-option span, .series-option strong, .series-option small { display: block; min-width: 0; }
.series-option small { margin-top: 2px; color: var(--muted); font-weight: 500; }
.favorite-series { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); background: var(--surface); font-size: 1.15rem; cursor: pointer; }
.dashboard-control-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.dashboard-custom-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dashboard-actions > * { flex: 1 1 140px; }
.dashboard-output { min-width: 0; display: grid; gap: 20px; }
.dashboard-output > .card { min-width: 0; }
.dashboard-status { min-height: 1.5em; margin: 0; color: var(--muted); font-weight: 750; }
.dashboard-chart-card .card-head { align-items: flex-start; }
.market-comparison-chart { min-height: 300px; overflow-x: auto; }
.market-comparison-chart svg { display: block; width: 100%; min-width: 640px; height: auto; color: var(--text); }
.dashboard-legend { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 12px; }
.dashboard-legend span { display: inline-flex; gap: 7px; align-items: center; font-size: .82rem; }
.dashboard-legend i { width: 22px; height: 5px; border-radius: 99px; }
.dashboard-data-table { max-height: 520px; overflow: auto; }
.dashboard-data-table .table, [data-market-metrics] .table { min-width: 760px; }
.market-source-list { display: grid; gap: 12px; }
.market-source-list div { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.market-source-list dt { font-weight: 850; }
.market-source-list dd { margin: 4px 0 0; color: var(--muted); }

@media (max-width: 980px) {
  .dashboard-workbench { grid-template-columns: 1fr; }
  .dashboard-controls { position: static; max-height: none; }
  [data-dashboard-series-list] { max-height: 430px; }
}

@media (max-width: 700px) {
  .dashboard-tab { flex: 1 1 calc(50% - 9px); border-radius: 13px; }
  .dashboard-control-grid, .dashboard-custom-dates { grid-template-columns: 1fr; }
  .market-comparison-chart { margin-inline: -4px; }
  .market-comparison-chart svg { min-width: 620px; }
}

@media print {
  .dashboard-tabs, .dashboard-controls, .dashboard-status, .cookie-banner { display: none !important; }
  .dashboard-workbench { display: block; }
  .dashboard-output { display: block; }
  .dashboard-output .card { margin-bottom: 18px; break-inside: avoid; }
  .market-comparison-chart { overflow: visible; }
  .market-comparison-chart svg { min-width: 0; }
}

/* Portafoglio virtuale: totali separati per valuta e controlli leggibili su mobile. */
.portfolio-entry-grid { align-items: start; }
.portfolio-summary { margin: 34px 0; }
.compact-heading { margin-bottom: 16px; }
.compact-heading h2 { margin-bottom: 0; }
.portfolio-currency-card { min-width: 0; }
.portfolio-currency-card .card-head { margin-bottom: 12px; }
.portfolio-currency-card h3 { margin: 0; font-size: 1.6rem; }
.portfolio-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
.portfolio-metrics div { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.portfolio-metrics dt { color: var(--muted); font-size: .78rem; font-weight: 750; }
.portfolio-metrics dd { margin: 4px 0 0; font-size: 1.05rem; font-weight: 900; overflow-wrap: anywhere; }
.portfolio-page .compact-input { min-width: 130px; margin: 0; }
.portfolio-page th small { display: block; margin-top: 3px; color: var(--muted); font-weight: 500; }
.portfolio-benchmark { margin-top: 28px; }

/* Indicatore educativo e SRI: colori e riquadri restano semanticamente separati. */
.risk-page > .container { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.risk-page > .container > *, .risk-method, .risk-method .table-wrap { min-width: 0; max-width: 100%; }
.risk-distinction { align-items: stretch; }
.risk-distinction .card { border-top: 5px solid var(--teal); }
.risk-distinction .official-risk-card { border-top-color: var(--gold); }
.risk-method { border-left: 5px solid var(--navy-2); }
.risk-method-state { padding: 7px 10px; border-radius: 999px; color: #fff; background: var(--green); font-size: .75rem; font-weight: 850; }
.risk-factor-table caption { padding: 8px 0; color: var(--muted); font-weight: 800; text-align: left; }
.risk-instrument-grid { align-items: start; }
.risk-instrument-card { min-width: 0; }
.risk-instrument-card h3 { margin: 4px 0; }
.risk-reading { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 16px; align-items: start; margin: 18px 0; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); }
.official-risk-reading { border-style: dashed; background: var(--surface); }
.risk-reading h4 { margin: 8px 0; }
.risk-reading p { margin-bottom: 7px; }
.risk-score { --risk-color: var(--gold); display: grid; place-content: center; width: 76px; height: 76px; border: 6px solid color-mix(in srgb, var(--risk-color) 25%, var(--surface)); border-radius: 50%; color: #fff; background: var(--risk-color); text-align: center; box-shadow: var(--shadow-small); }
.risk-score strong, .risk-score span { display: block; line-height: 1; }
.risk-score strong { font-size: 1.9rem; }
.risk-score span { margin-top: 4px; font-size: .68rem; }
.risk-score.official { outline: 2px solid var(--gold); outline-offset: 3px; }
.risk-level-1 { --risk-color: #21865b; }
.risk-level-2 { --risk-color: #4b9c4f; }
.risk-level-3 { --risk-color: #83a937; }
.risk-level-4 { --risk-color: #bd9823; }
.risk-level-5 { --risk-color: #d87627; }
.risk-level-6 { --risk-color: #ce4f32; }
.risk-level-7 { --risk-color: #a92e3e; }
.risk-factor-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 0; }
.risk-factor-list div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 10px; background: var(--surface-soft); }
.risk-factor-list dt { color: var(--muted); }
.risk-factor-list dd { margin: 0; font-weight: 850; }

@media (max-width: 700px) {
  .portfolio-metrics, .risk-factor-list { grid-template-columns: 1fr; }
  .risk-reading { grid-template-columns: 68px minmax(0, 1fr); padding: 14px; }
  .risk-score { width: 62px; height: 62px; border-width: 4px; }
  .risk-score strong { font-size: 1.45rem; }
}

@media print {
  .portfolio-page form, .portfolio-page .calculator-actions, .risk-page details { display: none !important; }
  .risk-reading, .portfolio-metrics div { break-inside: avoid; }
}
