html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #4d4e8f;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Palette CSEN Parma (dal logo): blu notte + oro */
:root {
  --bs-primary: #2A2B67;
  --bs-primary-rgb: 42, 43, 103;
  --brand-primary: #2A2B67;
  --brand-primary-hover: #242558;
  --brand-primary-active: #1e1f4a;
  --brand-gold: #FBB632;
  --brand-gold-hover: #e6a52c;
}

a {
  color: var(--brand-primary);
}
a:hover {
  color: var(--brand-primary-hover);
}

.btn-primary {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-primary:hover {
  background-color: var(--brand-primary-hover);
  border-color: var(--brand-primary-active);
}
.btn-check:focus + .btn-primary, .btn-primary:focus,
.btn-check:checked + .btn-primary:focus, .btn-primary.active:focus, .btn-primary:active:focus,
.show > .btn-primary.dropdown-toggle:focus {
  box-shadow: 0 0 0 .25rem rgba(42, 43, 103, .5);
}
.btn-check:checked + .btn-primary, .btn-primary.active, .btn-primary:active,
.show > .btn-primary.dropdown-toggle {
  background-color: var(--brand-primary-active);
  border-color: var(--brand-primary-active);
}

.btn-outline-primary {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-outline-primary:hover,
.btn-check:checked + .btn-outline-primary, .btn-outline-primary.active,
.btn-outline-primary.dropdown-toggle.show, .btn-outline-primary:active {
  color: #fff;
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}
.btn-check:focus + .btn-outline-primary, .btn-outline-primary:focus,
.btn-check:checked + .btn-outline-primary:focus, .btn-outline-primary.active:focus,
.btn-outline-primary.dropdown-toggle.show:focus, .btn-outline-primary:active:focus {
  box-shadow: 0 0 0 .25rem rgba(42, 43, 103, .5);
}

.border-primary {
  border-color: var(--brand-primary) !important;
}

.form-control:focus, .form-select:focus, .form-check-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 .25rem rgba(42, 43, 103, .25);
}
.form-check-input:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* Bottone accento oro, per CTA secondarie a fianco di una primaria blu */
.btn-brand-gold {
  color: var(--brand-primary);
  background-color: var(--brand-gold);
  border-color: var(--brand-gold);
}
.btn-brand-gold:hover, .btn-brand-gold:focus, .btn-brand-gold:active {
  color: var(--brand-primary);
  background-color: var(--brand-gold-hover);
  border-color: var(--brand-gold-hover);
}

/* Classifica finale di fine stagione (Views/Classifica/Index.cshtml) */
.classifica-finale-oro {
  background-color: var(--brand-gold) !important;
  font-weight: 600;
}
.classifica-finale-argento {
  background-color: #d9d9d9 !important;
  font-weight: 600;
}
.classifica-finale-bronzo {
  background-color: #f2d9b0 !important;
}

/* Banner consenso cookie (wwwroot/js/cookie-consent.js) */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1080;
  background-color: var(--brand-primary);
  color: #fff;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .3);
}
/* Riga di intestazione di ogni giornata nel calendario pubblico (Views/Calendario/Index.cshtml). */
.calendario-giornata th {
  background-color: var(--brand-gold) !important;
  color: var(--brand-primary);
}

/* Squadre a riposo nella giornata (girone con numero dispari di squadre). */
.calendario-riposo td {
  font-size: .875rem;
  font-style: italic;
  color: #6c757d;
}

/* Scadenza del certificato medico nell'elenco giocatori (Admin), vedi Helpers/CertificatoMedicoHelper. */
.certificato-badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: .3rem;
  font-weight: 600;
  font-size: .9em;
  white-space: nowrap;
}

.certificato-valido {
  background-color: #198754;
  color: #fff;
}

.certificato-in-scadenza {
  background-color: #fd7e14;
  color: #fff;
}

.certificato-scaduto {
  background-color: #dc3545;
  color: #fff;
}

