/* ===========================================================================
   Stili delle sezioni interattive: Sfida dei mercati, Rassegna, Cerchio
   ciclometrico e percorso di abbonamento.
   Caricato solo dalle pagine che lo richiedono ($extraStyles in header.php).
   I colori usano le variabili definite in style.css (:root).
   =========================================================================== */

/* ------------------------------------------------------------------ Sfida */
.sfida-card { display: flex; flex-direction: column; gap: 6px; }
.sfida-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sfida-head h3 { margin: 2px 0 0; }
.sfida-value { text-align: right; white-space: nowrap; }
.sfida-value b { display: block; font-size: 1.5rem; letter-spacing: -.01em; }
.sfida-value small { color: var(--muted); }
.sfida-question { margin: 8px 0; font-size: 1.02rem; }
.sfida-vote { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.sfida-vote .btn { flex: 1 1 140px; min-height: 48px; }
.sfida-split { height: 12px; border-radius: 99px; background: rgba(200, 60, 60, .28); overflow: hidden; margin-top: 8px; }
.sfida-split-up { display: block; height: 100%; background: var(--green); }
.sfida-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.sfida-stats div { padding: 12px; border-radius: var(--radius-small); background: var(--surface-soft); text-align: center; }
.sfida-stats b { display: block; font-size: 1.5rem; }
.sfida-stats span { color: var(--muted); font-size: .82rem; }
.sfida-me { background: rgba(242, 140, 40, .12); }

/* --------------------------------------------------------------- Rassegna */
.digest-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.digest-summary ul { margin: 8px 0; padding-left: 20px; line-height: 1.6; }
.digest-news { list-style: none; margin: 8px 0 0; padding: 0; }
.digest-news li { padding: 9px 0; border-top: 1px solid var(--line); line-height: 1.45; }
.digest-news small { display: block; color: var(--muted); }
.digest-archive { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.digest-archive small { color: var(--muted); }
.digest-archive a[aria-current="page"] { font-weight: 800; }

/* ---------------------------------------------------- Cerchio ciclometrico */
.cerchio-layout { display: grid; gap: 20px; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; }
.cerchio-form fieldset { border: 1px solid var(--line); border-radius: var(--radius-small); margin: 0 0 14px; padding: 12px 14px 14px; }
.cerchio-form legend { padding: 0 6px; font-weight: 800; font-size: .86rem; }
.cerchio-form label { display: block; margin: 9px 0 4px; font-size: .82rem; font-weight: 750; color: var(--muted); }
.cerchio-form .input, .cerchio-form select, .cerchio-form textarea { width: 100%; }
.cerchio-form textarea { min-height: 130px; font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.cerchio-form .check { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-size: .92rem; font-weight: 600; color: var(--text); }
.cerchio-form .check input { width: 18px; height: 18px; flex: none; }
.cerchio-form output { font-weight: 800; color: var(--text); }
.cerchio-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cerchio-stage { position: relative; }
.cerchio-stage svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; touch-action: manipulation; }
.cerchio-status { min-height: 1.5em; margin: 8px 0; font-weight: 700; }
.cerchio-status.errore { color: var(--red); }
.cerchio-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: .85rem; color: var(--muted); }
.cerchio-selection { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-small); background: var(--surface-soft); font-size: .92rem; }
.cerchio-selection ul { margin: 6px 0 0; padding-left: 18px; }
.cerchio-figure { padding: 12px 0; border-top: 1px solid var(--line); }
.cerchio-figure:first-child { border-top: 0; }
.cerchio-figure h3 { margin: 0 0 4px; font-size: 1.02rem; }
.cerchio-figure-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cerchio-figure-list button { padding: 6px 10px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); color: var(--text); font: inherit; font-size: .8rem; cursor: pointer; }
.cerchio-figure-list button[aria-pressed="true"] { border-color: var(--gold); background: rgba(242, 140, 40, .16); font-weight: 800; }
.cerchio-verdict { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .78rem; font-weight: 800; }
.cerchio-verdict.caso { background: rgba(100, 118, 106, .16); color: var(--muted); }
.cerchio-verdict.raro { background: rgba(242, 140, 40, .2); color: #7c4a12; }
.cerchio-warnings { margin: 0; padding-left: 18px; line-height: 1.55; }
.cerchio-presets { list-style: none; margin: 8px 0 0; padding: 0; }
.cerchio-presets li { display: flex; gap: 6px; align-items: center; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--line); }
.cerchio-presets button { border: 0; background: none; color: var(--blue); font: inherit; font-weight: 700; cursor: pointer; text-align: left; padding: 4px 0; }
/* Elementi del disegno SVG */
.cx-ring { fill: var(--surface-soft); stroke: var(--line); stroke-width: 2; }
.cx-spoke { stroke: var(--line); stroke-width: 1; }
.cx-tick-label { fill: var(--muted); font-size: 12px; text-anchor: middle; dominant-baseline: middle; }
.cx-point { cursor: pointer; }
.cx-point .cx-shape { stroke: var(--surface); stroke-width: 1.5; }
.cx-point.max .cx-shape { fill: var(--red); }
.cx-point.min .cx-shape { fill: var(--green); }
.cx-point.oss .cx-shape { fill: var(--blue); }
.cx-point.selected .cx-shape { stroke: var(--gold); stroke-width: 4; }
.cx-point:focus-visible { outline: none; }
.cx-point:focus-visible .cx-shape { stroke: var(--text); stroke-width: 4; }
.cx-figure { fill: rgba(242, 140, 40, .14); stroke: var(--gold); stroke-width: 3; stroke-linejoin: round; }
.cx-axis { stroke: var(--violet); stroke-width: 2.5; stroke-dasharray: 8 6; }
.cx-center { fill: var(--text); font-size: 22px; font-weight: 800; text-anchor: middle; }
.cx-center-sub { fill: var(--muted); font-size: 12px; text-anchor: middle; }
.cx-label { fill: var(--text); font-size: 11px; font-weight: 700; text-anchor: middle; }

