/* ÉCRAN D'OUVERTURE ET PAGE D'INSCRIPTION — apparence (14 octobre 2026)
   1. .demarrage : l'écran d'ouverture de l'application (4 secondes) : fond uni, logo, nom, effets, barre de chargement.
   2. .acces : la page d'inscription (courriel → bienvenue), affichée après l'écran d'ouverture tant que le visiteur
      ne s'est pas inscrit sur cet appareil. */

/* ---------- 1. Écran d'ouverture (4 secondes, fond uni) ---------- */
body.demarrage-en-cours { overflow: hidden; }
body.demarrage-en-cours > *:not(.demarrage) { visibility: hidden; }   /* interface vide derrière l'écran d'ouverture */
.demarrage {
  position: fixed; inset: 0; z-index: 3000; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #101725; color: #FFFFFF;                                 /* FOND UNI : la couleur du site */
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
.demarrage[hidden] { display: none; }
.demarrage.sortie { animation: dem-sortie .45s cubic-bezier(.4, 0, .2, 1) forwards; }
@keyframes dem-sortie { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06); } }

/* 0,0 s : un éclat doré part du centre et s'évanouit */
.dem-eclair { position: absolute; width: 40vmin; height: 40vmin; border-radius: 50%; background: radial-gradient(circle, rgba(255, 190, 0, .55) 0%, transparent 65%);
              opacity: 0; animation: dem-eclair .7s ease-out .05s forwards; }
@keyframes dem-eclair { 0% { opacity: 0; transform: scale(.2); } 35% { opacity: .9; } 100% { opacity: 0; transform: scale(3.2); } }

/* 0,2 s : deux anneaux dorés qui s'élargissent (une seule fois chacun) */
.dem-anneau { position: absolute; width: 180px; height: 180px; border-radius: 50%; border: 2px solid rgba(255, 190, 0, .55); opacity: 0; }
.dem-anneau-1 { animation: dem-anneau 1.3s ease-out .25s forwards; }
.dem-anneau-2 { animation: dem-anneau 1.3s ease-out .55s forwards; }
@keyframes dem-anneau { 0% { opacity: .9; transform: scale(.5); } 100% { opacity: 0; transform: scale(2.6); } }