.certificato-mancante {
  background-color: #e9ecef;
  color: #6c757d;
  font-weight: 400;
}

/* Palestre e orari (Views/Orari): la cella del giorno in cui la squadra gioca in casa. */
.orari-casa {
  background-color: #c6efce !important;
  box-shadow: none !important; /* niente velo grigio delle righe alternate sopra il verde */
  font-weight: 600;
  white-space: nowrap;
}
/* Righe alternate più marcate del grigio standard di Bootstrap: velo del blu del torneo. */
.orari-tabella {
  --bs-table-striped-bg: rgba(42, 43, 103, 0.13);
}
.orari-tabella td:last-child {
  min-width: 15rem;
}
/* Su telefono la tabella scorre in orizzontale: il nome della squadra resta visibile a sinistra. */
.orari-tabella tbody th {
  position: sticky;
  left: 0;
  background-color: #fff; /* opaco, così le colonne che scorrono sotto non si vedono */
  z-index: 1;
  min-width: 8rem;
}
.orari-tabella thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

/* Dashboard dell'area riservata: icona tonda accanto al titolo di ogni card. */
.dashboard-icona {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background-color: rgba(42, 43, 103, 0.1);
  color: var(--brand-primary);
  font-size: 1.2rem;
}

/* Elenco pubblico delle squadre (Views/Squadre/Index): copertina a tutta larghezza, stessa altezza per tutte. */
.squadra-card {
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.squadra-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1rem rgba(42, 43, 103, 0.18);
}
.squadra-copertina {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #eef0f6;
}
/* sfondo: lo stesso logo, sfocato e ingrandito, per riempire la card senza tagliare il logo */
.squadra-copertina::before {
  content: "";
  position: absolute;
  inset: -12%;
  background: var(--logo) center / cover no-repeat;
  filter: blur(18px) saturate(1.2);
  opacity: 0.55;
}
.squadra-copertina img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.squadra-iniziali {
  display: none;
}
/* senza logo: copertina con le iniziali sui colori del torneo */
.squadra-copertina.senza-logo {
  background: linear-gradient(135deg, var(--brand-primary), #4a4c9c);
}
.squadra-copertina.senza-logo::before {
  display: none;
}
.squadra-copertina.senza-logo .squadra-iniziali {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-gold);
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
@media (max-width: 575.98px) {
  .squadra-copertina.senza-logo .squadra-iniziali { font-size: 2.5rem; }
  .squadra-card .card-body { padding: 0.75rem; }
  .squadra-card .card-title { font-size: 1rem; }
}

/* Pagina pubblica della squadra (Views/Squadre/Dettaglio): logo grande, foto dei giocatori che riempiono
   la loro colonna, "tessera" del giocatore nella modale. */
.squadra-dettaglio-logo {
  max-height: 150px;
  max-width: 100%;
  object-fit: contain;
}
.rosa-riga {
  cursor: pointer;
}
.rosa-col-foto {
  width: 64px;
}
.rosa-foto {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: .5rem;
}
.rosa-foto-vuota {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-primary), #4a4c9c);
  color: var(--brand-gold);
  font-weight: 700;
  font-size: 1.1rem;
}
@media (min-width: 768px) {
  .squadra-dettaglio-logo { max-height: 240px; }
  .rosa-col-foto { width: 140px; }
  .rosa-foto-vuota { font-size: 2.2rem; }
}

