/* Page spectatrice (direct) et page replay : même charte, même mise en page.
   Extrait de index.html le 30/10/2026. Les couleurs viennent de theme.css. */
  /* La charte (couleurs neutres, police, arrondis) vit dans theme.css,
     partagé par les quatre écrans. La couleur d'accentuation, le logo et la
     présentatrice viennent de l'habillage du webinaire (/api/etat), réglé
     dans la configuration : une seule interface pour toutes les marques. */

  * { box-sizing: border-box; }

  body {
    margin: 0;
    min-height: 100vh;
    background: var(--fond);
    color: var(--texte);
    font-family: var(--corps);
    font-size: 14px;
    line-height: 1.5;
  }
  ::placeholder { color: var(--placeholder); }
  a { color: var(--accent); }
  [hidden] { display: none !important; }

  /* ----- Barre du haut, commune à tous les écrans ----- */
  .barre {
    height: 56px; display: flex; align-items: center; gap: 16px; padding: 0 20px;
    background: var(--carte); border-bottom: 1px solid var(--bordure);
  }
  .logo-marque { height: 30px; width: auto; display: block; }
  .nom-marque { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
  .separateur { width: 1px; height: 24px; background: var(--bordure); flex: 0 0 auto; }
  .barre .titre {
    flex: 1; min-width: 0; margin: 0; font-size: 15px; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .etiquette {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
  }
  .etiquette.live { background: var(--live); color: #ffffff; }
  .etiquette.live .point { width: 6px; height: 6px; border-radius: 50%; background: #ffffff; animation: pulse 1.6s ease-in-out infinite; }
  .etiquette.bientot { background: var(--surface2); color: var(--texte-doux); }
  @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

  /* ----- Écrans hors direct ----- */
  .ecran { min-height: 100vh; grid-template-rows: 56px 1fr; }
  .ecran > .contenu-ecran { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
  .centre { min-height: 100vh; place-items: center; padding: 24px; }

  .carte {
    width: 100%; max-width: 440px; padding: 36px;
    background: var(--carte); border: 1px solid var(--bordure);
    border-radius: var(--rayon); box-shadow: var(--ombre); text-align: center;
  }
  .carte h1 { margin: 0 0 8px; font-size: 22px; font-weight: 700; line-height: 1.3; }
  .carte .sous { margin: 0 0 20px; color: var(--texte-doux); }
  .carte .logo-marque { margin: 0 auto 18px; }
  .carte .nom-marque { display: block; margin-bottom: 18px; }

  /* Entrée : infos du webinaire à gauche, formulaire à droite. */
  .acces {
    width: 100%; max-width: 980px; display: grid; grid-template-columns: minmax(0, 1fr) 400px;
    background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon);
    box-shadow: var(--ombre); overflow: hidden;
  }
  .acces .infos { padding: 40px; border-right: 1px solid var(--bordure); display: flex; flex-direction: column; gap: 20px; }
  .acces .infos h1 { margin: 0; font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
  .acces .detail { display: flex; align-items: center; gap: 10px; color: var(--texte-moyen); }
  .acces .detail svg { flex: 0 0 auto; }
  .acces .formulaire { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
  .acces .formulaire h2 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
  .acces .formulaire .sous { margin: 0 0 22px; font-size: 13px; color: var(--texte-doux); }

  .presentatrice { display: flex; align-items: center; gap: 12px; }
  .presentatrice img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
  .presentatrice .nom { font-weight: 600; line-height: 1.3; }
  .presentatrice .role { font-size: 13px; color: var(--texte-doux); line-height: 1.3; }
  .acces .presentatrice { margin-top: auto; padding-top: 20px; border-top: 1px solid var(--bordure); }

  label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 500; }
  input {
    width: 100%; padding: 11px 12px; margin-bottom: 14px;
    background: var(--carte); border: 1px solid var(--champ-bord);
    border-radius: var(--rayon-petit); color: var(--texte); font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
  }
  input:focus { outline: none; border-color: var(--accent); box-shadow: var(--halo); }

  .bouton {
    display: block; width: 100%; padding: 12px 16px;
    background: var(--accent); color: var(--accent-texte);
    border: 0; border-radius: var(--rayon-petit); font: inherit; font-size: 15px; font-weight: 600;
    text-align: center; text-decoration: none; cursor: pointer;
    transition: background .15s ease;
  }
  .bouton:hover { background: var(--accent-fonce); }
  .bouton:disabled { opacity: .55; cursor: default; }

  .message { margin: 12px 0 0; font-size: 13px; color: var(--erreur); min-height: 18px; }
  .mention { margin: 14px 0 0; font-size: 12px; color: var(--texte-doux); }

  /* ----- Accès en cours ----- */
  .spinner {
    width: 40px; height: 40px; margin: 4px auto 18px;
    border: 3px solid var(--bordure); border-top-color: var(--accent);
    border-radius: 50%; animation: tourne .9s linear infinite;
  }
  @keyframes tourne { to { transform: rotate(360deg); } }
  .titre-charge { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
  .sous-charge { margin: 0; color: var(--texte-doux); }
  .rappel { margin: 14px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-moyen); }
  @media (prefers-reduced-motion: reduce) { .spinner, .etiquette.live .point { animation-duration: 2.2s; } }

  /* ----- Salle d'attente : le compte à rebours dans le cadre de la vidéo ----- */
  .attente { width: 100%; max-width: 860px; display: flex; flex-direction: column; gap: 16px; }
  .scene-attente {
    aspect-ratio: 16 / 9; border-radius: var(--rayon); background: #111318; color: #ffffff;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px;
    text-align: center;
  }
  .scene-attente .quoi { font-size: 13px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: #b8bec8; }
  .compteur { display: flex; gap: 12px; }
  .compteur .bloc {
    width: 96px; padding: 14px 0 10px; border-radius: var(--rayon);
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1);
  }
  .compteur .val { font-size: 46px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
  .compteur .lib { margin-top: 6px; font-size: 12px; color: #b8bec8; }
  .imminent { font-size: 24px; font-weight: 600; }
  .scene-attente .note { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #d5d9df; }
  .attente .infos-attente {
    display: flex; align-items: center; gap: 16px; padding: 16px 18px;
    background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon);
  }
  .attente .infos-attente .textes { flex: 1; min-width: 0; }
  .attente .infos-attente h1 { margin: 0; font-size: 15px; font-weight: 600; }
  .attente .infos-attente p { margin: 2px 0 0; font-size: 13px; color: var(--texte-doux); }
  .inscrite {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px;
    border-radius: var(--rayon-petit); background: var(--accent-pale); color: var(--accent-fonce);
    font-size: 13px; font-weight: 600;
  }

  /* ----- Bandeau technique ----- */
  .bandeau {
    display: none; padding: 10px 18px;
    background: var(--dore-pale); color: var(--dore-texte);
    border-bottom: 1px solid var(--dore-bord);
    font-size: 14px; font-weight: 500; text-align: center;
  }
  .bandeau.actif { display: block; }

  /* ----- Direct ----- */
  #vueDirect { display: none; }
  .direct { display: flex; height: calc(100vh - 56px); min-height: 560px; }
  /* La scène (vidéo, présentatrice, offre) garde une largeur telle que
     l'offre reste visible sans faire défiler, même sur un portable. */
  .direct main {
    --scene: min(100%, calc((100vh - 300px) * 16 / 9));
    flex: 1; min-width: 0; overflow-y: auto; padding: 20px 24px;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
  }
  .direct main > * { width: var(--scene); }

  .lecteur {
    position: relative; flex: 0 0 auto; aspect-ratio: 16 / 9; background: #000000;
    border-radius: var(--rayon); overflow: hidden;
    user-select: none; -webkit-user-select: none;
  }
  /* Aucune interaction ne doit atteindre YouTube : ni clic, ni clavier. */
  .lecteur iframe {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
    pointer-events: none;
  }
  /* Bouclier transparent au-dessus du lecteur : il absorbe tous les clics
     (pause, menu contextuel, logo YouTube, double-clic plein ecran). */
  .lecteur .bouclier { position: absolute; inset: 0; z-index: 5; cursor: default; }

  .son {
    display: none; position: absolute; left: 14px; bottom: 14px; z-index: 6;
    align-items: center; gap: 8px; padding: 9px 13px;
    background: rgba(0, 0, 0, .75); color: #ffffff;
    border: 0; border-radius: var(--rayon-petit); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  }
  .son:hover { background: rgba(0, 0, 0, .88); }
  .son.actif { display: inline-flex; }

  /* Offre : une fiche produit sous la vidéo. */
  .offre {
    display: none; align-items: center; gap: 18px; padding: 16px;
    background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon);
    animation: apparait .35s ease-out;
  }
  .offre.actif { display: flex; }
  @keyframes apparait { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .offre .visuel {
    width: 88px; height: 88px; flex: 0 0 auto; border-radius: var(--rayon-petit); overflow: hidden;
    background: var(--accent-pale); color: var(--accent-fonce);
    display: flex; align-items: center; justify-content: center;
  }
  .offre .visuel img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .offre .visuel img:not([hidden]) + svg { display: none; }
  .offre .texte { flex: 1; min-width: 0; }
  .offre .surtitre { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-fonce); }
  .offre h2 { margin: 2px 0; font-size: 18px; font-weight: 700; line-height: 1.3; }
  .offre p { margin: 0; font-size: 13px; color: var(--texte-doux); }
  .offre .prixbloc { flex: 0 0 auto; text-align: right; }
  .offre .prix { margin: 0; font-size: 22px; font-weight: 700; color: var(--texte); }
  .offre .timer { display: none; font-size: 12px; color: var(--texte-doux); font-variant-numeric: tabular-nums; }
  .offre .timer.actif { display: block; }
  .offre .timer .compte { font-weight: 600; color: var(--texte); }
  .offre .timer.fini .compte { color: var(--erreur); }
  .offre a {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px;
    background: var(--accent); color: var(--accent-texte); border-radius: var(--rayon-petit);
    text-decoration: none; font-size: 14px; font-weight: 600; transition: background .15s ease;
  }
  .offre a:hover { background: var(--accent-fonce); }

  /* ----- Barre latérale : chat et questions ----- */
  .panneau {
    width: 360px; flex: 0 0 auto; display: none; flex-direction: column;
    background: var(--carte); border-left: 1px solid var(--bordure);
  }
  .panneau.actif { display: flex; }
  .onglets { display: flex; padding: 0 8px; border-bottom: 1px solid var(--bordure); }
  .onglets button {
    padding: 14px 12px 12px; background: transparent; border: 0;
    border-bottom: 2px solid transparent; color: var(--texte-doux);
    font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  }
  .onglets button.choisi { color: var(--texte); font-weight: 600; border-bottom-color: var(--accent); }
  .vue { display: none; flex-direction: column; flex: 1; min-height: 0; }
  .vue.choisie { display: flex; }
  .messages { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 14px; }
  .msg { display: flex; gap: 10px; font-size: 13px; }
  .msg .avatar {
    width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%;
    background: var(--surface2); border: 1px solid var(--bordure);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600; color: var(--texte-doux);
  }
  .msg.animateur .avatar { background: var(--accent); border-color: var(--accent); color: var(--accent-texte); }
  .msg .corps { min-width: 0; }
  .msg .entete { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .msg .qui { font-weight: 600; }
  .msg .badge {
    padding: 1px 6px; border-radius: 4px; background: var(--accent-pale); color: var(--accent-fonce);
    font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  }
  .msg .heure { font-size: 11px; color: var(--texte-doux); }
  .msg .texte { word-wrap: break-word; overflow-wrap: anywhere; }
  .epingle {
    display: none; margin: 12px 12px 0; padding: 10px 12px;
    background: var(--surface2); border: 1px solid var(--bordure); border-radius: var(--rayon-petit);
    font-size: 13px;
  }
  .epingle.actif { display: block; }
  .epingle .quoi { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; font-size: 11px; font-weight: 600; color: var(--texte-doux); }
  .epingle .quoi svg { width: 12px; height: 12px; flex: 0 0 auto; }
  .epingle .qui { margin-top: 4px; font-size: 12px; color: var(--texte-doux); }
  .saisie { padding: 12px; border-top: 1px solid var(--bordure); }
  .saisie textarea {
    width: 100%; min-height: 44px; max-height: 120px; padding: 10px 12px;
    background: var(--fond); border: 1px solid var(--bordure); border-radius: var(--rayon-petit);
    color: var(--texte); font: inherit; font-size: 13px; resize: vertical;
    transition: border-color .15s ease, box-shadow .15s ease;
  }
  .saisie textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--halo); }
  .saisie .ligne { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
  .saisie button {
    padding: 8px 16px; background: var(--accent); color: var(--accent-texte);
    border: 0; border-radius: var(--rayon-petit); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
    transition: background .15s ease;
  }
  .saisie button:hover { background: var(--accent-fonce); }
  .saisie button:disabled { opacity: .5; cursor: default; }
  .saisie .note { flex: 1; font-size: 12px; color: var(--texte-doux); }
  .saisie .note.erreur { color: var(--erreur); }

  /* ----- Notification de vente ----- */
  .vente {
    position: fixed; left: 20px; bottom: 20px; z-index: 900;
    display: flex; gap: 10px; align-items: center; max-width: 380px;
    padding: 12px 16px;
    background: #14171f; color: #ffffff;
    border-radius: var(--rayon); box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
    font-size: 14px; font-weight: 500;
    opacity: 0; transform: translateY(16px);
    transition: opacity .35s ease, transform .35s ease;
    pointer-events: none;
  }
  .vente.actif { opacity: 1; transform: none; }
  .vente .pastille { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

  @media (max-width: 900px) {
    .acces { grid-template-columns: 1fr; }
    .acces .infos { border-right: 0; border-bottom: 1px solid var(--bordure); padding: 28px; }
    .acces .formulaire { padding: 28px; }
    .direct { flex-direction: column; height: auto; }
    .direct main { overflow: visible; padding: 14px; --scene: 100%; }
    .panneau { width: auto; height: 460px; border-left: 0; border-top: 1px solid var(--bordure); }
    .offre { flex-wrap: wrap; }
    .offre .prixbloc { text-align: left; }
    .offre a { width: 100%; justify-content: center; }
    .compteur .bloc { width: 70px; }
    .compteur .val { font-size: 34px; }
    .barre .etiquette.bientot { display: none; }
    .vente { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  }