/* ------------------------------------------------ Percorso di abbonamento */
.funnel-progress { display: flex; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; }
.funnel-progress li { flex: 1; padding: 8px 6px; border-radius: 99px; background: var(--surface-soft); color: var(--muted); font-size: .78rem; font-weight: 800; text-align: center; }
.funnel-progress li.done { background: var(--navy-2); color: #fff; }
.funnel-progress li.current { background: var(--gold); color: #2b1a05; }
.funnel-question { border: 0; margin: 0 0 16px; padding: 0; }
.funnel-question legend { font-weight: 800; font-size: 1.05rem; margin-bottom: 8px; }
.funnel-options { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.funnel-option { position: relative; display: block; }
.funnel-option input { position: absolute; opacity: 0; inset: 0; }
.funnel-option span { display: block; min-height: 56px; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius-small); background: var(--surface); font-weight: 700; cursor: pointer; }
.funnel-option input:checked + span { border-color: var(--navy-2); background: var(--surface-soft); box-shadow: inset 0 0 0 1px var(--navy-2); }
.funnel-option input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.funnel-proof { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.funnel-proof div { padding: 16px 12px; border-radius: var(--radius-small); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.funnel-proof b { display: block; font-size: 1.7rem; letter-spacing: -.02em; }
.funnel-proof span { color: var(--muted); font-size: .84rem; }
.funnel-path { margin: 10px 0 0; padding-left: 20px; line-height: 1.7; }
.funnel-deadline { display: inline-block; margin: 6px 0; padding: 6px 12px; border-radius: 99px; background: rgba(242, 140, 40, .18); color: #7c4a12; font-weight: 800; }
.funnel-plan.suggested { border: 2px solid var(--gold); }
.funnel-steps { counter-reset: passo; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.funnel-steps li { counter-increment: passo; padding: 16px; border-radius: var(--radius-small); background: var(--surface); border: 1px solid var(--line); }
.funnel-steps li::before { content: counter(passo); display: inline-grid; place-items: center; width: 30px; height: 30px; margin-bottom: 8px; border-radius: 50%; background: var(--navy-2); color: #fff; font-weight: 800; }

/* Nota comune richiudibile nelle schede (testo condiviso dalla categoria). */
.shared-note { margin: 8px 0 16px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: var(--radius-small); }
.shared-note summary { cursor: pointer; font-weight: 700; color: var(--muted); }

.inline-form { display: inline-flex; flex-wrap: wrap; gap: 6px; }

@media (max-width: 860px) {
  .cerchio-layout { grid-template-columns: 1fr; }
  .funnel-progress li { font-size: .7rem; padding: 7px 3px; }
}
