/* Calendrier de l'Avent Préau : habillage provisoire du socle, en charte actuelle.
   Couleurs autorisées uniquement : #353FF2 (bleu), #2730D4 (survol), #12103F (navy), #E2E6F8, #E0F2FE, #F2F3FF, #FFF, #555 (texte secondaire).
   Le visuel définitif (grille ou parcours, touches de Noël) sera fait ensuite. */

/* Montserrat, servie par le site lui-même (plus d'appel à Google Fonts depuis le 30/10) : police variable 400 à 900 */
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('polices/montserrat-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400 900; font-display: swap; src: url('polices/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bleu: #353FF2;
  --bleu-survol: #2730D4;
  --navy: #12103F;
  --bleu-clair: #E2E6F8;
  --bleu-tres-clair: #E0F2FE;
  --fond: #F2F3FF;
  --blanc: #FFFFFF;
  --gris: #555;
  --or: #F2B33D; /* touche de Noël validée pour le calendrier */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--navy);
  background: var(--fond);
}
a { color: var(--bleu); }
a:hover { color: var(--bleu-survol); }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px; }

.evitement { position: absolute; left: -9999px; }
.evitement:focus { left: 16px; top: 16px; background: var(--blanc); padding: 8px 12px; z-index: 10; }

.bandeau-test { background: var(--navy); color: var(--blanc); font-weight: 700; font-size: 13px; text-align: center; padding: 6px 16px; }
/* « Voir un test » de l'admin : bandeau doré collé en haut, au-dessus de tout (même de l'animation d'entrée) */
.bandeau-apercu { position: sticky; top: 0; z-index: 2000; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px; padding: 8px 16px; background: var(--or); color: var(--navy); font-size: 13px; line-height: 1.4; }
.bandeau-apercu p, .bandeau-apercu form { margin: 0; }
.bandeau-apercu form { display: flex; align-items: center; gap: 6px; }
.bandeau-apercu label { font-weight: 700; }
.bandeau-apercu select, .bandeau-apercu button { font: 600 13px 'Montserrat', Arial, sans-serif; color: var(--navy); border: 1.5px solid var(--navy); border-radius: 6px; padding: 4px 8px; background: var(--blanc); }
.bandeau-apercu button { cursor: pointer; background: var(--navy); color: var(--blanc); }
.bandeau-apercu a { color: var(--navy); font-weight: 700; }

/* En-tête bleu nuit, logo blanc centré, sur toutes les pages publiques (il se fond dans le bandeau) */
.entete {
  position: relative; z-index: 2;
  background: var(--navy);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 20px 32px 8px;
}
.entete-logo { grid-column: 2; }
.entete-logo img { display: block; height: 44px; width: auto; }
.entete-lien { justify-self: end; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--blanc); }
.entete-lien:hover { color: var(--bleu-clair); text-decoration: underline; }
.entete :focus-visible { outline-color: var(--blanc); }
@media (max-width: 480px) {
  .entete { padding: 16px 16px 6px; }
  .entete-logo img { height: 36px; }
  .entete-lien { font-size: 13px; }
}

.bandeau { background: var(--navy); color: var(--blanc); padding: 28px 16px 32px; }
.bandeau-int { max-width: 760px; margin: 0 auto; }
.bandeau-sur { margin: 0 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.bandeau h1 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.2; }
.bandeau-sous { margin: 6px 0 0; font-size: 16px; }

