/* PremierRang — maquette validée par Niko (claude.ai Design, 2026-10-14).
   Fond sombre, Archivo condensé + IBM Plex Mono, orange = cinéma, bleu = sentiers.
   Polices auto-hébergées (licence OFL, cf. polices/LICENCE.txt) : aucun appel extérieur. */
@font-face { font-family: "Archivo"; src: url("polices/archivo.woff2") format("woff2");
  font-weight: 400 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("polices/plex-mono-400.woff2") format("woff2");
  font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("polices/plex-mono-500.woff2") format("woff2");
  font-weight: 500; font-display: swap; }

:root {
  --fond: #141210; --fond-creux: #0C0B0A; --carte: #1E1B17; --bord: #2E2A25; --bord-fort: #3A352F;
  --texte: #F2EDE4; --texte-2: #D8D1C5; --doux: #B9B1A5; --tres-doux: #8E877C;
  --accent: #F2A33A; --sur-accent: #1A1208; --trail: #6FA8F5; --sur-trail: #0B1626;
  --ok: #7BC48A; --erreur: #E8634A; --jaune: #F2D04A;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: "Archivo", system-ui, sans-serif; }
a { color: var(--texte); } a:hover { color: #fff; }
input::placeholder { color: var(--tres-doux); }
button, input { font-family: inherit; }
.page { max-width: 1200px; margin: 0 auto; padding: 40px 32px 64px; display: flex; flex-direction: column; gap: 40px; }
.mono { font: 500 13px var(--mono); }
.doux { color: var(--doux); }

/* En-tête */
.entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px;
  border-bottom: 1px solid var(--bord); padding-bottom: 28px; }
.marque { display: flex; align-items: center; gap: 18px; text-decoration: none; color: inherit; }
.logo { font-size: 52px; line-height: .9; font-weight: 900; font-stretch: 70%; letter-spacing: .01em; text-transform: uppercase; }
.logo span { color: var(--accent); }
.devise { font-size: 16px; color: var(--doux); margin-top: 4px; }
.pilules { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pilule { display: flex; align-items: center; gap: 8px; padding: 8px 14px; min-height: 44px; border: 1px solid var(--bord);
  border-radius: 999px; font-size: 14px; color: var(--texte-2); background: none; text-decoration: none; }
a.pilule, button.pilule { border-color: var(--bord-fort); cursor: pointer; }
.point { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.point.erreur { background: var(--erreur); }
form.enligne { display: inline; margin: 0; }

/* Champs et boutons */
.etiquette { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--doux); }
.champ { height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--bord-fort);
  background: var(--fond); color: var(--texte); font-size: 15px; width: 100%; min-width: 0; }
.champ.grand { height: 56px; padding: 0 18px; border-radius: 10px; font-size: 17px; }
.bouton { height: 56px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--accent); color: var(--sur-accent);
  font-weight: 800; font-size: 17px; font-stretch: 90%; letter-spacing: .04em; text-transform: uppercase; cursor: pointer; }
.bouton.trail { height: 44px; border-radius: 8px; background: var(--trail); color: var(--sur-trail); font-size: 14px;
  text-transform: none; letter-spacing: 0; }
.discret { height: 44px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--bord-fort); background: transparent;
  color: var(--texte-2); font-weight: 600; font-size: 14px; cursor: pointer; }
