/* Variables */
:root {
  --bleu: #ad322b;
  --header-bg: #15232f;
  --fond: #f5f5f5;
  --blanc: #ffffff;
  --rouge: #c62828;
  --rayon: 8px;
}

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

body {
  font-family: 'Eurostile', Helvetica, Arial, Lucida, sans-serif;
  background: var(--fond);
  color: #15232f;
  min-height: 100vh;
  text-align: center;
}

/* Conteneur principal */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Barre header site (pleine largeur, logo gauche) */
.site-header {
  background: #15232f;
  width: 100%;
}

.site-header a {
  display: contents;
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: .7rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.header-logo-center {
  grid-column: 2;
  justify-self: center;
}

.header-logo-side {
  grid-column: 3;
  justify-self: end;
}

.header-logo-center {
  height: 64px;
  width: auto;
}

.header-logo-side {
  height: 52px;
  width: auto;
}

/* Titre de page sous le header */
#sous-titre {
  font-size: 1.5rem;
  color: var(--bleu);
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.8rem;
  margin-top: 1.5rem;
}

/* Bloc d'information */
.info-bloc {
  background: #f5f5f5;
  border-left: 4px solid var(--bleu);
  border-right: 4px solid var(--bleu);
  border-radius: 0;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  color: #15232f;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  text-align: center;
}

/* Champs du formulaire */
.champ {
  margin-bottom: 1.2rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: .3rem;
  color: #444;
  text-align: left;
}

input,
select {
  width: 100%;
  padding: .7rem .9rem;
  border: 2px solid #ddd;
  border-radius: var(--rayon);
  font-size: 1rem;
  transition: border-color .2s;
  background: var(--blanc);
}

input:focus,
select:focus {
  outline: 2px solid var(--bleu);
  outline-offset: 2px;
  border-color: var(--bleu);
}

/* Bouton principal */
.btn-principal {
  display: block;
  width: 100%;
  padding: .9rem;
  background: var(--bleu);
  color: var(--blanc);
  border: none;
  border-radius: var(--rayon);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: opacity .2s;
}

.btn-principal:hover,
.btn-principal:focus-visible {
  opacity: .85;
  outline: 2px solid var(--blanc);
  outline-offset: 2px;
}

/* Bouton destructif (réinitialisation) */
.btn-danger {
  display: inline-block;
  padding: .9rem 1.2rem;
  background: var(--rouge);
  color: var(--blanc);
  border: none;
  border-radius: var(--rayon);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .2s;
}

.btn-danger:hover,
.btn-danger:focus-visible {
  opacity: .85;
  outline: 2px solid var(--blanc);
  outline-offset: 2px;
}

/* Message d'erreur (role="alert" dans le HTML pour annonce lecteur d'écran) */
.erreur {
  color: var(--rouge);
  margin-top: .6rem;
  text-align: center;
  font-size: .95rem;
}

/* Astérisque champs obligatoires */
.requis {
  color: var(--bleu);
  margin-left: .15em;
}

/* Note champs obligatoires */
.note-obligatoire {
  color: #ad322b;
  font-size: .85rem;
  margin-top: .5rem;
}

/* Section confirmation */
#section-pass {
  text-align: center;
}

.confirmation {
  color: #1b5e20;
  margin-bottom: 1.2rem;
  font-size: 1.4rem;
}

.note {
  color: #666;
  font-size: .9rem;
  margin-top: 1rem;
}

/* Aperçu du pass — format A4 portrait avec image de fond */
.pass-carte {
  position: relative;
  width: min(480px, 100%);
  aspect-ratio: 210 / 297;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: top left;
  border: 1px solid #ccc;
  border-radius: 4px;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .2);
  overflow: hidden;
}

/* Zone d'infos dans le rectangle du quart supérieur gauche */
/* Coordonnées % de l'A4 : left=2.66%, top=16%, width=44.6%, height=26% */
.pass-zone-infos {
  position: absolute;
  left: 2.66%;
  top: 16%;
  width: 44.6%;
  height: 26%;
  overflow: hidden;
}

/* Passe Organisateur : zone remontée à 10% */
.pass-zone-infos--organisateur {
  top: 10%;
}

.pass-zone-infos-droite {
  position: absolute;
  left: 52.74%;
  top: 16%;
  width: 44.6%;
  height: 26%;
  overflow: hidden;
}

.pass-zone-infos-droite--organisateur {
  top: 10%;
}

/* Contenu texte centré dans la zone */
.pass-contenu {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 2px;
  padding: 2% 2%;
  min-width: 0;
  overflow: hidden;
}

.pass-nom-a4 {
  font-size: 1rem;
  font-weight: 400;
  color: #000000;
  line-height: 1.2;
  margin: 0;
  overflow-wrap: break-word;
}

