/*==============================================================================
  TRAINERSERRAMENTI - Foglio di stile principale
  ---------------------------------------------------------------------------
  Scritto a mano, senza framework e senza build step: il sito va pubblicato su
  hosting Aruba via FTP e deve restare modificabile con un semplice editor.

  Organizzazione:
    1. Token          variabili di colore, tipografia, spaziature
    2. Reset e base   normalizzazione e stili elementari
    3. Layout         contenitori, griglie, sezioni
    4. Componenti     bottoni, card, elenchi, badge
    5. Accessibilita  focus visibile e preferenze di movimento
    6. Utility        classi di supporto

  Approccio mobile-first: le regole base valgono per telefono, i breakpoint
  aggiungono complessita salendo di dimensione.
==============================================================================*/

/*------------------------------------------------------------------------------
  1. TOKEN
------------------------------------------------------------------------------*/
:root {
  /* --- Colori: palette estratta dal render approvato dal cliente --- */
  --c-black:        #0a0b0d;
  --c-navy-950:     #0c1421;
  --c-navy-900:     #0f1826;
  --c-navy-800:     #16253a;
  --c-navy-700:     #1d3049;
  --c-navy-600:     #263c58;

  --c-orange:       #f07421;
  --c-orange-light: #ff8a3d;
  --c-orange-dark:  #d25f14;

  /* L arancione del marchio come TESTO su fondo chiaro sta a 2,66:1:
     si legge male. Questa e la stessa tinta portata a 5,1:1. Vale solo
     per il testo: i fondi restano l arancione pieno del marchio. */
  --c-orange-text:  #ad4a0a;

  --c-white:        #ffffff;
  --c-light:        #f4f5f7;
  --c-light-alt:    #e8eaee;

  --c-text-dark:    #0f1826;  /* titoli su fondo chiaro */
  --c-text-body:    #4a5568;  /* paragrafi su fondo chiaro */
  --c-text-light:   #c7cdd6;  /* paragrafi su fondo scuro */
  --c-text-muted:   #8a94a3;  /* note e didascalie */

  --c-border-dark:  #223449;
  --c-border-strong:#33507a;  /* bordo che si vede davvero sul nero */
  --c-road:         #456a9c;  /* il tracciato del percorso, 3,6:1 sul nero */

  /* Superficie dei riquadri dentro le sezioni scure. Il navy-900 usato
     prima stava a 1,11:1 sul nero: le schede sparivano nello sfondo. */
  --c-surface-dark: #1a2c45;
  --c-border-light: #dfe3e8;

  --c-success:      #1f9d55;
  --c-error:        #d64545;

  /* Il rosso delle perdite. Non e --c-error: quello sta a 4,50:1 esatti
     sul nero, cioe sul filo della soglia. Questo ha un margine (5,5:1) e
     regge anche sopra il velo rosso delle schede. */
  --c-loss:         #e05c5c;

  /* Stessa storia dell arancione: il rosso buono sullo scuro non si legge
     sul chiaro (3,2:1). Questo e la versione da testo su fondo chiaro. */
  --c-loss-text:    #b32d1f;

  /* --- Tipografia --- */
  --font-heading: Archivo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body:    Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Dimensioni fluide: scalano con la finestra senza breakpoint intermedi. */
  --fs-xs:   0.75rem;
  --fs-sm:   0.875rem;
  --fs-base: 1rem;
  --fs-lg:   clamp(1.0625rem, 0.4vw + 0.98rem, 1.1875rem);
  --fs-xl:   clamp(1.25rem, 0.6vw + 1.13rem, 1.5rem);
  --fs-2xl:  clamp(1.5rem, 1.2vw + 1.26rem, 2rem);
  --fs-3xl:  clamp(1.875rem, 2vw + 1.48rem, 2.75rem);
  --fs-4xl:  clamp(2.25rem, 3.4vw + 1.57rem, 4rem);

  --lh-tight:  1.1;
  --lh-snug:   1.25;
  --lh-normal: 1.6;

  /* --- Spaziature: scala da 4px --- */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Spazio verticale delle sezioni, ridotto automaticamente su mobile */
  --section-pad: clamp(3.5rem, 7vw, 6.5rem);

  /* --- Contenitore --- */
  --container-max: 1200px;
  --container-pad: clamp(1.25rem, 4vw, 2.5rem);

  /* --- Forme --- */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 3px rgb(10 11 13 / 12%);
  --shadow:    0 6px 20px rgb(10 11 13 / 14%);
  --shadow-lg: 0 18px 48px rgb(10 11 13 / 22%);

  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Altezza dell header fisso, usata per compensare le ancore */
  --header-h: 72px;
}