.discret.danger:hover { border-color: var(--erreur); color: var(--erreur); }
.message { padding: 14px 18px; border-radius: 10px; border: 1px solid var(--bord-fort); background: var(--carte); }
.message.erreur { border-color: var(--erreur); color: #F6B3A5; }

/* Formulaire « nouvelle surveillance » */
.nouvelle { display: flex; flex-direction: column; gap: 14px; background: var(--carte); border: 1px solid var(--bord);
  border-radius: 14px; padding: 24px; }
.rangee { display: flex; flex-wrap: wrap; gap: 12px; }
.rangee > .lien { flex: 999 1 420px; }
.rangee > .bouton { flex: 1 0 160px; }
.groupe { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; }
.groupe label { font-size: 13px; color: var(--doux); }

/* Sections */
.section { display: flex; flex-direction: column; gap: 18px; }
.titre-section { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.titre-section h2 { margin: 0; font-size: 34px; font-weight: 900; font-stretch: 70%; text-transform: uppercase; letter-spacing: .02em; }
.titre-section .mono { color: var(--accent); }
.titre-section.trail .mono { color: var(--trail); }
.titre-section.autre .mono { color: var(--doux); }
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.vide { color: var(--doux); padding: 24px; border: 1px dashed var(--bord-fort); border-radius: 14px; }

/* Cartes */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 24px;
  display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.carte.pointilles { border-style: dashed; border-color: var(--bord-fort); }
.haut { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 12px; }
.haut > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 60%; }
.source { font: 500 12px var(--mono); color: var(--doux); overflow-wrap: break-word; }
.carte h3 { margin: 0; font-size: 30px; line-height: 1.05; font-weight: 900; font-stretch: 75%; overflow-wrap: normal; hyphens: manual; }
.badge { flex: none; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--tres-doux); color: var(--texte-2);
  font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.accent { border-color: var(--accent); color: var(--accent); }
.badge.trail { border-color: var(--trail); color: var(--trail); }
.badge.trail-plein { border-color: var(--trail); background: var(--trail); color: var(--sur-trail); }
.badge.erreur { border-color: var(--erreur); color: var(--erreur); }
.pastilles { display: flex; flex-wrap: wrap; gap: 8px; }
.pastilles span { padding: 6px 10px; border-radius: 6px; background: var(--fond); font: 500 14px var(--mono); }
.phrase { font-size: 15px; color: var(--doux); line-height: 1.5; margin: 0; }
.bas { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: auto; }
.bas a { font-size: 14px; }
.qui { font: 400 12px var(--mono); color: var(--tres-doux); }
.err-sonde { font: 400 13px var(--mono); color: #F6B3A5; overflow-wrap: anywhere; }
.encart { display: flex; flex-direction: column; gap: 8px; background: var(--fond); border-radius: 10px; padding: 16px; }
.encart label { font-size: 13px; font-weight: 700; color: var(--texte-2); }
.encart .champ { background: var(--carte); flex: 1 1 200px; width: auto; }
.encart .rangee { gap: 10px; }
.encart .bouton { flex: 1 0 auto; }
.rappels { font: 400 13px var(--mono); color: var(--doux); }
details.infos summary { cursor: pointer; font-size: 14px; color: var(--doux); min-height: 32px; }
details.infos .rangee { margin-top: 8px; }
details.infos .champ { flex: 1 1 200px; width: auto; }

/* Carte cinéma : affiche à gauche */
.carte.film { flex-direction: row; flex-wrap: wrap; padding: 0; gap: 0; overflow: hidden; }
/* L'affiche garde son format (2/3) même quand le dépliant « Jour par jour » allonge la carte. */
.affiche { flex: 1 1 260px; min-height: 240px; max-width: 360px; aspect-ratio: 2 / 3; align-self: flex-start; background: var(--fond-creux); border-right: 1px solid var(--bord);
  display: flex; flex-direction: column; justify-content: space-between; padding: 22px; position: relative; overflow: hidden; }
.affiche img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.affiche .mention { position: relative; align-self: flex-start; padding: 6px 10px; border: 2px solid var(--accent);
  color: var(--accent); background: rgba(12, 11, 10, .75); font-weight: 800; font-size: 14px; font-stretch: 80%; letter-spacing: .08em; }
.affiche .neutre { position: relative; font: 500 12px var(--mono); color: var(--tres-doux); }
.film .corps { flex: 999 1 520px; min-width: 0; padding: 26px 28px; display: flex; flex-direction: column; gap: 18px; }
.film h3 { font-size: 44px; line-height: 1; }
.film .lieu { font-size: 17px; color: var(--texte-2); }
.mention-mobile { display: none; }
.compteurs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.compteurs > div { background: var(--fond); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.compteurs b { font-size: 30px; font-weight: 900; font-stretch: 75%; }
.compteurs span { font-size: 13px; color: var(--doux); }
.court { display: none; }
.film .bas { border-top: 1px solid var(--bord); padding-top: 16px; }

.pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid var(--bord);
  padding-top: 20px; font: 400 13px var(--mono); color: var(--tres-doux); }
.pied a { color: var(--texte-2); }

/* Connexion */
.ecran-connexion { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.cadre { width: 100%; max-width: 1080px; display: flex; flex-wrap: wrap; background: var(--carte); border: 1px solid var(--bord);
  border-radius: 18px; overflow: hidden; }
.vitrine { flex: 1 1 420px; min-width: 0; background: var(--fond-creux); border-right: 1px solid var(--bord); padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.vitrine .logo { font-size: 76px; line-height: .88; }
.vitrine .devise { font-size: 18px; line-height: 1.45; max-width: 340px; }
.legende { display: flex; flex-direction: column; gap: 10px; font: 500 13px var(--mono); color: var(--tres-doux); }
.legende div { display: flex; align-items: center; gap: 10px; }
.formulaire { flex: 1 1 420px; min-width: 0; padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; gap: 24px; }
.formulaire h1 { margin: 0; font-size: 44px; line-height: 1; font-weight: 900; font-stretch: 75%; text-transform: uppercase; }
.formulaire .champ { height: 56px; border-radius: 10px; font-size: 17px; padding: 0 18px; }
.ligne-mdp { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.case { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 15px; color: var(--texte-2); cursor: pointer; }
.case input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.note { border-top: 1px solid var(--bord); padding-top: 18px; font-size: 14px; color: var(--doux); line-height: 1.5; }
#oubli { display: none; }
#oubli:target { display: block; }
code { font: 400 13px var(--mono); background: var(--fond); padding: 10px 12px; border-radius: 8px; display: block; overflow-wrap: anywhere; color: var(--texte-2); }

/* Admin et compte */
.panneau { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.panneau h2 { margin: 0; font-size: 28px; font-weight: 900; font-stretch: 70%; text-transform: uppercase; }
.compte-ligne { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 0; border-top: 1px solid var(--bord); }
.compte-ligne strong { font-size: 20px; font-stretch: 80%; }
.provisoire { font: 500 22px var(--mono); color: var(--accent); letter-spacing: .06em; }

.trouvee { font-size: 14px; line-height: 1.45; color: var(--trail); border-left: 3px solid var(--trail); padding-left: 10px; }
details.jours summary { cursor: pointer; font-size: 14px; color: var(--doux); min-height: 32px; }
details.jours ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 20px; }
details.jours li { display: flex; gap: 10px; align-items: baseline; font: 400 14px var(--mono); padding: 6px 0; border-bottom: 1px solid var(--bord); }
details.jours li b { font-weight: 500; min-width: 4.5em; color: var(--texte); }
details.jours li span { white-space: nowrap; }
details.jours li .qui { margin-left: auto; }
select.champ { appearance: none; cursor: pointer; }
.groupe.etroit { flex: 0 1 200px; }
.rubrique select { background: transparent; color: var(--tres-doux); border: 1px solid var(--bord); border-radius: 6px;
  font: 400 12px var(--mono); padding: 4px 6px; cursor: pointer; }
ul.epreuves { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
ul.epreuves li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bord); }
ul.epreuves li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
ul.epreuves b { font-size: 15px; font-weight: 700; }
.etat { flex: none; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--tres-doux); color: var(--texte-2); white-space: nowrap; }
.etat.available { background: var(--trail); border-color: var(--trail); color: var(--sur-trail); }
.etat.registration_not_opened { border-color: var(--trail); color: var(--trail); }
.etat.hors { border-style: dashed; color: var(--tres-doux); }
/* Cartes trail v0.10 : une phrase d'état en gros, une ligne d'infos, le reste dans « Détails ».
   Bleu = ouvert, jaune = bientôt (l'orange reste au cinéma), rouge = complet, gris = en attente. */
.carte.trail { gap: 12px; }
.trail .quoi { font: 500 12px var(--mono); color: var(--doux); letter-spacing: .04em; overflow-wrap: anywhere; text-transform: uppercase; }
.trail h3 { font-size: 26px; margin-top: 4px; }
.etat-phrase { font-size: 22px; line-height: 1.25; font-weight: 800; font-stretch: 85%; display: flex; gap: 10px; align-items: flex-start; }
.etat-phrase .pastille { flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; background: var(--tres-doux); }
.trail.ouvert .etat-phrase { color: var(--trail); } .trail.ouvert .pastille { background: var(--trail); }
.trail.bientot .etat-phrase { color: var(--jaune); } .trail.bientot .pastille { background: var(--jaune); }
.trail.complet .etat-phrase, .trail.attente .etat-phrase { color: var(--texte-2); }
.trail.complet .pastille { background: var(--erreur); }
.sous-phrase, .rappel-prevu { font: 400 13px var(--mono); color: var(--doux); }
.action a.bouton { display: inline-flex; align-items: center; justify-content: center; height: 48px; text-decoration: none; font-size: 16px; padding: 0 20px; }
.infos-ligne { font: 500 14px var(--mono); color: var(--texte-2); }
.trouvee { display: flex; flex-direction: column; gap: 8px; border-left: 3px solid var(--jaune); padding: 4px 0 4px 12px; font-size: 15px; color: var(--texte-2); }
.rappel-form .champ { flex: 1 1 200px; width: auto; }
.rappel-form .bouton { flex: 1 0 auto; }
details.details summary { cursor: pointer; color: var(--doux); font-size: 14px; min-height: 32px; }
details.details[open] { display: flex; flex-direction: column; gap: 10px; }
.details .sous-titre { font-size: 13px; font-weight: 700; color: var(--texte-2); margin-top: 6px; }
.details .reglage { font-size: 13px; color: var(--tres-doux); line-height: 1.4; }
.liste-epreuves { list-style: none; margin: 0; padding: 0; }
.liste-epreuves li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--bord); }
.liste-epreuves li > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.liste-epreuves li.visee b { color: var(--trail); }
.liste-epreuves .droite { display: flex; align-items: center; gap: 8px; flex: none; }
.etat-texte { font-size: 12px; color: var(--doux); text-align: right; }
.discret.petit { height: 32px; padding: 0 10px; font-size: 12px; }
/* Formulaire : un champ, une bascule Cinéma / Trail ; le cinéma n'est demandé que pour un film. */
.bascule { display: inline-flex; border: 1px solid var(--bord-fort); border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.bascule input { position: absolute; opacity: 0; pointer-events: none; }
.bascule label { padding: 0 18px; height: 56px; display: flex; align-items: center; font-weight: 700; color: var(--doux); cursor: pointer; }
.bascule input:checked + label { background: var(--fond); color: var(--texte); }
.bascule input:focus-visible + label { outline: 2px solid var(--trail); outline-offset: -2px; }
.si-cinema { display: none; }
.nouvelle:has(#g-cinema:checked) .si-cinema { display: block; }
.rangee > select.si-cinema { flex: 1 1 260px; width: auto; }
.nouvelle:has(#g-cinema:checked) .si-trail { display: none; }
details.options summary { cursor: pointer; color: var(--doux); font-size: 14px; min-height: 32px; }
details.options .rangee { margin-top: 8px; }
.pied .deconnexion-mobile { display: none; }

/* iPhone (planche Mobile, 390 px) */
@media (max-width: 640px) {
  .page { padding: 28px 16px 40px; gap: 26px; }
  .entete { flex-wrap: nowrap; align-items: center; padding-bottom: 0; border: 0; gap: 12px; }
  .marque { gap: 12px; } .marque svg { width: 40px; height: 30px; }
  .logo { font-size: 34px; } .devise, .pilule.ntfy, .entete .deconnexion, .entete .lien-admin { display: none; }
  .entete .pilules .pilule:first-child { border: 0; padding: 0; min-height: 0; font-size: 13px; }
  .nouvelle { padding: 16px; gap: 10px; }
  .rangee > .lien, .rangee > .bouton, .groupe { flex-basis: 100%; }
  .groupe label { display: none; }
  .champ.grand { height: 52px; } .bouton { height: 52px; }
  .titre-section { justify-content: space-between; }
  .titre-section h2 { font-size: 26px; } .titre-section .mono { font-size: 11px; }
  .grille { grid-template-columns: 1fr; gap: 12px; }
  .carte { padding: 18px; gap: 12px; }
  .carte h3 { font-size: 26px; }
  .affiche { display: none; }
  .film .corps { padding: 18px; gap: 14px; }
  .film h3 { font-size: 34px; } .film .lieu { font-size: 14px; }
  /* Titre sur toute la largeur, mention et badge passent dessous si la place manque. */
  .film .haut { flex-wrap: wrap; } .film .haut > div { flex-basis: 100%; }
  .mention-mobile { display: inline-block; flex: none; padding: 5px 8px; border: 2px solid var(--accent); color: var(--accent);
    font-weight: 800; font-size: 12px; letter-spacing: .06em; }
  .compteurs { gap: 8px; } .compteurs > div { padding: 10px; border-radius: 8px; }
  .compteurs b { font-size: 22px; } .compteurs span { font-size: 11px; }
  .long { display: none; } .court { display: inline; }
  .film .phrase { display: none; }
  .badge { padding: 5px 8px; font-size: 11px; }
  .pastilles { gap: 6px; } .pastilles span { padding: 5px 8px; font-size: 13px; }
  .bascule { flex-basis: 100%; } .bascule label { flex: 1; justify-content: center; height: 48px; }
  .etat-phrase { font-size: 20px; } .trail h3 { font-size: 22px; }
  details.options .groupe label { display: block; } .rangee > select.si-cinema { flex-basis: 100%; }
  .pied { flex-direction: column; align-items: center; text-align: center; font-size: 12px; }
  .pied .deconnexion-mobile { display: flex; }
  .ecran-connexion { padding: 0; align-items: stretch; }
  .cadre { border: 0; border-radius: 0; flex-direction: column; }
  /* En colonne, flex-basis 420px devenait une HAUTEUR : d'où le grand vide sous le logo. */
  .vitrine, .formulaire { flex: none; }
  .vitrine { border-right: 0; border-bottom: 1px solid var(--bord); padding: 32px 20px; gap: 20px; }
  .vitrine .devise { display: block; }
  .vitrine .logo { font-size: 52px; } .vitrine svg { width: 56px; height: 40px; }
  .formulaire { padding: 28px 20px 40px; }
  .formulaire h1 { font-size: 34px; }
}
