/* Le parcours : l'entrée, l'attente, le retour de Stripe.
   Les formules et le paiement vivent dans l'écran partagé de tel-chargeur.js.

   Tout est écrit avec les jetons de jetons.css (via app.css) : mêmes bleus, mêmes
   papiers, mêmes durées. Une fenêtre de paiement d'une autre couleur que le reste du
   site est exactement ce à quoi ressemble une page d'hameçonnage. */

/* ------------------------------------------------------------- l'entrée */

.entree {
  margin-top: 36px;
  max-width: 520px;
  opacity: 0;
  translate: 0 14px;
  transition: opacity var(--gentle), translate var(--gentle);
}
#view-home.ready .entree { opacity: 1; translate: 0; transition-delay: 0.56s; }
.entree[hidden] { display: none; }
.entree.is-pop { animation: entree-pop 0.5s var(--gentle); }
@keyframes entree-pop {
  0% { scale: 1; }
  40% { scale: 1.02; }
  100% { scale: 1; }
}

.entree-champ {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow);
  transition: border-color var(--snap), box-shadow var(--snap);
}
.entree-champ:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash), var(--shadow);
}
.entree-champ input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 12px 16px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}
.entree-champ input::placeholder { color: var(--muted); }
.entree-champ .primary {
  flex: none;
  margin: 0;
  border-radius: 999px;
  padding: 13px 22px;
}
.entree-mention {
  margin: 12px 4px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}
.entree-mention a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.entree-etat {
  margin: 10px 4px 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.entree-etat[data-ton="bad"] { color: var(--bad); }
.entree-etat[hidden] { display: none; }
.entree-essai {
  margin: 14px 4px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.entree-essai:hover { color: var(--accent); }

/* ------------------------------------------------------------ l'attente */

.attente {
  margin-top: 36px;
  max-width: 520px;
  padding: 22px 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  animation: attente-entre 0.42s var(--gentle);
}
.attente[hidden] { display: none; }
@keyframes attente-entre {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0; }
}
.attente-titre {
  font-family: var(--serif);
  font-size: 26px;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 8px;
}
.attente-texte {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.55;
}
.attente-texte b { color: var(--ink); font-weight: 600; word-break: break-all; }
.attente-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-top: 16px;
}
.attente-boite {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--snap);
}
.attente-boite:hover { background: var(--accent-hover); }
.attente-boite[hidden] { display: none; }
.attente-actions button.text { font-size: 11.5px; }
.attente-etat {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
}
.attente-point {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: attente-pulse 1.4s ease-in-out infinite;
}
.attente-point.grand { width: 14px; height: 14px; margin: 0 auto 14px; display: block; }
@keyframes attente-pulse { 50% { opacity: 0.3; scale: 0.8; } }
.attente.est-connectee .attente-point { background: var(--ok); animation: none; }
.attente.est-expiree .attente-point { background: var(--warn); animation: none; }
.attente-dev { margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.attente-dev a { color: var(--accent); text-decoration: underline; }

/* ------------------------------------------- les fenêtres : porte, retour */

.porte-voile, .retour-voile {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 27, 61, 0.48);
  backdrop-filter: blur(4px);
  animation: voile-entre var(--ui) both;
}
@keyframes voile-entre { from { opacity: 0; } to { opacity: 1; } }
.porte-boite, .retour-boite {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px 30px 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(12, 27, 61, 0.28);
  animation: boite-entre var(--gentle) both;
}
@keyframes boite-entre {
  from { opacity: 0; translate: 0 16px; scale: 0.985; }
  to { opacity: 1; translate: 0; scale: 1; }
}
.porte-boite .entree, .porte-boite .attente { margin-top: 18px; max-width: none; opacity: 1; translate: 0; }
.porte-fermer {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}
.porte-fermer:hover { background: var(--raise); color: var(--ink); }
.porte-eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.porte-boite h3, .retour-boite h3 {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.porte-sous { color: var(--ink-soft); font-size: 14px; line-height: 1.55; }

/* Le retour de Stripe */
.retour-boite { width: min(460px, 100%); text-align: center; padding: 34px 30px 30px; }
.retour-boite p { color: var(--ink-soft); font-size: 14px; line-height: 1.55; }
.retour-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 18px; }
.retour-actions[hidden] { display: none; }
.retour-actions .text { font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }

/* Payé : la suite dans l'app */
.app-boite { display: grid; justify-items: center; gap: 14px; padding: 40px 32px 24px; background: var(--paper); border: 0; border-radius: 28px; }
.app-boite h3 { margin: 6px 0 0; font-size: clamp(25px, 7vw, 30px); text-wrap: balance; }
.app-boite > p { margin: 0; max-width: 32ch; }
.app-icone { width: 44px; height: auto; animation: boite-entre var(--gentle) both; }
.app-etapes { list-style: none; margin: 10px 0 8px; padding: 0; width: 100%; display: grid; text-align: left; border-top: 1px solid var(--line); }
.app-etapes li { display: flex; align-items: center; gap: 14px; padding: 13px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px; color: var(--ink); }
.app-etapes b { flex: none; width: 18px; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 17px; color: var(--muted); }
.app-etapes em { font-style: normal; font-weight: 600; word-break: break-all; }
.app-store { display: inline-flex; align-items: center; gap: 10px; padding: 11px 26px 11px 20px; border-radius: 14px; background: #000; color: #fff; text-decoration: none; margin-top: 6px; }
.app-store span { display: grid; text-align: left; font-size: 20px; font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; }
.app-store small { font-size: 11px; font-weight: 400; letter-spacing: 0; }
.app-qr { margin: 2px 0 0; display: grid; justify-items: center; gap: 6px; }
.app-qr img { width: 116px; height: 116px; }
.app-qr figcaption { font-size: 12px; color: var(--muted); }
.app-boite .app-plus-tard { background: none; border: 0; padding: 6px; font-size: 13px; letter-spacing: 0; text-transform: none; color: var(--muted); }
.app-boite .app-plus-tard:hover { color: var(--ink); }

/* La ligne à relier, juste après un premier lancement */
.compte-relier {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--accent-wash);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
}
.compte-relier b { color: var(--accent); }

/* Un mot, en bas, qui s'efface tout seul */
.parcours-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 230;
  translate: -50% 0;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(12, 27, 61, 0.25);
  animation: toast-entre var(--ui) both;
}
.parcours-toast.ok { background: var(--ok); }
.parcours-toast[hidden] { display: none; }
@keyframes toast-entre { from { opacity: 0; translate: -50% 8px; } to { opacity: 1; translate: -50% 0; } }

@media (max-width: 640px) {
  .entree-champ { flex-direction: column; border-radius: 18px; padding: 8px; }
  .entree-champ .primary { width: 100%; }
  .porte-boite { padding: 24px 20px 22px; }
}