.contenu { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
h2 { font-size: 21px; font-weight: 800; margin: 0 0 12px; line-height: 1.3; }

/* Boutons : l'agrandissement au survol passe par transform, jamais par le padding (rien ne bouge autour) */
.bouton {
  display: inline-block;
  background: var(--bleu); color: var(--blanc);
  border: 2px solid var(--bleu); border-radius: 8px;
  padding: 10px 18px; min-height: 44px;
  font: 700 16px/1.4 'Montserrat', Arial, sans-serif;
  text-decoration: none; text-align: center; cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.bouton:hover { background: var(--bleu-survol); border-color: var(--bleu-survol); color: var(--blanc); transform: scale(1.03); }
.bouton:active { transform: scale(.97); }
.bouton[disabled] { opacity: .6; cursor: wait; }
.bouton-grand { width: 100%; padding: 14px 18px; font-size: 17px; }
.bouton-clair { background: var(--blanc); color: var(--bleu); }
.bouton-clair:hover { background: var(--bleu-clair); color: var(--bleu-survol); }
.lien { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--bleu); text-decoration: underline; cursor: pointer; }
.boutons { display: flex; flex-wrap: wrap; gap: 10px; }

/* Encadrés */
.info, .succes, .alerte, .bonjour, .bloc-formulaire, .lot, .verif, .rappel, .pv, .texte {
  background: var(--blanc); border-radius: 10px; padding: 20px; margin: 0 0 18px;
  border: 1px solid var(--bleu-clair);
}
.info { background: var(--bleu-tres-clair); border-color: var(--bleu-tres-clair); }
.info p, .succes p, .alerte p { margin: 0 0 8px; }
.info p:last-child, .succes p:last-child, .alerte p:last-child { margin-bottom: 0; }
.succes { border: 2px solid var(--bleu); }
.succes:focus { outline: none; }
.alerte { border: 0; border-left: 6px solid var(--navy); font-weight: 600; }
.alerte p::before { content: "⚠ "; }
.code strong { font-size: 20px; letter-spacing: .03em; }
.rappel > p:first-child, .bonjour > p:first-child, .suite > p:first-child { margin-top: 0; }

/* Lot */
.lot { padding: 0; overflow: hidden; }
.lot-image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.lot-texte { padding: 20px; }
.lot-case { margin: 0 0 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--bleu); }
.lot h2 { font-size: 24px; margin-bottom: 4px; }
.lot-partenaire { margin: 0 0 10px; font-weight: 700; }
.lot-infos { margin: 14px 0 0; display: grid; gap: 8px; }
.lot-infos div { display: grid; grid-template-columns: 9.5em 1fr; gap: 8px; }
.lot-infos dt { font-weight: 700; color: var(--gris); }
.lot-infos dd { margin: 0; }
@media (max-width: 480px) { .lot-infos div { grid-template-columns: 1fr; gap: 0; } }

