/* ──────────────────────────────────────────────────────────────────────────
   RSKTV — Connexion de l'application WEB
   ──────────────────────────────────────────────────────────────────────────
   Pourquoi cet écran existe : jusqu'ici l'app web dérivait la licence d'une
   chaîne tapée par le client (`web-identity.js`, `setIdentifier`). Taper
   l'identifiant d'un abonné donnait son abonnement. L'accès passe désormais
   par un compte vérifié côté serveur.

   Parti pris visuel : une seule colonne, centrée, sur un fond sombre qui
   laisse respirer. Rien d'autre à l'écran — un écran de connexion n'a qu'un
   seul travail. L'accent rouge de la marque ne sert qu'à UNE chose à la fois :
   l'action principale ou le champ actif, jamais les deux (même règle que
   l'interface TV : un seul aplat d'accent visible).

   Accessibilité : tout est atteignable au clavier seul, les libellés sont de
   vrais <label>, les erreurs sont annoncées par aria-live, et les cibles font
   au moins 48 px de haut. Le contraste des textes dépasse 4,5:1.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --cx-fond:      #07070a;
  --cx-carte:     #111116;
  --cx-trait:     rgba(255, 255, 255, 0.10);
  --cx-texte:     #f2f2f5;
  --cx-sourdine:  #9b9ba6;
  --cx-accent:    #e50914;
  --cx-accent-2:  #ff2b38;
  --cx-erreur:    #ff6b6b;
  --cx-ok:        #35c66b;
  --cx-rayon:     14px;
}

#cx-ecran {
  position: fixed;
  inset: 0;
  z-index: 2147483000;        /* au-dessus de tout, y compris le splash */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 620px at 50% -12%, rgba(229, 9, 20, 0.16), transparent 62%),
    var(--cx-fond);
  color: var(--cx-texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-y: auto;
}

#cx-ecran[hidden] { display: none; }

.cx-carte {
  width: 100%;
  max-width: 440px;           /* une colonne : au-delà, l'œil cherche */
  background: var(--cx-carte);
  border: 1px solid var(--cx-trait);
  border-radius: var(--cx-rayon);
  padding: 38px 34px 30px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

.cx-marque { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.cx-marque img { width: 104px; height: auto; display: block; }

.cx-titre {
  margin: 0 0 6px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.cx-sous {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--cx-sourdine);
}

/* ── Champs ──────────────────────────────────────────────────────────────
   Le libellé reste VISIBLE au-dessus du champ. Un placeholder seul disparaît
   dès la première frappe : l'utilisateur ne sait plus ce qu'il remplit, et
   les lecteurs d'écran n'ont rien à annoncer.                                */
.cx-champ { margin-bottom: 16px; }

.cx-champ label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--cx-sourdine);
}

.cx-champ input {
  width: 100%;
  min-height: 50px;
  box-sizing: border-box;
  padding: 13px 15px;
  font-size: 16px;            /* < 16 px : iOS zoome au focus */
  font-family: inherit;
  color: var(--cx-texte);
  background: #0b0b10;
  border: 1px solid var(--cx-trait);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.cx-champ input::placeholder { color: #5d5d6a; }

.cx-champ input:focus {
  border-color: var(--cx-accent);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.22);
}

/* Code d'activation et code à 6 chiffres : chiffres espacés, lecture au
   caractère près quand on recopie depuis un e-mail ou une étiquette. */
.cx-champ input.cx-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 21px;
  letter-spacing: 4px;
  text-align: center;
}

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.cx-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: linear-gradient(135deg, var(--cx-accent-2), var(--cx-accent));
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.14s ease, transform 0.08s ease;
}

.cx-btn:hover:not(:disabled)  { filter: brightness(1.1); }
.cx-btn:active:not(:disabled) { transform: translateY(1px); }
.cx-btn:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.85); outline-offset: 2px; }
.cx-btn:disabled { opacity: 0.55; cursor: default; }

.cx-lien {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--cx-sourdine);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: center;
}
.cx-lien:hover { color: var(--cx-texte); }
.cx-lien:focus-visible { outline: 2px solid var(--cx-accent); outline-offset: 2px; border-radius: 6px; }
.cx-lien b { color: var(--cx-texte); }

/* ── Messages ────────────────────────────────────────────────────────────
   Posés SOUS le champ concerné et annoncés par aria-live : une erreur
   regroupée en haut d'un formulaire oblige à chercher laquelle est fausse.  */
.cx-msg {
  margin: 12px 0 0;
  padding: 11px 13px;
  font-size: 14.5px;
  line-height: 1.45;
  border-radius: 9px;
}
.cx-msg:empty { display: none; }
.cx-msg.err { color: var(--cx-erreur); background: rgba(255, 107, 107, 0.11); }
.cx-msg.ok  { color: var(--cx-ok);     background: rgba(53, 198, 107, 0.11); }

.cx-pied {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--cx-trait);
  font-size: 12.5px;
  line-height: 1.5;
  color: #6f6f7c;
  text-align: center;
}

/* ── Étapes ──────────────────────────────────────────────────────────────── */
.cx-etape { display: none; }
.cx-etape.actif { display: block; animation: cx-entre 0.22s ease both; }

