/**
 * staffetta.css – pagina "Staffetta 2027"
 * Tutte le classi iniziano con .sf- per non interferire con il tema.
 * Usa le variabili di brand-vars.css (con valori di riserva).
 */
.staffetta-body { margin: 0; }
.sf-page {
    --sf-navy: var(--navy, #1E3A5F);
    --sf-blue: var(--accent, #4A90D9);
    --sf-ink: #14263D;
    --sf-text: #2B4258;
    --sf-muted: #4A6073;
    --sf-line: var(--border-1, #C9D6E2);
    --sf-ground: #F2F6F9;
    --sf-signal: #E8590C;
    --sf-signal-soft: #FFE9DB;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    color: var(--sf-ink);
    background: var(--sf-ground);
    overflow: hidden;
}
.sf-page *, .sf-page *::before, .sf-page *::after { box-sizing: border-box; }
.sf-page button { font-family: inherit; color: inherit; cursor: pointer; }
.sf-page h1, .sf-page h2, .sf-page h3, .sf-page p, .sf-page dl, .sf-page dd, .sf-page dt { margin: 0; }
.sf-page :focus-visible { outline: 3px solid var(--sf-signal); outline-offset: 2px; }

.sf-wrap { max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 64px); }
.sf-h2 { font-family: 'Barlow Condensed', 'Inter', sans-serif; font-weight: 800; font-size: clamp(38px, 5.4vw, 60px); line-height: 1; max-width: 760px; }
.sf-h3 { font-size: 20px; line-height: 1.25; font-weight: 700; margin-bottom: 10px; }
.sf-lead { margin-top: 16px; max-width: 620px; font-size: 18px; line-height: 1.55; color: var(--sf-text); }
.sf-note { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--sf-muted); }
.sf-section { padding: clamp(56px, 8vw, 100px) 0 clamp(32px, 5vw, 64px); }
.sf-section--map { padding-top: clamp(24px, 4vw, 48px); padding-bottom: clamp(56px, 8vw, 96px); }
.sf-section--white { background: #fff; border-top: 1px solid var(--sf-line); padding-bottom: clamp(56px, 8vw, 96px); }
.sf-cols { margin-top: 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 36px 40px; }
.sf-cols p { font-size: 17px; line-height: 1.6; color: var(--sf-text); }

/* ── Hero ── */
.sf-hero { background: var(--sf-navy); color: #F4F8FA; padding-top: clamp(40px, 7vw, 88px); position: relative; }
.sf-hero__kicker { font-size: 16px; font-weight: 600; color: #BCD0E2; }
.sf-hero__title { margin-top: clamp(28px, 6vw, 64px) !important; font-family: 'Barlow Condensed', 'Inter', sans-serif; font-weight: 800; font-size: clamp(64px, 14vw, 180px); line-height: .9; color: #fff; }
.sf-hero__sub { margin-top: 24px; max-width: 660px; font-size: clamp(22px, 3vw, 30px); line-height: 1.22; font-weight: 600; }
.sf-hero__text { margin-top: 18px; max-width: 640px; font-size: 18px; line-height: 1.55; color: #D3E0EA; }
.sf-facts { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px 40px; }
.sf-facts dt { font-size: 26px; font-weight: 700; line-height: 1.2; }
.sf-facts dd { font-size: 16px; line-height: 1.35; color: #BCD0E2; }
.sf-hero__profile { position: relative; height: clamp(150px, 22vw, 260px); margin-top: 36px; }
.sf-hero__profile svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sf-hero__area { fill: #2A5384; }
.sf-hero__line { fill: none; stroke: #FFA05C; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sf-hero__from, .sf-hero__to { position: absolute; bottom: 14px; font-size: 15px; font-weight: 600; color: #fff; }
.sf-hero__from { left: clamp(20px, 4vw, 64px); }
.sf-hero__to { right: clamp(20px, 4vw, 64px); text-align: right; }

/* ── Mappa e pannello ── */
.sf-mapgrid { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.sf-mapcol { flex: 0 1 560px; width: 100%; max-width: 560px; min-width: 0; }
.sf-sidecol { flex: 1 1 380px; min-width: 0; }
.sf-map { position: relative; width: 100%; background: #F8FBFD; border: 1px solid var(--sf-line); overflow: hidden; }
.sf-map > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sf-trk { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 5; }
.sf-trk--auto { stroke: #6E8191; stroke-dasharray: 2 10; }
.sf-trk--1 { stroke: #8DBBE8; }
.sf-trk--2 { stroke: #4A90D9; }
.sf-trk--3 { stroke: #12294A; }
.sf-trk--casing { stroke: #fff; stroke-width: 15; }
.sf-trk--sel { stroke: var(--sf-signal); stroke-width: 8; }
.sf-maplabel { position: absolute; font-size: clamp(10px, 2.3vw, 12px); line-height: 18px; font-weight: 600; color: var(--sf-ink); white-space: nowrap; pointer-events: none;
    text-shadow: 0 0 3px #F8FBFD, 0 0 3px #F8FBFD, 0 0 3px #F8FBFD, 0 0 3px #F8FBFD; }
.sf-mk { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #fff; padding: 0; transition: width .15s, height .15s; }
.sf-mk::after { content: ''; position: absolute; inset: -12px; }
.sf-legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; line-height: 1.3; color: var(--sf-text); }
.sf-legend span { display: flex; align-items: center; gap: 8px; }
.sf-legend__ramp { display: flex; gap: 2px; }
.sf-legend__ramp b { width: 16px; height: 5px; display: block; }
.sf-legend__dots { width: 26px; border-top: 4px dotted #6E8191; display: block; }
.sf-legend__sel { width: 26px; height: 6px; background: var(--sf-signal); display: block; }

.sf-panel { background: #fff; border: 1px solid var(--sf-line); padding: clamp(20px, 3vw, 30px); }
.sf-panel__kicker { font-size: 15px; font-weight: 600; color: #C2410C; }
.sf-panel__title { margin-top: 6px !important; font-family: 'Barlow Condensed', 'Inter', sans-serif; font-weight: 800; font-size: clamp(32px, 4vw, 44px); line-height: 1.02; }
.sf-panel__sub { margin-top: 8px; font-size: 17px; line-height: 1.4; color: var(--sf-text); }
.sf-stats { margin-top: 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(130px, 100%), 1fr)); gap: 18px 20px; }
.sf-stats dt { font-size: 14px; color: var(--sf-muted); }
.sf-stats dd { font-size: 21px; font-weight: 700; }
.sf-stats__diff { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.sf-stats__diff span:last-child { font-size: 15px; font-weight: 600; }
.sf-dots { display: flex; gap: 4px; }
.sf-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--sf-ink); background: #fff; display: block; }
.sf-dot--on { background: var(--sf-ink); }
.sf-panel__hint { margin-top: 22px; font-size: 16px; line-height: 1.5; color: var(--sf-text); }
.sf-panel__nav { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.sf-btn { border: 1px solid var(--sf-ink); background: #fff; border-radius: 8px; padding: 10px 16px; min-height: 44px; font-size: 15px; font-weight: 600; }
.sf-btn:disabled { opacity: .35; cursor: default; }

.sf-profile { margin-top: 28px; }
.sf-profile__title { font-size: 17px; font-weight: 700; }
.sf-profile__box { position: relative; margin-top: 10px; height: 170px; background: #fff; border: 1px solid var(--sf-line); }
.sf-profile__box svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sf-profile__band { position: absolute; top: 0; bottom: 0; background: #FFD9C2; }
.sf-profile__grid { stroke: #DCE7EE; stroke-width: 1; vector-effect: non-scaling-stroke; }
.sf-profile__area { fill: #A9C4DD; }
.sf-profile__line { fill: none; stroke: var(--sf-ink); stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sf-profile__y { position: absolute; left: 8px; font-size: 13px; color: var(--sf-text); }
.sf-profile__x { position: relative; margin-top: 6px; height: 18px; font-size: 13px; color: var(--sf-text); }
.sf-profile__x span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.sf-profile__x span:first-child { transform: none; }
.sf-profile__x span:last-child { transform: translateX(-100%); }

/* ── Elenco tappe ── */
.sf-chips { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.sf-chip { border: 1px solid #9DB2C3; background: #fff; border-radius: 999px; padding: 10px 18px; min-height: 44px; font-size: 15px; font-weight: 600; }
.sf-chip[aria-pressed="true"] { background: var(--sf-ink); color: #fff; border-color: var(--sf-ink); }
.sf-tablewrap { margin-top: 24px; overflow-x: auto; border: 1px solid var(--sf-line); }
.sf-table { width: 100%; min-width: 940px; border-collapse: collapse; font-size: 16px; }
.sf-table th { background: #E6EEF3; text-align: left; font-size: 14px; font-weight: 700; padding: 12px 10px; }
.sf-table td { padding: 8px 10px; border-top: 1px solid #DCE7EE; vertical-align: middle; font-variant-numeric: tabular-nums; }
.sf-table th:first-child, .sf-table td:first-child { padding-left: 16px; }
.sf-table tr.is-sel td { background: var(--sf-signal-soft); }
.sf-table .sf-num { font-weight: 700; }
.sf-table .sf-auto { color: var(--sf-muted); font-weight: 600; }
.sf-rowbtn { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer; }
.sf-rowbtn:focus-visible { outline: 3px solid var(--sf-signal); outline-offset: 2px; }
.sf-rowbtn b { display: block; font-weight: 700; line-height: 1.25; }
.sf-rowbtn small { display: block; font-size: 14px; line-height: 1.3; color: var(--sf-muted); }

/* ── Chiusura ── */
.sf-closing { background: var(--sf-navy); color: #F4F8FA; padding: clamp(44px, 6vw, 72px) 0; }
.sf-closing__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 28px; }
.sf-closing__title { font-family: 'Barlow Condensed', 'Inter', sans-serif; font-weight: 800; font-size: clamp(34px, 4.6vw, 52px); line-height: 1.02; }
.sf-closing p { margin-top: 14px; max-width: 560px; font-size: 18px; line-height: 1.55; color: #D3E0EA; }
.sf-closing .sf-closing__sig { margin: 0; font-size: 16px; font-weight: 600; color: #fff; }

@media (prefers-reduced-motion: reduce) { .sf-mk { transition: none; } }

/* ── Adesioni ── */
.sf-section--join { padding-bottom: clamp(56px, 8vw, 96px); }
.sf-join { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.sf-join__intro { flex: 1 1 340px; min-width: 0; }
.sf-req { margin-top: 28px; padding: 18px 20px; background: var(--sf-signal-soft); border-left: 4px solid var(--sf-signal); }
.sf-req__title { font-size: 15px; font-weight: 700; color: #C2410C; margin-bottom: 6px !important; }
.sf-req p { font-size: 16px; line-height: 1.5; color: var(--sf-ink); }
.sf-form { flex: 1 1 420px; min-width: 0; background: #fff; border: 1px solid var(--sf-line); padding: clamp(20px, 3vw, 30px); display: grid; gap: 20px; }
.sf-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 16px; }
.sf-field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.sf-field > span, .sf-field legend { font-size: 15px; font-weight: 600; color: var(--sf-ink); padding: 0; }
.sf-form input[type="text"], .sf-form select { width: 100%; min-height: 46px; padding: 10px 12px; font: inherit; font-size: 16px; color: var(--sf-ink); background: #fff; border: 1px solid #9DB2C3; border-radius: 8px; }
.sf-form input[type="text"]:focus, .sf-form select:focus { border-color: var(--sf-ink); outline: 3px solid var(--sf-signal); outline-offset: 1px; }
.sf-choice { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.sf-choice legend { width: 100%; margin-bottom: 8px; }
.sf-choice label, .sf-check { display: flex; align-items: flex-start; gap: 10px; font-size: 16px; line-height: 1.4; color: var(--sf-text); cursor: pointer; }
.sf-choice input, .sf-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--sf-ink); }
.sf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.sf-submit { justify-self: start; border: 0; background: var(--sf-signal); color: #fff !important; border-radius: 8px; padding: 12px 22px; min-height: 48px; font-size: 16px; font-weight: 700; }
.sf-submit:hover { background: #C2410C; }
.sf-msg { padding: 14px 16px; font-size: 15px; line-height: 1.5; border-radius: 6px; }
.sf-msg--ok { background: #E3F4E8; color: #14532D; border: 1px solid #A7D8B5; }
.sf-msg--err { background: #FDECEC; color: #7F1D1D; border: 1px solid #F3B4B4; }
.sf-msg ul { margin: 6px 0 0; padding-left: 20px; }

.sf-people { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 10px; }
.sf-person { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 16px; background: var(--sf-ground); border: 1px solid var(--sf-line); }
.sf-person__name { font-size: 17px; font-weight: 700; }
.sf-person__leg { font-size: 14px; color: var(--sf-text); }
.sf-person__leg b { color: var(--sf-ink); }
.sf-person__leg--none { color: var(--sf-muted); font-style: italic; }
.sf-person__del { margin-left: auto; }
.sf-person__del button { border: 1px solid #C9A3A3; background: #fff; color: #7F1D1D; border-radius: 6px; padding: 4px 10px; font-size: 13px; }
.sf-page [hidden] { display: none !important; }

/* ── Profilo della singola tappa ── */
.sf-stage__cap { margin-top: 2px; font-size: 14px; line-height: 1.4; color: var(--sf-muted); }
.sf-profile__box--stage { height: 150px; }
.sf-profile__area--stage { fill: #FFD9C2; }
.sf-profile__line--stage { stroke: #C2410C; stroke-width: 2; }
.sf-stage__y { background: rgba(255, 255, 255, .8); padding: 0 4px; border-radius: 3px; }
.sf-stage__y--hi { top: 6px; }
.sf-stage__y--lo { bottom: 6px; }

/* Annullamento della propria adesione */
.sf-msg--note { background: #FFF6E5; color: #6B4A0B; border: 1px solid #F0D49A; margin-top: 10px; word-break: break-all; }
.sf-msg--note a { color: inherit; text-decoration: underline; }
.sf-person__del--own button { border-color: #C9A3A3; }