/* Formulaires */
.formulaire { margin-top: 8px; }
.champ { margin: 0 0 16px; }
.champ label, .coche label { font-weight: 700; }
.champ input, .champ select {
  display: block; width: 100%; margin-top: 6px;
  font: 600 16px 'Montserrat', Arial, sans-serif; color: var(--navy);
  padding: 12px 14px; min-height: 48px;
  border: 2px solid var(--gris); border-radius: 8px; background: var(--blanc);
}
/* Liste des départements : flèche dessinée pour un rendu identique sur tous les navigateurs */
.champ select {
  appearance: none; padding-right: 44px; cursor: pointer;
  background: var(--blanc) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2312103F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
}
.champ input:focus, .champ select:focus { border-color: var(--bleu); outline: none; }
.champ-erreur input, .champ-erreur select { border-color: var(--navy); border-width: 3px; }
.aide { margin: 4px 0 0; font-size: 14px; color: var(--gris); }
/* La règle de publication des gagnants, en petit sous les boutons de participation */
.mention { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--gris); }
/* Les gagnants validés, sur la page d'une case fermée */
.gagnants-titre { margin-bottom: 6px; }
.gagnants { display: grid; gap: 4px; margin: 0 0 12px; padding: 0; list-style: none; }
.gagnants strong { font-weight: 800; }
.aide-ligne { display: block; font-weight: 400; font-size: 14px; color: var(--gris); }
.erreur { margin: 6px 0 0; font-size: 14px; font-weight: 700; }
.erreur::before { content: "⚠ "; }
.coche { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; margin: 0 0 16px; }
.coche input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--bleu); }
.coche .erreur { grid-column: 2; }
.coche label { font-weight: 600; }
.pot-de-miel { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
details summary { cursor: pointer; font-weight: 800; font-size: 18px; padding: 4px 0; }
details[open] summary { margin-bottom: 10px; }
.pas-moi { margin-top: 12px; font-size: 15px; }

.recap { margin: 12px 0 18px; display: grid; gap: 10px; }
.recap div { display: grid; grid-template-columns: 11em 1fr; gap: 8px; }
.recap dt { font-weight: 700; color: var(--gris); }
.recap dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.recap-email { font-size: 18px; }
@media (max-width: 480px) { .recap div { grid-template-columns: 1fr; gap: 0; } }

/* Liste des cases (accueil du site du jeu) */
.grille { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grille-case a {
  display: flex; flex-direction: column; gap: 2px; height: 100%;
  background: var(--blanc); border: 2px solid var(--bleu-clair); border-radius: 10px;
  padding: 12px; text-decoration: none; color: var(--navy);
}
.grille-num { font-size: 26px; font-weight: 800; line-height: 1; }
.grille-titre { font-size: 14px; font-weight: 600; }
.grille-etat { font-size: 13px; color: var(--gris); }
.grille-jouee { font-size: 13px; font-weight: 700; color: var(--bleu); }
.grille-ouverte a { border-color: var(--bleu); background: var(--bleu); color: var(--blanc); }
.grille-ouverte .grille-etat, .grille-ouverte .grille-jouee { color: var(--blanc); font-weight: 700; }
.grille-fermee a { background: var(--fond); }

/* Registre, tableaux */
.tableau-defilant { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; background: var(--blanc); font-size: 14px; }
.tableau th, .tableau td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bleu-clair); vertical-align: top; }
.tableau thead th { background: var(--navy); color: var(--blanc); }
.empreinte { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; }
.verification { list-style: none; padding: 0; }
.verification li { padding: 6px 0; font-weight: 600; overflow-wrap: anywhere; }
.verification .ko { color: var(--navy); text-decoration: underline; }

.pied { max-width: 760px; margin: 0 auto; padding: 0 16px 32px; font-size: 14px; color: var(--gris); }
.pied nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Page d'une case : participation à gauche, lot et partenaire à droite (le lot d'abord sur mobile) */
.contenu:has(.case-page) { max-width: 1120px; }
.case-page { display: grid; gap: 18px; grid-template-areas: "lot" "lignes" "action"; }
.case-page:not(:has(> .lot-lignes)) { grid-template-areas: "lot" "action"; }
.case-page > .lot { grid-area: lot; margin: 0; min-width: 0; }
.case-page > .action { grid-area: action; min-width: 0; }
.case-page > .lot-lignes { grid-area: lignes; min-width: 0; }
/* Pas de « width » ici : la largeur vient de l'attribut width calculé par taille_logo() (même surface pour tous) */
.lot-logo { display: block; max-width: 170px; max-height: 52px; height: auto; margin: 4px 0 12px; }
@media (min-width: 900px) {
  .case-page { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); grid-template-areas: "action lot" "action lignes"; grid-template-rows: auto 1fr; gap: 28px; align-items: start; }
  .case-page:not(:has(> .lot-lignes)) { grid-template-areas: "action lot"; grid-template-rows: auto; }
  .case-page > .lot { position: sticky; top: 16px; }
}
/* Sur ordinateur (17/11, demande de Nicolas) : tout le site 20 % plus petit, comme le zoom à 80 % de Chrome qu'il
   préfère. Seulement les blocs de premier niveau de la page (bandeau de test, en-tête, bandeau d'une page, contenu,
   pied ; jamais deux fois) : l'entrée en paquet cadeau, l'entrée du 15 et les confettis restent à la taille de
   l'écran. Les mesures faites par les scripts dans ces blocs (réseau de la guirlande, calendrier.js) restent
   cohérentes : tout y est réduit ensemble. */
@media (min-width: 1100px) {
  body > :is(.bandeau-test, .entete, .bandeau, main, .pied) { zoom: .8; }
}

/* Annexe 1 du règlement : les lots au choix d'une case (19/11) */
.lots-choix { margin: 2px 0 0; padding-left: 18px; }