.tessera {
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
}
.tessera-testata {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.25rem;
  background: linear-gradient(135deg, var(--brand-primary), #4a4c9c);
  color: #fff;
  border-bottom: .35rem solid var(--brand-gold);
}
.tessera-logo {
  height: 48px;
  width: 48px;
  object-fit: contain;
  background-color: #fff;
  border-radius: .4rem;
  padding: 2px;
}
.tessera-torneo {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .85;
}
.tessera-squadra {
  font-size: 1.15rem;
  font-weight: 600;
}
.tessera-corpo {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  background:
    repeating-linear-gradient(135deg, rgba(42, 43, 103, .025) 0 12px, transparent 12px 24px),
    #fbfbfe;
}
.tessera-foto-box {
  flex: 0 0 auto;
  width: min(65%, 240px);
  align-self: center;
}
.tessera-foto {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: .6rem;
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .18);
}
.tessera-foto-vuota {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand-primary), #4a4c9c);
  color: var(--brand-gold);
  font-size: 4rem;
  font-weight: 700;
}
.tessera-dati {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1.25rem;
  margin: 0;
  align-content: start;
}
.tessera-dati dt {
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #6c757d;
}
.tessera-dati dd {
  margin: 0;
  font-size: 1.05rem;
  border-bottom: 1px dashed #c9cbe0;
  padding-bottom: .2rem;
  overflow-wrap: anywhere;
}
.tessera-dati .tessera-grande {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--brand-primary);
}
.tessera-numero-box {
  grid-column: 1 / -1;
}
.tessera-dati .tessera-numero {
  display: inline-block;
  min-width: 4.5rem;
  padding: .1rem .9rem;
  border: 0;
  border-radius: .5rem;
  background-color: var(--brand-gold);
  color: var(--brand-primary);
  font-size: 2.4rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}
@media (min-width: 768px) {
  .tessera-corpo { flex-direction: row; }
  .tessera-foto-box { width: 280px; align-self: flex-start; }
}

/* Bacheca annunci (Views/Annunci, anteprima in home) */
.bg-brand-gold {
  background-color: var(--brand-gold) !important;
}
.annuncio-testo {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
/* Campo "trappola" anti-spam (Services/CaptchaService): fuori schermo invece di display:none, che alcuni bot saltano. */
.campo-trappola {
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Timbro "Trovato!" sugli annunci chiusi (Views/Annunci/_Annuncio): inchiostro rosso, inclinato, sopra la card
   ma senza bloccare i click; il contenuto sotto si sbiadisce un po' come una busta già timbrata. */
.annuncio-card {
  position: relative;
  overflow: hidden;
}
.annuncio-timbro {
  position: absolute;
  top: 1.9rem;
  right: -1.25rem;
  width: 17.5rem;
  max-width: 100%;
  height: auto;
  color: #b3261e;
  opacity: 0.82;
  transform: rotate(-12deg);
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 2;
}
.annuncio-trovato {
  min-height: 12.5rem;
}
.annuncio-trovato .card-body {
  opacity: 0.7;
}
.annuncio-chiuso {
  color: #b3261e;
}

/* Richiamo al TotoMisto in home (Views/Home/Index; il resto della grafica è in totomisto.css) */
.home-toto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 1.25rem;
  color: #fff;
  text-decoration: none;
  background:
    radial-gradient(circle at 110% -20%, rgba(251, 182, 50, .55) 0, rgba(251, 182, 50, 0) 55%),
    linear-gradient(135deg, #2A2B67 0%, #3d3f93 60%, #5b3f93 100%);
  box-shadow: 0 10px 30px rgba(42, 43, 103, .25);
}
.home-toto:hover {
  color: #fff;
  filter: brightness(1.08);
}
.home-toto-logo {
  display: block;
  font-weight: 900;
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: .25rem;
}
.home-toto-logo span {
  color: var(--brand-gold);
}
.home-toto-cta {
  flex: 0 0 auto;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  background: var(--brand-gold);
  color: var(--brand-primary);
  font-weight: 800;
}

/* Menu con le icone (Bootstrap Icons, entrambi i layout): tra 1200 e 1399 px, dove il menu è già su una riga sola,
   le voci si stringono un po' perché l'ultima (Area riservata / Esci) non esca dallo schermo. */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .navbar-expand-xl .navbar-nav .nav-link {
    padding-left: .25rem;
    padding-right: .25rem;
  }
  .navbar-expand-xl .navbar-brand {
    margin-right: .5rem;
  }
}
