/* EvoSpeedtest - personalizzazione EVONET TLC
   Palette, font Manrope autoospitato, cornice, badge, modale di consenso
   e adattamenti di accessibilità sui componenti reali del motore
   (assets/images/app.svg + assets/js/app-2.5.4.min.js, invariato). */

@font-face { font-family: Manrope; src: url("../fonts/manrope-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Manrope; src: url("../fonts/manrope-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: Manrope; src: url("../fonts/manrope-800.ttf") format("truetype"); font-weight: 800; font-display: swap; }

:root {
  --evo-green: #20A556;
  --evo-green-dark: #12713C;
  --evo-navy: #0B2344;
  --evo-mint: #E8F6EE;
  --evo-soft: #A7DCA7;
  --evo-border: #DDE8DE;
  --evo-muted: #4C6179;
  --evo-radius: 24px;
}

body {
  font-family: Manrope, Arial, sans-serif;
}

/* Cornice bianca centrata attorno all'app (il motore resta a coordinate
   invariate: le due <svg> interne scalano in base al contenitore tramite
   viewBox, quindi ridurre il contenitore non altera il loro layout). */
.openSpeedtestApp {
  box-sizing: border-box;
  max-width: 1120px;
  height: calc(100vh - 64px);
  margin: 32px auto;
  background: #FFFFFF;
  border: 1px solid var(--evo-border);
  border-top: 5px solid var(--evo-green);
  border-radius: var(--evo-radius);
  box-shadow: 0 1px 4px rgba(11, 35, 68, 0.08);
}
.Mobile, .Desktop {
  width: 100% !important;
  height: 100% !important;
}
@media only screen and (max-width: 700px) {
  .openSpeedtestApp {
    max-width: calc(100vw - 16px);
    height: calc(100vh - 24px);
    margin: 12px auto;
    border-radius: 16px;
  }
}

/* Bordo leggero sulle card dei risultati, coerente col riferimento grafico */
.Cards {
  stroke: var(--evo-border);
  stroke-width: 1.2px;
}

.evo-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 0 1px 4px rgba(11, 35, 68, 0.15);
  text-decoration: none;
}
.evo-badge img {
  height: 22px;
  width: auto;
  display: block;
}

.evo-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(11, 35, 68, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.evo-modal[hidden] {
  display: none;
}
.evo-modal-box {
  background: #FFFFFF;
  color: var(--evo-navy);
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 24px;
  font-family: Manrope, Arial, sans-serif;
  box-shadow: 0 10px 40px rgba(11, 35, 68, 0.35);
}
.evo-modal-box h2 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--evo-navy);
}
.evo-modal-box p {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 12px 0;
  color: var(--evo-muted);
}
.evo-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
  flex-wrap: wrap;
}
.evo-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 24px;
  min-height: 44px;
  font-size: 14px;
  font-weight: 800;
  font-family: Manrope, Arial, sans-serif;
  cursor: pointer;
}
.evo-btn-primary {
  background: var(--evo-green);
  color: #FFFFFF;
}
.evo-btn-primary:hover {
  background: var(--evo-green-dark);
}
.evo-btn-secondary {
  background: var(--evo-mint);
  color: var(--evo-navy);
}
.evo-btn-secondary:hover {
  background: #d7efe0;
}
.evo-btn:focus-visible {
  outline: 3px solid var(--evo-navy);
  outline-offset: 3px;
}

/* Focus da tastiera visibile sui controlli interattivi del motore SVG
   (pulsante "Avvia test" e ingranaggio opzioni), resi realmente
   raggiungibili/attivabili da tastiera in assets/js/evonet-consent-gate.js */
#startButtonDesk:focus-visible,
#startButtonMob:focus-visible,
#settingsDesk:focus-visible,
#settingsMob:focus-visible,
.darkmode:focus-visible {
  outline: 3px solid var(--evo-navy);
  outline-offset: 3px;
}

@media (prefers-color-scheme: dark) {
  .evo-badge {
    background: rgba(11, 35, 68, 0.85);
  }
  .openSpeedtestApp {
    background: #0B2344;
    border-color: #12305C;
  }
}

@media only screen and (max-width: 480px) {
  .evo-badge img {
    height: 18px;
  }
  .evo-badge {
    padding: 5px 10px;
    top: 8px;
    right: 8px;
  }
}

/* Rispetta la preferenza di riduzione del movimento: nessuna animazione
   decorativa oltre a quella già necessaria a mostrare l'avanzamento reale
   del test (l'arco del quadrante riflette lo stato vero, non è decorativo). */
@media (prefers-reduced-motion: reduce) {
  .Startsettings {
    transition: none;
  }
  .spinner > div {
    animation: none;
    opacity: 1;
  }
}
