/* Plateforme de streaming Square Event — les couleurs viennent de l'habillage (variables :root injectées par la page). */
*, *::before, *::after { box-sizing: border-box; }
:root {
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --muted: color-mix(in srgb, var(--text) 62%, transparent);
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 28px rgba(0,0,0,.08);
}
html, body { margin: 0; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  background-size: cover; background-position: center; background-attachment: fixed;
  line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: var(--primary); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Boutons & champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 600; border: 0; border-radius: 10px; cursor: pointer;
  padding: .8rem 1.2rem; background: var(--primary); color: var(--on-primary);
  transition: filter .15s, transform .05s; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px;
}
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-small { padding: .45rem .8rem; font-size: .9rem; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field label { font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--text) 22%, transparent);
  border-radius: 10px; padding: .75rem .85rem; width: 100%;
}
.password-wrap { position: relative; }
.password-wrap input { padding-right: 5.5rem; }
.password-toggle {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; font: inherit; font-size: .85rem; color: var(--muted);
  cursor: pointer; padding: .4rem .6rem; border-radius: 8px;
}
.password-toggle:hover { color: var(--text); }

.alert { border-radius: 10px; padding: .75rem .9rem; margin-bottom: 1rem; font-size: .95rem; }
.alert-error { background: #fdecec; color: #8a1c1c; border: 1px solid #f5c2c2; }
.alert-ok { background: #e8f6ee; color: #14532d; border: 1px solid #b8e2c8; }
.alert-info { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); }

/* ---------- Page de connexion ---------- */
.login-page { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.login-card {
  width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 36px 32px 28px;
}
.login-card .logo { display: block; max-width: 220px; max-height: 90px; margin: 0 auto 22px; object-fit: contain; }
.login-card h1 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .3rem; text-align: center; }
.login-card .subtitle { text-align: center; color: var(--muted); margin: 0 0 1.25rem; }
.login-card .intro { font-size: .95rem; color: var(--muted); margin: 0 0 1.4rem; text-align: center; }
.login-card .help { font-size: .85rem; color: var(--muted); text-align: center; margin: 1.1rem 0 0; }
.privacy-note { font-size: .8rem; line-height: 1.45; color: var(--muted); text-align: center; margin: .9rem 0 0; }
.site-footer a { color: inherit; }
body.has-bg .site-footer a { color: #fff; }

/* Page « Données personnelles » */
.doc-page { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 16px; }
.doc-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 36px 40px; }
.doc-card .logo { max-height: 56px; max-width: 180px; object-fit: contain; display: block; margin-bottom: 20px; }
.doc-card h1 { font-size: 1.5rem; margin: 0 0 .3rem; }
.doc-card h2 { font-size: 1.05rem; margin: 1.8rem 0 .5rem; }
.doc-card p, .doc-card li { color: color-mix(in srgb, var(--text) 85%, transparent); }
.doc-card ul { padding-left: 1.2rem; margin: .4rem 0; }
.doc-card li { margin: .25rem 0; }
.doc-card .back { display: inline-block; margin-top: 1.8rem; }
@media (max-width: 520px) { .doc-card { padding: 26px 20px; } }

.accent-bar { height: 4px; border-radius: 4px; background: var(--primary); width: 48px; margin: 0 auto 1.2rem; }

.site-footer { text-align: center; font-size: .8rem; color: var(--muted); padding: 18px 16px 24px; }
body.has-bg .site-footer { color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }

/* ---------- Page du direct ---------- */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 10px 24px; position: sticky; top: 0; z-index: 5;
}
.topbar.is-primary { background: var(--primary); color: var(--on-primary); border-bottom: 0; }
.topbar.is-primary .btn-ghost { color: var(--on-primary); border-color: color-mix(in srgb, var(--on-primary) 40%, transparent); }
.topbar.is-primary .who { color: color-mix(in srgb, var(--on-primary) 80%, transparent); }
.topbar .logo { max-height: 44px; max-width: 160px; object-fit: contain; display: block; }
.topbar .titles { min-width: 0; flex: 1; }
.topbar .titles h1 { font-size: 1.05rem; margin: 0; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .titles p { margin: 0; font-size: .85rem; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .who { font-size: .88rem; color: var(--muted); white-space: nowrap; }

.live-badge {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: #d62828; border-radius: 6px; padding: .2rem .55rem; margin-bottom: .6rem;
}
.live-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.live-layout {
  flex: 1; width: 100%; max-width: 1600px; margin: 0 auto; padding: 24px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 24px; align-items: start;
}
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.player-frame { position: relative; padding-top: 56.25%; background: #000; }
.player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-meta { padding: 16px 20px 18px; }
.player-meta h2 { margin: 0; font-size: 1.15rem; }
.player-meta p { margin: .35rem 0 0; color: var(--muted); }
.qa-panel { display: flex; flex-direction: column; height: 600px; min-height: 480px; } /* hauteur alignée sur le player par live.php */
.qa-panel header { padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700; }
.qa-panel iframe { flex: 1; width: 100%; border: 0; display: block; }
.empty-state { padding: 48px 24px; text-align: center; color: var(--muted); }

.closed-wrap { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.closed-card { max-width: 560px; text-align: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 40px 32px; }
.closed-card h2 { margin-top: 0; }

@media (max-width: 1000px) {
  .live-layout { grid-template-columns: 1fr; padding: 16px; gap: 16px; }
  .qa-panel { height: 560px; min-height: 0; }
  .topbar { padding: 10px 16px; gap: 12px; }
  .topbar .who { display: none; }
}
@media (max-width: 520px) {
  .login-card { padding: 28px 20px 22px; }
  .topbar .titles p { display: none; }
  .topbar .logo { max-width: 110px; max-height: 36px; }
}

/* =========================================================================
   Scène connexion / attente avec visuel de l'événement (affiche)
   classic   : pas de visuel, carte centrée
   split     : visuel à gauche, carte à droite
   immersive : visuel flouté en fond plein écran, visuel net + carte en verre
   banner    : visuel en bandeau au-dessus, carte qui le chevauche
   ========================================================================= */
.stage { flex: 1; width: 100%; padding: 40px 24px; display: grid; place-items: center; position: relative; isolation: isolate; }
.stage .poster { margin: 0; }
.stage .poster img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.08), 0 24px 60px rgba(0,0,0,.18); }

/* Carte : un peu plus de caractère qu'avant */
.login-card { position: relative; border-top: 4px solid var(--primary); }
.login-card h1 { letter-spacing: -.01em; }
.eyebrow { text-align: center; margin: 0 0 .35rem; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }

/* --- split --- */
.stage-split { grid-template-columns: minmax(0, 1.55fr) minmax(340px, 420px); gap: 40px; max-width: 1360px; margin: 0 auto; align-items: center; }
.stage-split .login-card { max-width: none; }

/* --- immersive --- */
.stage-immersive { grid-template-columns: minmax(0, 1.55fr) minmax(340px, 420px); gap: 40px; max-width: 1360px; margin: 0 auto; align-items: center; }
.stage-immersive::before {
  content: ""; position: fixed; inset: -40px; z-index: -2;
  background: var(--poster) center / cover no-repeat; filter: blur(36px) saturate(1.15); transform: scale(1.1);
}
.stage-immersive::after { content: ""; position: fixed; inset: 0; z-index: -1; background: linear-gradient(120deg, rgba(8,12,24,.72), rgba(8,12,24,.45)); }
.stage-immersive .login-card {
  max-width: none; background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0,0,0,.35); border-top-color: var(--primary);
}
.stage-immersive .poster img { box-shadow: 0 30px 80px rgba(0,0,0,.45); }
body:has(.stage-immersive) .site-footer, body:has(.stage-immersive) .site-footer a { color: rgba(255,255,255,.75); }
body:has(.stage-immersive) .topbar { background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); }

