/* =====================================================================
   Roulette de Noël BK Bordeaux — thème commun (jeu, pages légales, staff, admin)
   DA « BK x Noël » ORIGINALE en attendant les visuels officiels du client : aucun logo ni typographie
   propriétaire reproduits. Polices libres (Lilita One, Nunito). TOUTES les couleurs sont des variables :
   le client peut les ajuster ici.
   ===================================================================== */
:root {
  /* Marque (à ajuster selon la charte officielle fournie par le client) */
  --c-red: #D7262B;        /* rouge flamme / Noël */
  --c-red-dark: #9E1419;
  --c-orange: #F28C28;
  --c-gold: #F4B23E;
  --c-cream: #FFF3DF;      /* crème « pain brioché » */
  --c-brown: #4A2412;      /* brun grillé */
  --c-brown-2: #6B3A1F;
  --c-green: #17683B;      /* sapin */
  --c-green-dark: #0E4527;
  --c-white: #FFFFFF;
  --c-black: #1C0D06;
  --c-yellow: #F4B23E;
  /* Pages claires (back-office, pages légales) */
  --c-paper: #FFFFFF;
  --c-paper-2: #F7F1E8;
  --c-text-dark: #2A160B;
  --c-muted-dark: #6B5446;
  --c-line-dark: #E3D6C6;
  --c-error: #C21A1F;
  --c-success: #17683B;
  --c-focus: #1C0D06;

  --font-title: 'Lilita One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius: 18px;
  --radius-sm: 10px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  display: flex; flex-direction: column;
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font); font-weight: 600; font-size: 16px; line-height: 1.5;
  color: var(--c-text-dark); background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
}
body > main { flex: 1 0 auto; }
body > header, body > main, body > .site-footer, body > .demo-banner { width: 100%; }
.site-footer { margin-top: auto; flex: none; }
img, svg, canvas, video { display: block; max-width: 100%; }
a { color: var(--c-red); }
a:hover { color: var(--c-red-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Marqueur des textes non validés (affiché en mode démo uniquement) */
.draft-mark {
  display: inline-block; margin-left: .35em; padding: 0 .4em; border-radius: 4px; vertical-align: middle;
  font: 800 9px/1.6 var(--font); letter-spacing: .03em; text-transform: uppercase; white-space: nowrap;
  color: #5b3b00; background: #FFE08A; border: 1px dashed #A87400;
}
.placeholder-note { color: #8A5A00; background: #FFF4CC; padding: 0 .25em; border-radius: 3px; }

/* Emplacement du logo officiel (à fournir par le client) */
.logo-slot { display: block; width: auto; height: 44px; }

/* ---------- Boutons (≥ 48 px) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.4em; border: 2px solid transparent; border-radius: 999px;
  font-family: var(--font); font-weight: 900; font-size: 1rem; line-height: 1.1; text-decoration: none; text-align: center;
  cursor: pointer; transition: transform .12s ease, background-color .15s ease, color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary, .btn-red { color: var(--c-white); background: var(--c-red); }
.btn-primary:hover:not(:disabled), .btn-red:hover:not(:disabled) { color: var(--c-white); background: var(--c-red-dark); }
.btn-cta {
  color: var(--c-brown); background: linear-gradient(180deg, #FFD36B, var(--c-gold) 60%, #E39A1F);
  font-family: var(--font-title); font-weight: 400; font-size: 1.3rem; letter-spacing: .02em; min-height: 58px;
  box-shadow: 0 5px 0 #A3620C, 0 10px 22px rgba(0, 0, 0, .25);
}
.btn-cta:hover:not(:disabled) { color: var(--c-brown); filter: brightness(1.05); }
.btn-cta:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #A3620C, 0 6px 12px rgba(0, 0, 0, .25); }
.btn-white { color: var(--c-red-dark); background: var(--c-white); }
.btn-ghost { color: inherit; background: transparent; border-color: currentColor; }
.btn-ghost:hover:not(:disabled) { background: rgba(127, 127, 127, .12); }
.btn-small { min-height: 44px; padding: .4em 1em; font-size: .9rem; }
.btn-block { width: 100%; }

/* ---------- Bandeau démo ---------- */
.demo-banner {
  position: relative; z-index: 30; padding: .35rem .8rem; text-align: center;
  font-size: .78rem; font-weight: 800; color: var(--c-brown); background: repeating-linear-gradient(45deg, #FFE08A, #FFE08A 12px, #FFD15C 12px, #FFD15C 24px);
}

/* ---------- Pied de page ---------- */
.site-footer { background: var(--c-brown); color: var(--c-cream); }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin: 0; padding: 1rem 1rem .5rem; list-style: none; }
.footer-links a, .footer-links button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0; border: 0; background: none;
  color: rgba(255, 243, 223, .9); font-size: .86rem; font-weight: 700; text-decoration: none; cursor: pointer;
}
.footer-links a:hover, .footer-links button:hover { color: var(--c-white); text-decoration: underline; }
.footer-note { margin: 0; padding: 0 1rem 1.2rem; text-align: center; font-size: .75rem; color: rgba(255, 243, 223, .75); }
.site-footer :focus-visible { outline-color: var(--c-gold); }

/* ---------- Pages simples (légal, désinscription) ---------- */
.page-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, calc((100vw - 860px) / 2)); background: var(--c-red); color: var(--c-white);
}
.page-header .btn { margin: 6px 0; color: var(--c-white); }
.page-header :focus-visible { outline-color: var(--c-gold); }
.prose { max-width: 860px; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; color: var(--c-text-dark); font-weight: 500; }
.prose h1 { font-family: var(--font-title); font-weight: 400; font-size: clamp(1.7rem, 6vw, 2.4rem); line-height: 1.1; margin: .6rem 0 1.2rem; color: var(--c-red); }
.prose h2 { font-size: 1.12rem; font-weight: 900; color: var(--c-brown); margin: 2rem 0 .5rem; }
.prose .muted { color: var(--c-muted-dark); }
.prose li { margin: .25rem 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.prose th, .prose td { border: 1px solid var(--c-line-dark); padding: 6px 8px; text-align: left; }
.prose .warning-box { padding: 10px 14px; border-left: 6px solid var(--c-gold); background: #FFF4CC; font-weight: 700; }

/* ---------- Bandeau cookies (uniquement si un traceur est activé) ---------- */
body.has-consent { padding-bottom: calc(var(--consent-h, 150px) + 8px); }
html:has(> body.has-consent) { scroll-padding-bottom: calc(var(--consent-h, 150px) + 8px); }
.consent {
  position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
  isolation: isolate; /* les boutons restent au-dessus de tout décor du bandeau */
  max-height: 80vh; max-height: 80dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 14px calc(12px + var(--safe-bottom));
  background: var(--c-white); color: var(--c-text-dark); border-top: 4px solid var(--c-red);
  animation: consent-in .25s ease-out;
}
.consent :focus-visible { outline-color: var(--c-black); }
/* Fondu seul : les boutons ne bougent pas pendant l'apparition (cible immobile dès le premier toucher) */
@keyframes consent-in { from { opacity: 0; } }
.consent h2 { margin: 0 0 2px; font-size: .95rem; font-weight: 800; color: var(--c-black); }
.consent p { margin: 0 0 10px; font-size: .8rem; line-height: 1.4; color: var(--c-muted-dark); }
.consent p a { display: inline-block; padding: 2px 0; }
.consent-actions { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.consent-actions .btn { min-height: 44px; padding: .5em .6em; font-size: .88rem; white-space: nowrap; }
@media (min-width: 720px) {
  .consent {
    display: grid; align-items: center; gap: 2px 24px;
    grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "title text actions";
    padding: 10px max(20px, calc((100vw - 1120px) / 2)) calc(10px + var(--safe-bottom));
  }
  .consent h2 { grid-area: title; margin: 0; }
  .consent p { grid-area: text; margin: 0; }
  .consent-options { grid-area: opts; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 6px 0 0; }
  .consent-actions { grid-area: actions; grid-template-columns: repeat(3, auto); }
  .consent-actions .btn { padding: .5em 1.1em; }
  .consent.is-custom { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title title" "text text" "opts actions"; align-items: end; }
}
.consent-options { margin: 0 0 12px; display: grid; gap: 8px; }
.consent-option {
  display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; align-items: center;
  padding: .7rem .85rem; border: 1px solid var(--c-line-dark); border-radius: var(--radius-sm); background: var(--c-paper-2);
}
.consent-option strong { font-size: .9rem; color: var(--c-black); }
.consent-option small { grid-column: 1; font-size: .78rem; color: var(--c-muted-dark); }
.consent-option input { grid-row: 1 / span 2; grid-column: 2; width: 22px; height: 22px; accent-color: var(--c-red); }

/* ---------- Pages de contenu (règlement, confidentialité) : fond blanc, lisible ---------- */

/* ---------- Pages légales ---------- */
.legal-page { background: var(--c-cream); color: var(--c-brown); }
.legal-page .page-header { background: var(--c-red); }
.prose .table-wrap { overflow-x: auto; }
.prose table { width: 100%; border-collapse: collapse; margin: .6rem 0 1rem; }
.prose th, .prose td { padding: 8px 10px; border: 1px solid rgba(74, 36, 18, .2); text-align: left; }
.unsub { text-align: center; }
