/* Le parcours : l'entrée, l'attente, la caisse, le retour.

   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, caisse */

.porte-voile, .caisse-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, .caisse-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, .caisse-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; }

/* La caisse */
.caisse-formules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 18px;
}
.caisse-formule {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: border-color var(--snap), background var(--snap), box-shadow var(--snap), translate var(--snap);
}
.caisse-formule:hover { translate: 0 -1px; border-color: var(--line-strong); }
.caisse-formule.on {
  border-color: var(--accent);
  background: var(--paper);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
.caisse-formule:disabled { opacity: 0.45; cursor: not-allowed; }
.caisse-nom { font-size: 12px; color: var(--ink-soft); letter-spacing: 0.04em; text-transform: uppercase; }
.caisse-prix { font-family: var(--serif); font-size: 28px; line-height: 1.05; color: var(--ink); margin-top: 4px; }
.caisse-duree { font-size: 13px; color: var(--ink); }
.caisse-pour { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.caisse-badge {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.caisse-gages {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.caisse-gages li {
  position: relative;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}
.caisse-gages li b { color: var(--ink); font-weight: 600; }
.caisse-gages li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 6px;
  width: 11px;
  height: 6px;
  border-left: 1.5px solid var(--ok);
  border-bottom: 1.5px solid var(--ok);
  rotate: -45deg;
}
.caisse-renonciation {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--raise);
  border-radius: var(--radius-lg);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
  cursor: pointer;
}
.caisse-renonciation input { margin-top: 3px; flex: none; width: 16px; height: 16px; accent-color: var(--accent); }
.caisse-payer {
  width: 100%;
  padding: 15px 20px;
  font-size: 12.5px;
  border-radius: 999px;
}
.caisse-payer:disabled { opacity: 0.55; cursor: not-allowed; }
.caisse-fine { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.caisse-fine a { color: var(--ink-soft); text-decoration: underline; }
.caisse-etat { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); text-align: center; }
.caisse-etat[data-ton="bad"] { color: var(--bad); }
.caisse-etat[hidden] { display: none; }

/* 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); }

/* 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%; }
  .caisse-formules { grid-template-columns: 1fr; }
  .caisse-formule { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
  .caisse-prix { margin-top: 0; margin-left: auto; }
  .porte-boite, .caisse-boite { padding: 24px 20px 22px; }
}