/*------------------------------------------------------------------------------
  2. RESET E BASE
------------------------------------------------------------------------------*/
@font-face {
  font-family: Inter;
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Archivo;
  src: url("../fonts/archivo-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after { box-sizing: border-box; }

/*
  L attributo hidden deve vincere sempre.

  Il browser lo applica con "display: none", ma qualunque nostra regola che
  imposti display (.field usa flex, .form__row usa grid) ha specificita
  maggiore e lo annulla in silenzio: il campo resta visibile pur essendo
  marcato come nascosto. E successo davvero, sui campi fiscali del checkout.
*/
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  /* Compensa header fisso quando si salta a una ancora */
  scroll-padding-top: calc(var(--header-h) + var(--sp-4));
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  color: var(--c-text-dark);
  background-color: var(--c-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: var(--lh-tight);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }

p { margin: 0 0 var(--sp-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a {
  color: inherit;
  text-decoration-color: var(--c-orange);
  text-underline-offset: 3px;
}

img, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

ul, ol { margin: 0 0 var(--sp-4); padding-left: var(--sp-5); }
li { margin-bottom: var(--sp-2); }

strong, b { font-weight: 700; }

hr {
  border: 0;
  border-top: 1px solid var(--c-border-light);
  margin: var(--sp-8) 0;
}

/*------------------------------------------------------------------------------
  3. LAYOUT
------------------------------------------------------------------------------*/
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.container--narrow { max-width: 820px; }
.container--wide   { max-width: 1360px; }

.section { padding-block: var(--section-pad); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

/* Varianti cromatiche delle sezioni, come si alternano nel render */
.section--dark  { background-color: var(--c-black); color: var(--c-text-light); }
.section--navy  { background-color: var(--c-navy-900); color: var(--c-text-light); }
.section--light { background-color: var(--c-light); color: var(--c-text-dark); }
.section--white { background-color: var(--c-white); color: var(--c-text-dark); }

/*
  Dentro le sezioni chiare due colori cambiano valore.

  Il grigio delle didascalie e tarato sul fondo scuro: sul bianco scende a
  3,1:1. Ridefinirlo qui basta a sistemare tutte le regole che lo usano,
  perche le variabili CSS si ereditano.

  L arancione invece va cambiato solo quando fa da testo: se ridefinissi
  --c-orange diventerebbero scuri anche i pulsanti dentro queste sezioni,
  e il marchio non sarebbe piu lo stesso da una sezione all altra.
*/
.section--light,
.section--white { --c-text-muted: #656e7a; }

.section--light :is(.eyebrow, .text-orange, .other-plan__price),
.section--white :is(.eyebrow, .text-orange, .other-plan__price) { color: var(--c-orange-text); }

.section--dark :is(h1, h2, h3, h4),
.section--navy :is(h1, h2, h3, h4) { color: var(--c-white); }

/* Griglia responsiva: le colonne si impilano da sole su schermi stretti */
.grid { display: grid; gap: var(--sp-6); }

@media (min-width: 640px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--6 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1100px) {
  .grid--6 { grid-template-columns: repeat(6, 1fr); }
}

/* Blocco testo + immagine affiancati */
.split { display: grid; gap: var(--sp-8); align-items: center; }

@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: var(--sp-12); }
  .split--reverse > :first-child { order: 2; }
}

/*------------------------------------------------------------------------------
  4. COMPONENTI
------------------------------------------------------------------------------*/

/* --- Occhiello sopra i titoli --- */
.eyebrow {
  display: inline-block;
  margin-bottom: var(--sp-3);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-orange);
}

/* --- Titoli di sezione --- */
.section-title {
  font-size: var(--fs-3xl);
  text-transform: uppercase;
  margin-bottom: var(--sp-6);
}

.section-title--center { text-align: center; }

.lead {
  font-size: var(--fs-lg);
  color: var(--c-text-body);
}

.section--dark .lead,
.section--navy .lead { color: var(--c-text-light); }

/* --- Bottoni --- */
.btn {
  --btn-bg: var(--c-orange);
  /* Scuro, non bianco: il bianco sull arancione stava a 2,91:1, sotto la
     soglia. Cosi si arriva a 6,1:1 senza toccare il colore del marchio. */
  --btn-fg: var(--c-navy-900);
  --btn-bd: var(--c-orange);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-8);
  border: 2px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-heading);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition),
              transform var(--transition), color var(--transition);
}