/* --- banner --- */
.stage-banner { display: flex; flex-direction: column; align-items: center; gap: 28px; padding-top: 32px; }
.stage-banner .poster { width: 100%; max-width: 880px; }
.stage-banner .login-card { max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.14); }

/* --- attente : compte à rebours --- */
.waiting-card { text-align: center; }
.countdown-label { margin: .2rem 0 .7rem; font-size: .85rem; font-weight: 600; color: var(--muted); }
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 1.2rem; }
.countdown.no-days { grid-template-columns: repeat(3, 1fr); }
.countdown.no-days > div:first-child { display: none; }
.countdown > div { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent); border-radius: 12px; padding: 12px 4px 10px; }
.countdown span { display: block; font-size: 1.9rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--primary); }
.countdown small { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }
.waiting-message { margin: 0 0 1rem; }
.waiting-note { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-size: .85rem; color: var(--muted); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 1.6s infinite; flex: none; }

@media (max-width: 1000px) {
  .stage-split, .stage-immersive { grid-template-columns: 1fr; gap: 24px; max-width: 640px; padding: 24px 16px; }
}
@media (max-width: 520px) {
  .stage { padding: 16px; }
  .stage .poster img { border-radius: 12px; }
  .countdown span { font-size: 1.5rem; }
}
