/* TWIZA FantaGP — sistema di stile unico per gioco e backoffice. Nessuna dipendenza. */

:root {
  /* Rosso Formula 1 e antracite: due colori, non di più. Il resto è grigio. */
  --rosso: #E10600;
  --rosso-scuro: #B00500;
  --nero: #12121A;
  --nero-2: #1D1D28;
  --fondo: #F5F5F7;
  --carta: #FFFFFF;
  --bordo: #E3E3E9;
  --bordo-forte: #CFCFD8;
  --testo: #15151E;
  --tenue: #63636F;
  --verde: #0A7D2C;
  --ambra: #A96B00;
  --ambra-fondo: #FFF7E6;

  --raggio: 12px;
  --raggio-s: 8px;
  --ombra: 0 1px 2px rgba(18, 18, 26, .05), 0 8px 24px rgba(18, 18, 26, .04);
  --largo: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--fondo);
  color: var(--testo);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -0.011em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1rem; }
a { color: var(--rosso); }

/* ── intestazione ─────────────────────────────────────────────────────────── */

.testata {
  background: var(--nero);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.testata-interno {
  max-width: var(--largo);
  margin: 0 auto;
  padding: .8rem 1.25rem;
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.marchio {
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 1.05rem;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.marchio em { font-style: normal; color: var(--rosso); }
.testata nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.testata nav a {
  color: #B9B9C6;
  text-decoration: none;
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  padding: .2rem 0;
  border-bottom: 2px solid transparent;
}
.testata nav a:hover { color: #fff; }
.testata nav a.attivo { color: #fff; border-bottom-color: var(--rosso); }
.testata .utente { margin-left: auto; font-size: .87rem; color: #B9B9C6; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.testata .utente a { color: #fff; cursor: pointer; text-decoration: underline; }

/* ── impaginazione ────────────────────────────────────────────────────────── */

main { max-width: var(--largo); margin: 0 auto; padding: 1.5rem 1.25rem 5rem; }
main.pieno { max-width: none; padding: 0 0 5rem; }

.card {
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: var(--raggio);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.1rem;
  box-shadow: var(--ombra);
}
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }

.tenue { color: var(--tenue); font-size: .9rem; }
.errore { color: var(--rosso); font-weight: 600; }
.ok { color: var(--verde); font-weight: 600; }
.centro { text-align: center; }

/* ── landing ──────────────────────────────────────────────────────────────── */

.eroe {
  background:
    radial-gradient(900px 380px at 78% -10%, rgba(225, 6, 0, .30), transparent 62%),
    linear-gradient(180deg, var(--nero) 0%, var(--nero-2) 100%);
  color: #fff;
  padding: clamp(3rem, 8vw, 5.5rem) 1.25rem clamp(2.5rem, 6vw, 4rem);
}
.eroe-interno { max-width: var(--largo); margin: 0 auto; }
.eroe .occhiello {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .74rem;
  font-weight: 700;
  color: #FF8A85;
  margin-bottom: 1rem;
}
.eroe h1 { max-width: 17ch; margin-bottom: 1.1rem; }
.eroe p.sommario { font-size: clamp(1rem, 1.6vw, 1.15rem); color: #C9C9D4; max-width: 62ch; margin-bottom: 1.75rem; }
.eroe .nota-prezzo { font-size: .9rem; color: #9C9CAC; margin: .9rem 0 0; }

.striscia-numeri {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--raggio);
  overflow: hidden;
  margin-top: 2.5rem;
}
.striscia-numeri div { background: rgba(255, 255, 255, .04); padding: 1rem 1.1rem; }
.striscia-numeri .valore { font-size: 1.6rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.striscia-numeri .etichetta { font-size: .78rem; color: #9C9CAC; text-transform: uppercase; letter-spacing: .07em; }

.fascia { padding: clamp(2.5rem, 6vw, 4rem) 1.25rem; }
.fascia-interno { max-width: var(--largo); margin: 0 auto; }
.fascia.chiara { background: var(--carta); border-top: 1px solid var(--bordo); border-bottom: 1px solid var(--bordo); }
.fascia h2 { margin-bottom: .4rem; }
.fascia .intro { color: var(--tenue); max-width: 66ch; margin-bottom: 2rem; }

.passi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.1rem; }
.passo { background: var(--carta); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 1.2rem; }
.fascia.chiara .passo { background: var(--fondo); }
.passo .numero {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--rosso); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: .9rem; margin-bottom: .7rem;
}
.passo p { margin: 0; font-size: .94rem; }

.riquadri { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.riquadro { background: var(--carta); border: 1px solid var(--bordo); border-radius: var(--raggio); padding: 1.3rem; }
.fascia.chiara .riquadro { background: var(--fondo); }
.riquadro h3 { color: var(--rosso); font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: .6rem; }
.riquadro p { margin: 0; font-size: .95rem; color: #33333E; }

/* ── nota / guida contestuale ─────────────────────────────────────────────── */

.nota {
  background: var(--ambra-fondo);
  border: 1px solid #F0DCB4;
  border-left: 3px solid var(--ambra);
  border-radius: var(--raggio-s);
  padding: .85rem 1rem;
  margin: 1rem 0;
  font-size: .9rem;
  line-height: 1.55;
}
.nota strong { color: var(--ambra); display: block; margin-bottom: .2rem; }
.nota p { margin: 0; }
.nota.neutra { background: #F2F5FA; border-color: #DCE3EE; border-left-color: #4A6FA5; }
.nota.neutra strong { color: #35507A; }

details.guida {
  border: 1px solid var(--bordo);
  border-radius: var(--raggio-s);
  background: var(--carta);
  margin-bottom: .6rem;
}
details.guida summary {
  cursor: pointer;
  padding: .8rem 1rem;
  font-weight: 600;
  font-size: .96rem;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
details.guida summary::-webkit-details-marker { display: none; }
details.guida summary::after { content: "+"; color: var(--rosso); font-weight: 800; }
details.guida[open] summary::after { content: "−"; }
details.guida .corpo { padding: 0 1rem 1rem; font-size: .93rem; color: #3A3A46; }

/* ── tabelle ──────────────────────────────────────────────────────────────── */

.tabella-scorrevole { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { border-bottom: 1px solid var(--bordo); padding: .55rem .7rem; text-align: left; }
th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--tenue); font-weight: 700; white-space: nowrap;
}
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #FAFAFC; }
tbody tr.io { background: #FFF4F3; }
tbody tr.io td:first-child { box-shadow: inset 3px 0 0 var(--rosso); }

/* ── elementi ─────────────────────────────────────────────────────────────── */

.badge {
  background: var(--rosso); color: #fff; border-radius: 4px;
  padding: .1rem .45rem; font-size: .68rem; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; white-space: nowrap;
}
.badge.grigio { background: #55555F; }
.badge.verde { background: var(--verde); }
.badge.ambra { background: var(--ambra); }
.badge.vuoto { background: transparent; color: var(--tenue); border: 1px solid var(--bordo-forte); }

button, .bottone {
  background: var(--rosso); color: #fff; border: 0; border-radius: var(--raggio-s);
  padding: .6rem 1.15rem; font-size: .95rem; font-weight: 600;
  cursor: pointer; font-family: inherit; text-decoration: none; display: inline-block;
}
button:hover, .bottone:hover { background: var(--rosso-scuro); }
button.secondario { background: #4A4A56; }
button.secondario:hover { background: #35353F; }
button.piano { background: transparent; color: var(--rosso); border: 1px solid var(--bordo-forte); }
button.piano:hover { background: #FFF4F3; }
button:disabled { background: #B9B9C4; cursor: not-allowed; }
button.grande { padding: .8rem 1.6rem; font-size: 1.02rem; }

input, select, textarea {
  padding: .5rem .6rem; font-size: .95rem; font-family: inherit;
  border: 1px solid var(--bordo-forte); border-radius: var(--raggio-s);
  background: #fff; color: var(--testo); max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--rosso); outline-offset: 1px; }
textarea { width: 100%; min-height: 5rem; resize: vertical; line-height: 1.5; }
label { font-size: .92rem; }

.riga { display: flex; gap: .7rem; align-items: center; margin: .35rem 0; flex-wrap: wrap; }
.riga > label { flex: 0 0 15rem; }
.riga select, .riga input { flex: 0 1 20rem; }

.sezione { margin-bottom: 1.1rem; }
.sezione.chiusa { background: #FAFAFC; }
.sezione .capo { display: flex; gap: .7rem; align-items: center; margin-bottom: .8rem; flex-wrap: wrap; }
.sezione .capo h3 { margin: 0; }

.vuoto { padding: 3rem 1rem; text-align: center; color: var(--tenue); }

footer.piede {
  background: var(--nero);
  color: #8E8E9C;
  padding: 2.5rem 1.25rem;
  font-size: .88rem;
}
footer.piede .interno { max-width: var(--largo); margin: 0 auto; display: flex; gap: 2rem; flex-wrap: wrap; justify-content: space-between; }
footer.piede a { color: #C9C9D4; }

@media (max-width: 640px) {
  .riga > label { flex: 1 1 100%; }
  .riga select, .riga input { flex: 1 1 100%; }
  .testata .utente { margin-left: 0; width: 100%; }
}
