/* ==========================================================================
   Simulatore del costo di una gara (cliente 13/11/2026, punto 63): pagina
   Costi, sezione #simulatore (t4-simulatore.js).
   - .t4sim       scelte a sinistra, riepilogo con il totale a destra
   - .t4sim-opt   card di scelta, stessa forma di quelle dell'iscrizione
                  (.t4is-opt): tonda = una sola, quadrata = sì/no
   - .t4sim-sum   riepilogo voce per voce con il totale
   - .t4sim-box   elenchi «Incluso», «Su richiesta», «Escluso»
   - .t4sim-bar   da telefono, il totale resta in vista mentre si sceglie
   Token e .t4-pill da t4-fx.css. Misure in px con clamp(): la root del tema
   cambia valore con la larghezza. position:sticky solo sotto i 992px (da lì in
   su c'è ScrollSmoother). Movimento solo con prefers-reduced-motion: no-preference.
   ========================================================================== */
.t4sim { align-items: start; color: var(--t4-navy); display: grid; font-family: var(--t4-mono); font-size: 14px; gap: clamp(24px, 3vw, 56px); grid-template-columns: minmax(0, 1fr); line-height: 1.55; margin-top: clamp(20px, 2.4vw, 40px); }
@media (min-width: 992px) { .t4sim { grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); } }
.t4sim *, .t4sim *::before, .t4sim *::after { box-sizing: border-box; }
.t4sim :focus-visible { outline: 2px solid var(--t4-blue); outline-offset: 3px; }
.t4sim[aria-busy=true] .t4sim-form { opacity: .6; pointer-events: none; }
.t4sim-msg { font-family: var(--t4-mono); font-size: 15px; line-height: 1.55; margin: clamp(16px, 2vw, 28px) 0 0; max-width: 62ch; opacity: .8; }