.btn:hover  { --btn-bg: var(--c-orange-light); --btn-bd: var(--c-orange-light); }
.btn:active { transform: translateY(1px); }

.btn--outline {
  --btn-bg: transparent;
  --btn-fg: var(--c-white);
  --btn-bd: rgb(255 255 255 / 35%);
}
.btn--outline:hover { --btn-bg: rgb(255 255 255 / 8%); --btn-bd: var(--c-white); }

.btn--dark {
  --btn-bg: var(--c-navy-900);
  --btn-fg: var(--c-white);
  --btn-bd: var(--c-navy-900);
}
.btn--dark:hover { --btn-bg: var(--c-navy-700); --btn-bd: var(--c-navy-700); }

.btn--ghost {
  --btn-bg: transparent;
  --btn-fg: var(--c-text-dark);
  --btn-bd: var(--c-border-light);
}
.btn--ghost:hover { --btn-bg: var(--c-light); --btn-bd: var(--c-text-muted); }

.btn--block { display: flex; width: 100%; }
.btn--sm    { padding: var(--sp-2) var(--sp-4); font-size: var(--fs-xs); }

/* A schermo stretto il bottone occupa tutta la larghezza: piu facile da toccare */
@media (max-width: 520px) {
  .btn { width: 100%; }
  .btn--inline { width: auto; }
}

/* --- Card --- */
.card {
  padding: var(--sp-6);
  border: 1px solid var(--c-border-light);
  border-radius: var(--radius);
  background-color: var(--c-white);
  transition: transform var(--transition), box-shadow var(--transition);
}

.card--dark {
  border-color: var(--c-border-dark);
  background-color: var(--c-navy-800);
  color: var(--c-text-light);
}

.card--hover:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.card__title {
  font-family: var(--font-heading);
  font-size: var(--fs-lg);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
}

.card__text { color: var(--c-text-body); font-size: var(--fs-sm); }
.card--dark .card__text { color: var(--c-text-light); }

/* --- Elenco con spunta --- */
.checklist { list-style: none; padding: 0; margin: 0; }

.checklist li {
  position: relative;
  padding-left: var(--sp-6);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

/* La spunta e disegnata in CSS: nessuna immagine da caricare */
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.7em;
  height: 0.38em;
  border-left: 2px solid var(--c-orange);
  border-bottom: 2px solid var(--c-orange);
  transform: rotate(-45deg);
}

/* --- Badge --- */
.badge {
  display: inline-block;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  background-color: var(--c-orange);
  color: var(--c-navy-900);
  font-family: var(--font-heading);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge--outline {
  background-color: transparent;
  border: 1px solid currentcolor;
  color: var(--c-orange);
}

/*------------------------------------------------------------------------------
  5. ACCESSIBILITA
------------------------------------------------------------------------------*/

/* Contorno di focus sempre visibile per chi naviga da tastiera */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--c-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Salta al contenuto: primo elemento raggiungibile con Tab */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: 200;
  padding: var(--sp-3) var(--sp-5);
  background-color: var(--c-orange);
  color: var(--c-navy-900);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}

.skip-link:focus { top: var(--sp-4); }

/* Visibile solo agli screen reader */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Rispetta chi ha chiesto meno animazioni a livello di sistema operativo */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/*------------------------------------------------------------------------------
  6. UTILITY
------------------------------------------------------------------------------*/
.text-center  { text-align: center; }
.text-orange  { color: var(--c-orange); }
.text-muted   { color: var(--c-text-muted); }
.text-sm      { font-size: var(--fs-sm); }
.text-xs      { font-size: var(--fs-xs); }
.uppercase    { text-transform: uppercase; }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }

/* Spaziatura verticale uniforme fra elementi fratelli */
.flow > * + * { margin-top: var(--sp-4); }

/* Contenitore per tabelle e blocchi larghi: scorre da solo, non la pagina */
.overflow-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media print {
  .no-print { display: none !important; }
}