/* 0,1 s : le logo surgit avec un rebond, puis respire doucement avec son halo */
.dem-logo {
  position: relative; z-index: 2; width: 128px; aspect-ratio: 187 / 200; opacity: 0;
  background: var(--logo) center / contain no-repeat;
  filter: drop-shadow(0 0 22px rgba(255, 190, 0, .55)) drop-shadow(0 10px 24px rgba(0, 0, 0, .5));
  animation: dem-logo .75s cubic-bezier(.34, 1.56, .64, 1) .1s forwards, dem-respire 1.6s ease-in-out .9s infinite alternate;
}
@keyframes dem-logo { 0% { opacity: 0; transform: scale(.2) rotate(-14deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes dem-respire { 0% { filter: drop-shadow(0 0 16px rgba(255, 190, 0, .4)) drop-shadow(0 10px 24px rgba(0, 0, 0, .5)); } 100% { filter: drop-shadow(0 0 34px rgba(255, 190, 0, .8)) drop-shadow(0 10px 24px rgba(0, 0, 0, .5)); } }

/* 0,8 s : trait doré qui se déploie, puis le nom et le slogan montent */
.dem-trait { position: relative; z-index: 2; width: 0; height: 2px; margin: 18px 0 12px; background: linear-gradient(90deg, transparent, #FFBE00, #FFBE00, transparent);
             animation: dem-trait .45s ease-out .8s forwards; }
@keyframes dem-trait { to { width: 200px; } }
.dem-nom, .dem-slogan { position: relative; z-index: 2; text-align: center; opacity: 0; transform: translateY(14px); }
.dem-nom { font-size: clamp(1.9rem, 8vw, 2.5rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; white-space: nowrap; animation: dem-monte .5s cubic-bezier(.22, 1, .36, 1) 1s forwards; }
.dem-nom span { color: #FFBE00; text-shadow: 0 0 22px rgba(255, 190, 0, .45); }
.dem-slogan { margin-top: 9px; color: #C9D3E6; font-size: clamp(0.95rem, 3.8vw, 1.15rem); animation: dem-monte .45s ease-out 1.3s forwards; }
@keyframes dem-monte { to { opacity: 1; transform: translateY(0); } }

/* barre de chargement : 4 secondes pile (0,3 s d'attente + 3,6 s de remplissage) */
.dem-barre { position: absolute; bottom: 64px; width: 140px; height: 3px; border-radius: 2px; overflow: hidden; background: rgba(255, 255, 255, .08); opacity: 0; animation: dem-monte .3s ease-out .3s forwards; }
.dem-barre i { display: block; width: 0; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #FFBE00, #FFD966, #FFBE00); background-size: 200% 100%;
               animation: dem-charge 3.6s cubic-bezier(.4, 0, .2, 1) .3s forwards, dem-brille 1.2s linear infinite; }
@keyframes dem-charge { to { width: 100%; } }
@keyframes dem-brille { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  .demarrage *, .demarrage::before { animation-duration: .01s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .dem-logo { opacity: 1; } .dem-trait { width: 200px; } .dem-nom, .dem-slogan { opacity: 1; transform: none; }
}

/* ---------- 2. Page d'inscription ---------- */
body.acces-ouvert { overflow: hidden; }
.acces {
  position: fixed; inset: 0; z-index: 2000; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; align-items: center; padding: 0 16px 28px;
  background: #101725; color: #FFFFFF;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
.acces[hidden] { display: none; }
.acces-marque { display: flex; align-items: center; gap: 12px; margin: 26px 0 18px; }
.acces-marque .logo { width: clamp(40px, 12vw, 54px); }
.acces-marque b { font-size: clamp(1.3rem, 6.6vw, 1.7rem); white-space: nowrap; font-weight: 800; letter-spacing: -0.01em; }
.acces-marque b span { color: #FFBE00; }
.acces-carte { width: 100%; max-width: 420px; padding: 22px 20px 20px; border-radius: 18px; background: #141B2B; border: 1px solid #2B3550; box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.acces-etapes { display: flex; gap: 6px; margin-bottom: 16px; }
.acces-etapes i { flex: 1; height: 4px; border-radius: 4px; background: #2B3550; }
.acces-etapes i.fait { background: #FFBE00; }
.acces h1 { margin: 0 0 8px; font-size: 1.45rem; line-height: 1.2; font-weight: 800; color: #FFBE00; }
.acces p { margin: 0 0 14px; color: #C9D3E6; line-height: 1.45; font-size: 0.98rem; }
.acces p b { color: #FFFFFF; overflow-wrap: anywhere; }
.acces label.champ { display: block; margin-bottom: 6px; font-weight: 700; font-size: 0.92rem; }
.acces input[type=email] { width: 100%; padding: 14px 14px; border-radius: 12px; border: 2px solid #2B3550; background: #0C1220; color: #FFFFFF; font: inherit; font-size: 1.05rem; }
.acces input:focus-visible, .acces button:focus-visible { outline: 3px solid #FFBE00; outline-offset: 2px; }
.acces-accord { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; color: #C9D3E6; font-size: 0.86rem; line-height: 1.4; }
.acces-accord input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; accent-color: #FFBE00; }
.acces-erreur { min-height: 1.3em; margin: 6px 0 8px; color: #FF8A8A; font-size: 0.88rem; font-weight: 600; }
.acces-principal { width: 100%; padding: 14px; border: 0; border-radius: 12px; cursor: pointer; background: #FFBE00; color: #101725; font-family: inherit; font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.acces-principal:hover { background: #FFCB33; }
.acces-ok { width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 50%; display: grid; place-items: center; background: #123524; border: 2px solid #4ADE80; }
.acces-ok svg { width: 30px; height: 30px; }
.acces-centre { text-align: center; }
.acces-pied { max-width: 420px; margin-top: 16px; color: #8090AD; font-size: 0.78rem; line-height: 1.4; text-align: center; }
.acces-avantages { display: grid; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; color: #C9D3E6; font-size: 0.92rem; }
.acces-avantages li { display: flex; gap: 8px; align-items: baseline; }
.acces-avantages li::before { content: "✓"; color: #4ADE80; font-weight: 800; }

/* Page d'inscription : écran du code (5 cases), liens, mentions, bouton en attente, bandeau de l'aperçu */
.acces-essai { width: 100vw; margin: 0 -16px; padding: 7px 14px; background: #3A2A00; color: #FFD24D; font-size: 0.8rem; line-height: 1.35; text-align: center; }
.acces-liens { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; }
.acces-liens button { padding: 4px 0; border: 0; background: none; cursor: pointer; color: #A9B8D3; font-family: inherit; font-weight: 600; font-size: 0.88rem; line-height: 1.2; text-decoration: underline; }
.acces-code { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 4px 0 2px; }
.acces-code input { width: 100%; min-width: 0; padding: 12px 0; text-align: center; border-radius: 12px; border: 2px solid #2B3550; background: #0C1220; color: #FFFFFF; font-family: inherit; font-weight: 800; font-size: 1.5rem; line-height: 1; text-transform: uppercase; }
.acces-demo { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; border: 1px dashed #FFD24D; color: #FFD24D; font-size: 0.86rem; line-height: 1.4; }
.acces-demo b { color: #FFD24D; font-size: 1.15rem; letter-spacing: 0.18em; }
.acces-info { min-height: 1.3em; margin: 0 0 8px; color: #4ADE80; font-size: 0.88rem; font-weight: 600; }
.acces-info:empty { display: none; }
.acces-petit { margin: 14px 0 0; color: #8090AD; font-size: 0.8rem; line-height: 1.4; }
.acces-principal:disabled, .acces-principal.attente { opacity: .6; cursor: wait; }

/* ---------- La page d'accès tient sur UN écran de téléphone, sans défiler (demande du 15 oct. 2026) ----------
   Tout est centré verticalement ; sur un écran bas, les écritures et les espaces rapetissent. */
.acces { justify-content: center; padding: 10px 26px 12px; min-height: 100dvh; }          /* marges de côté plus larges : la carte et son contour se voient bien (demande du 20 oct.) */
.acces-marque { margin: 6px 0 10px; gap: 10px; }
.acces-marque .logo { width: clamp(34px, 9vw, 44px); }
.acces-marque b { font-size: clamp(1.15rem, 5.6vw, 1.45rem); }
.acces-carte { padding: 14px 16px 14px; border-radius: 16px; max-width: 380px; border: 1.5px solid #3B486B; }
.acces-etapes { margin-bottom: 10px; }
.acces h1 { font-size: clamp(1.15rem, 5.2vw, 1.35rem); margin-bottom: 6px; }
.acces p { margin-bottom: 10px; font-size: 0.92rem; line-height: 1.35; }
.acces-avantages { gap: 3px; margin-bottom: 10px; font-size: 0.86rem; }
.acces label.champ { margin-bottom: 4px; font-size: 0.86rem; }
.acces input[type=email] { padding: 11px 12px; font-size: 1rem; }
.acces-accord { margin: 8px 0 0; font-size: 0.8rem; line-height: 1.3; }
.acces-erreur { min-height: 0; margin: 4px 0 6px; font-size: 0.82rem; }
.acces-erreur:empty { margin: 4px 0 4px; }
.acces-principal { padding: 12px; font-size: 1rem; }
.acces-petit { margin: 8px 0 0; font-size: 0.74rem; line-height: 1.3; }
.acces-liens { margin-top: 8px; }
.acces-liens button { font-size: 0.82rem; }
.acces-code input { padding: 10px 0; font-size: 1.35rem; }
.acces-ok { width: 54px; height: 54px; margin: 2px auto 10px; }
.acces-pied { margin-top: 10px; font-size: 0.72rem; line-height: 1.3; }
.acces-essai { margin: -10px -14px 8px; width: auto; font-size: 0.74rem; padding: 5px 10px; }
/* petit téléphone ou peu de hauteur : encore plus serré */
@media (max-height: 700px) {
  .acces-marque { margin: 2px 0 6px; } .acces-marque .logo { width: 30px; } .acces-marque b { font-size: 1.1rem; }
  .acces-carte { padding: 10px 14px 10px; } .acces h1 { font-size: 1.08rem; } .acces-avantages { font-size: 0.8rem; gap: 2px; margin-bottom: 8px; }
  .acces-accord { font-size: 0.74rem; } .acces input[type=email] { padding: 9px 12px; } .acces-principal { padding: 10px; font-size: 0.95rem; }
  .acces-petit { font-size: 0.7rem; margin-top: 6px; } .acces-pied { font-size: 0.68rem; margin-top: 6px; }
}
@media (max-height: 580px) { .acces-avantages, .acces-pied { display: none; } }