/* ---------------- scelte ---------------- */
.t4sim-form { min-width: 0; }
.t4sim-g { border: 0; margin: 0 0 clamp(22px, 2.2vw, 32px); min-width: 0; padding: 0; }
.t4sim-g legend, .t4sim-l { color: var(--t4-blue); display: block; font-size: 11px; letter-spacing: .12em; margin: 0 0 8px; padding: 0; text-transform: uppercase; }
.t4sim-g__h { font-size: 13px; line-height: 1.5; margin: 0 0 10px; max-width: 62ch; opacity: .75; }
.t4sim-g--race select {
  appearance: none;
  background-color: #fff;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 22px) 55%, calc(100% - 16px) 55%;
  background-repeat: no-repeat;
  background-size: 6px 6px;
  border: 1px solid rgba(14, 20, 48, .45);
  border-radius: 12px;
  color: var(--t4-navy);
  cursor: pointer;
  font: inherit;
  font-size: 16px;   /* niente zoom su iOS */
  padding: 13px 44px 13px 14px;
  text-overflow: ellipsis;
  width: 100%;
}
.t4sim-opts { display: grid; gap: 10px; }
@media (min-width: 640px) { .t4sim-opts--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.t4sim-opts--chips { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.t4sim-opt { cursor: pointer; display: block; position: relative; }
.t4sim-opt input { height: 1px; left: 0; opacity: 0; position: absolute; top: 0; width: 1px; }
.t4sim-opt__c {
  align-items: center;
  background: #fff;
  border: 1px solid var(--t4-hair);
  border-radius: 20px;
  column-gap: 12px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  height: 100%;
  min-height: 64px;
  padding: 14px 18px 14px 14px;
}
.t4sim-opt:hover .t4sim-opt__c { border-color: rgba(14, 20, 48, .38); }
.t4sim-opt input:checked + .t4sim-opt__c { background: linear-gradient(rgba(134, 160, 255, .12), rgba(134, 160, 255, .12)), #fff; border-color: var(--t4-blue); box-shadow: inset 0 0 0 1px var(--t4-blue); }
.t4sim-opt input:focus-visible + .t4sim-opt__c { outline: 2px solid var(--t4-blue); outline-offset: 3px; }
.t4sim-opt.is-off { cursor: default; }
.t4sim-opt.is-off .t4sim-opt__c { background: rgba(255, 255, 255, .55); border-style: dashed; }
/* segno della scelta: tondo per le alternative, quadrato per le voci sì/no */
.t4sim-opt__m { border: 1px solid rgba(14, 20, 48, .4); border-radius: 50%; display: grid; height: 20px; place-items: center; width: 20px; }
.t4sim-opt__m::after { background: var(--t4-blue); border-radius: 50%; content: ""; height: 10px; transform: scale(0); width: 10px; }
.t4sim-opt--box .t4sim-opt__m { border-radius: 6px; }
.t4sim-opt--box .t4sim-opt__m::after { border-radius: 3px; }
.t4sim-opt input:checked + .t4sim-opt__c .t4sim-opt__m { border-color: var(--t4-blue); }
.t4sim-opt input:checked + .t4sim-opt__c .t4sim-opt__m::after { transform: scale(1); }
.t4sim-opt__t { display: grid; gap: 3px; min-width: 0; }
.t4sim-opt__t strong { font-family: var(--t4-head); font-size: 16px; font-weight: 500; letter-spacing: -.01em; line-height: 1.2; overflow-wrap: anywhere; }
.t4sim-opt__t small { font-size: 12px; line-height: 1.45; opacity: .72; }
.t4sim-opt__p { font-size: 12px; justify-self: end; letter-spacing: .04em; text-align: right; text-transform: uppercase; white-space: nowrap; }
.t4sim-opt__p .is-req { color: #8a5a00; }
.t4sim-opts--chips .t4sim-opt__c { grid-template-columns: 22px minmax(0, 1fr); row-gap: 2px; }
.t4sim-opts--chips .t4sim-opt__p { grid-column: 2; justify-self: start; text-align: left; }
/* card strette (telefono): il prezzo va sotto il testo, non lo schiaccia */
@media (max-width: 479px) {
  .t4sim-opt__c { grid-template-columns: 22px minmax(0, 1fr); row-gap: 4px; }
  .t4sim-opt__p { grid-column: 2; justify-self: start; text-align: left; }
}

/* ---------------- totale in vista da telefono ---------------- */
.t4sim-bar { align-items: center; background: var(--t4-navy); border-radius: 999px; bottom: 12px; box-shadow: 0 12px 30px rgba(14, 20, 48, .28); color: #fff; display: flex; gap: 10px; margin: 0; padding: 8px 8px 8px 18px; position: sticky; z-index: 4; }
.t4sim-bar span { flex: 0 1 auto; font-size: 10px; min-width: 0; letter-spacing: .1em; line-height: 1.2; opacity: .8; text-transform: uppercase; }
.t4sim-bar b { font-family: var(--t4-head); font-size: 20px; font-weight: 500; letter-spacing: -.01em; margin-right: auto; white-space: nowrap; }
.t4sim-bar button { flex: 0 0 auto; background: #fff; border: 0; border-radius: 999px; color: var(--t4-navy); cursor: pointer; font: inherit; font-size: 11px; letter-spacing: .08em; min-height: 40px; padding: 0 14px; text-transform: uppercase; white-space: nowrap; }
@media (min-width: 992px) { .t4sim-bar { display: none; } }

/* ---------------- riepilogo ---------------- */
.t4sim-out { min-width: 0; }
.t4sim-out:focus { outline: none; }
.t4sim-sum { background: var(--t4-grad); border-radius: 24px; box-shadow: 0 24px 60px rgba(14, 20, 48, .18); color: #fff; overflow: hidden; padding: clamp(20px, 2vw, 32px); }
.t4sim-sum__k { color: #c9d4ff; font-size: 11px; letter-spacing: .12em; margin: 0; text-transform: uppercase; }
.t4sim-sum__t { color: #fff; font-family: var(--t4-head); font-size: clamp(22px, 2vw, 32px); font-weight: 500; letter-spacing: -.02em; line-height: 1.08; margin: 10px 0 0; text-transform: uppercase; }
.t4sim-sum__p { margin: 8px 0 0; opacity: .85; }
.t4sim-lines { border-top: 1px solid rgba(255, 255, 255, .22); list-style: none; margin: 20px 0 0; padding: 0; }
.t4sim-lines li { border-bottom: 1px solid rgba(255, 255, 255, .14); column-gap: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 10px 0; }
.t4sim-lines li small { display: block; font-size: 11px; opacity: .72; }
.t4sim-lines b { font-weight: 400; text-align: right; white-space: nowrap; }
.t4sim-lines .is-req b { color: #ffd88a; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.t4sim-total { align-items: baseline; display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; margin: 16px 0 0; }
.t4sim-total span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.t4sim-total b { font-family: var(--t4-head); font-size: clamp(32px, 2.8vw, 46px); font-weight: 500; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.t4sim-sum__warn { background: rgba(255, 216, 138, .16); border: 1px solid rgba(255, 216, 138, .5); border-radius: 12px; color: #ffe9bd; font-size: 12px; line-height: 1.5; margin: 14px 0 0; padding: 10px 12px; }
.t4sim-sum__note { font-size: 12px; line-height: 1.5; margin: 14px 0 0; opacity: .82; }
.t4sim-sum__cta { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.t4sim-sum__cta:empty { display: none; }
.t4sim a.t4-pill, .t4sim a.t4-pill:hover { color: var(--pill-fg); text-decoration: none; }
@media (max-width: 479px) { .t4sim-sum__cta .t4-pill { justify-content: space-between; width: 100%; } }

/* ---------------- incluso / su richiesta / escluso ---------------- */
.t4sim-boxes { display: grid; gap: 12px; margin-top: 16px; }
.t4sim-box { background: #fff; border: 1px solid var(--t4-hair); border-left: 4px solid var(--t4-blue); border-radius: 16px; padding: 16px 18px; }
.t4sim-box h4 { color: var(--t4-navy); font-family: var(--t4-mono); font-size: 11px; font-weight: 400; letter-spacing: .12em; margin: 0 0 8px; text-transform: uppercase; }
.t4sim-box ul { list-style: none; margin: 0; padding: 0; }
.t4sim-box li { font-size: 13px; line-height: 1.5; padding: 4px 0; }
.t4sim-box li strong { font-weight: 700; }
.t4sim-box li span { display: block; font-size: 12px; opacity: .75; }
.t4sim-box--in { border-left-color: #1a7f4b; }
.t4sim-box--req { border-left-color: #c98a00; }
.t4sim-box--out { border-left-color: rgba(14, 20, 48, .35); }
.t4sim-box--out li { opacity: .8; }

@media (prefers-reduced-motion: no-preference) {
  .t4sim-opt__c { transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease; }
  .t4sim-opt__m::after { transition: transform .25s var(--t4-ease); }
  .t4sim-form { transition: opacity .2s ease; }
}