@keyframes cx-entre {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

/* Fil d'étapes de l'inscription : on sait où on en est et combien il reste. */
.cx-fil { display: flex; gap: 7px; margin-bottom: 22px; }
.cx-fil span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
}
.cx-fil span.fait { background: var(--cx-accent); }

/* ── Attente ─────────────────────────────────────────────────────────────── */
.cx-btn.occupe { position: relative; color: transparent; }
.cx-btn.occupe::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 19px; height: 19px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cx-tourne 0.7s linear infinite;
}
@keyframes cx-tourne { to { transform: rotate(360deg); } }

/* ⚠️ Respecter le réglage système : une animation en boucle peut déclencher
   des troubles vestibulaires, et certains utilisateurs la désactivent. */
@media (prefers-reduced-motion: reduce) {
  .cx-etape.actif { animation: none; }
  .cx-btn.occupe::after { animation-duration: 2.4s; }
}

/* ── Petits écrans ───────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #cx-ecran { padding: 0; align-items: stretch; }
  .cx-carte {
    max-width: none;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    padding: 30px 22px;
  }
}

/* ── RSKTV_COMPTE_WEB (26/10/2026) : formules, retour de paiement ─────────
   Les deux formules sont des cartes NEUTRES : sur cet écran il n'y a pas
   d'action principale unique, c'est le choix du client. L'accent ne marque
   que la carte survolée ou au focus (un seul accent visible à la fois). */
.cx-offres { display: flex; gap: 12px; margin: 4px 0 6px; }
.cx-offre {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 120px;
  padding: 18px 16px;
  font-family: inherit;
  text-align: left;
  color: var(--cx-texte);
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid var(--cx-trait);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}
.cx-offre:hover:not(:disabled),
.cx-offre:focus-visible { border-color: var(--cx-accent); background: rgba(229, 9, 20, 0.08); outline: none; }
.cx-offre:disabled { opacity: 0.6; cursor: default; }
.cx-o-nom  { font-size: 15px; font-weight: 600; color: var(--cx-sourdine); }
.cx-o-prix { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; min-height: 34px; }
.cx-o-det  { font-size: 13.5px; color: var(--cx-sourdine); }
.cx-offre.occupe .cx-o-prix { opacity: 0.4; }

.cx-code-bloc { margin-top: 6px; }
.cx-code-bloc[hidden] { display: none; }
/* Bouton secondaire : contour seulement, pour ne pas concurrencer les formules. */
.cx-btn.cx-btn-second {
  color: var(--cx-texte);
  background: transparent;
  border: 1.5px solid var(--cx-trait);
}
.cx-btn.cx-btn-second:hover:not(:disabled) { border-color: var(--cx-texte); filter: none; }

.cx-qui { margin: 18px 0 0; font-size: 13.5px; color: var(--cx-sourdine); text-align: center; }
.cx-qui:empty { display: none; }
.cx-fil[hidden], .cx-btn[hidden] { display: none; }

.cx-roue {
  width: 34px; height: 34px;
  margin: 8px auto 18px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--cx-texte);
  border-radius: 50%;
  animation: cx-tourne 0.8s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .cx-roue { animation-duration: 2.4s; } }
@media (max-width: 480px) { .cx-offres { flex-direction: column; } .cx-offre { min-height: 0; } }

/* Centrage « sûr » : align-items:center pousse vers le HAUT une carte plus grande
   que la fenêtre (portable 768 px, écran des formules), et ce haut devient
   inatteignable. margin:auto centre quand il y a la place, et sinon colle la carte
   en haut, défilable. border-box : 440 px de large au total, comme écrit. */
#cx-ecran { align-items: flex-start; }
#cx-ecran .cx-carte { margin: auto; box-sizing: border-box; flex-shrink: 0; }

/* Écrans peu hauts (portables, fenêtre non maximisée) : la carte tient sans défiler.
   On ne réduit QUE les blancs ; tailles de texte et cibles de 48 px inchangées. */
@media (max-height: 860px) {
  #cx-ecran { padding-top: 16px; padding-bottom: 16px; }
  .cx-carte { padding: 24px 32px 18px; }
  .cx-marque { margin-bottom: 14px; }
  .cx-marque img { width: 84px; }
  .cx-sous { margin-bottom: 16px; }
  .cx-champ { margin-bottom: 12px; }
  .cx-lien { margin-top: 6px; padding: 8px; }
  .cx-pied { margin-top: 12px; padding-top: 12px; }
  .cx-fil { margin-bottom: 14px; }
}

/* ── Fournisseur qui refuse le relais (29/10/2026) : renvoi vers les applications ── */
#splash-msg .boot-err-web { margin-top: 14px; }
#splash-msg .boot-err-web-t { font-size: 26px; color: rgba(255,255,255,0.78); line-height: 1.45; }
#splash-msg .boot-err-web-l { display: inline-block; margin-top: 16px; font-size: 26px; color: #ffffff;
  text-decoration: underline; text-underline-offset: 6px; }
#splash-msg .boot-err-web-l:hover, #splash-msg .boot-err-web-l:focus { color: rgba(255,255,255,0.85); }