/* Administration — taille max, s'adapte aux noms longs */
.pass-admin-a4 {
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #000000;
  line-height: 1.15;
  margin: 0;
  overflow-wrap: anywhere;
}

.pass-detail-a4 {
  font-size: 1rem;
  font-weight: 400;
  text-transform: capitalize;
  color: #000000;
  line-height: 1.2;
  margin: 0;
}

.pass-numero-a4 {
  font-size: 0.5rem;
  font-weight: 400;
  color: rgb(31, 31, 31);
  font-family: monospace;
  margin: 0;
}

/* Classe utilitaire : masque visuellement tout en restant accessible aux lecteurs d'écran */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Signature développeur */
.signature {
  text-align: center;
  font-size: .75rem;
  color: #00000061;
  padding-bottom: 1rem;
}

.signature a {
  color: #00000061;
  text-underline-offset: 3px;
}

.signature a:hover {
  color: #000000;
}

/* Signature sous l'aperçu du pass */
.pass-signature {
  text-align: center;
  font-size: .65rem;
  color: #00000061;
  margin-top: .5rem;
}

/* ── Interface Admin ─────────────────────────────────────────── */
.container-admin {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Écran de connexion */
.connexion-admin {
  max-width: 400px;
  margin: 5rem auto;
  background: var(--blanc);
  padding: 2rem;
  border-radius: var(--rayon);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .1);
  text-align: center;
}

.connexion-bandeau {
  background: #15232f;
  margin: -2rem -2rem 1.5rem -2rem;
  border-radius: var(--rayon) var(--rayon) 0 0;
  padding: .8rem 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.connexion-bandeau-logo {
  height: 52px;
  width: auto;
}

.connexion-admin h1 {
  color: var(--bleu);
  margin-bottom: 1.5rem;
}

/* Tableau de bord */
.admin-entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-entete h1 {
  color: var(--bleu);
}

.compteurs {
  display: flex;
  gap: .7rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}

.badge {
  padding: .35rem .8rem;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
}

.filtres {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filtres input,
.filtres select {
  flex: 1;
  min-width: 160px;
}

/* Tableau */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--blanc);
  border-radius: var(--rayon);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

th {
  background: var(--bleu);
  color: var(--blanc);
  padding: .7rem .8rem;
  text-align: left;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  font-size: .88rem;
}

th:hover {
  opacity: .85;
}

td {
  padding: .6rem .8rem;
  border-bottom: 1px solid #eee;
  font-size: .88rem;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #f9f9f9;
}

.vide {
  text-align: center;
  padding: 2.5rem;
  color: #888;
}

/* Scroll horizontal de la table sur petits écrans */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--rayon);
}

/* ── Responsive mobile ───────────────────────────────────────── */
@media (max-width: 500px) {

  /* Header : logos plus petits */
  .header-logo-center {
    height: 44px;
  }

  .header-logo-side {
    height: 34px;
  }

  .site-header-inner {
    padding: .5rem .8rem;
  }

  /* Titre de page */
  #sous-titre {
    font-size: 1.2rem;
    margin-top: 1rem;
    margin-bottom: 1.2rem;
  }

  /* Connexion admin : marge haute réduite */
  .connexion-admin {
    margin: 1.5rem auto;
  }

  /* Pass A4 : pleine largeur sur mobile */
  .pass-carte {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .container-admin {
    padding: 1rem .6rem;
  }

  /* En-tête : titre + boutons empilés */
  .admin-entete {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-entete h1 {
    font-size: 1.3rem;
  }

  .admin-entete>div {
    display: flex;
    gap: .6rem;
  }

  .admin-entete>div button {
    flex: 1;
    font-size: .85rem;
    padding: .7rem .5rem;
  }

  /* Badges compteurs plus compacts */
  .badge {
    font-size: .75rem;
    padding: .28rem .6rem;
  }

  /* Filtres en colonne */
  .filtres {
    flex-direction: column;
    gap: .6rem;
  }

  .filtres input,
  .filtres select {
    min-width: 0;
    width: 100%;
  }

  /* Cellules plus compactes */
  th,
  td {
    font-size: .78rem;
    padding: .5rem .55rem;
    white-space: nowrap;
  }
}

.btn-pass-pdf {
  padding: .25rem .55rem;
  background: var(--bleu);
  color: #fff;
  border: none;
  border-radius: var(--rayon);
  font-size: .78rem;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .2s;
}

.btn-pass-pdf:hover {
  opacity: .75;
}

.btn-supprimer {
  padding: .25rem .5rem;
  background: var(--rouge);
  color: #fff;
  border: none;
  border-radius: var(--rayon);
  font-size: .78rem;
  cursor: pointer;
  margin-left: .4rem;
  transition: opacity .2s;
}

.btn-supprimer:hover {
  opacity: .75;
}