/* Pages de compte en plein écran (31-10, « ça claque pas assez ») : tout l'écran est la scène. Fond vert-de-gris liquide (01-11, avant orange)
   (liquide.js), titre géant, objet héros (téléphone ou carte 3D), formulaire en panneau net à droite.
   Jetons de bm.css ; la page d'état garde sa coque. */

.page-scene { display: block; place-items: normal; padding: 0; min-height: 100vh; min-height: 100dvh; overflow-x: hidden;
  background: radial-gradient(120% 90% at 20% 0%, #7aa79b, #4f7d72 45%, #2a463f); }
.liquide { position: fixed; inset: 0; z-index: 0; width: 100%; height: 100%; opacity: 0; transition: opacity 1.4s ease; }
.liquide.pret { opacity: 1; }

.ecran-plein { position: relative; z-index: 1; width: 100%; min-height: 100vh; min-height: 100dvh; display: grid;
  grid-template-columns: minmax(0, 940px) minmax(380px, 460px); justify-content: center; gap: 40px; padding: 24px 24px 24px 48px; }
/* Grand écran (31-10) : le cadre vient au centre, collé au téléphone (connexion) ou à la carte (paiement),
   au lieu de filer au bord droit. */
.heros { position: relative; display: flex; flex-direction: column; gap: 28px; min-width: 0; padding-top: 4px; }
.heros .marque { box-shadow: var(--ds-ombre-1); }
/* 01-11 (passe Apple) : tracking d'Inter à cette taille (−0,022 em, sa table dynamique), interligne 1,02 comme le titre
   d'Apple (96/96) ; l'entrée n'anime que opacité et position. */
.geant { margin: 0; font: 700 clamp(46px, 6.3vw, 108px)/1.02 var(--ds-police); letter-spacing: -.022em; color: #f6fbf9;
  text-wrap: balance; animation: geant-entre 1s cubic-bezier(.16, 1, .3, 1) both; }
.geant em { display: block; font-style: normal; color: #cfe6df; text-shadow: none; }
/* Lisibilité sur la lave qui bouge : une ombre large et douce derrière le texte clair de la scène */
.geant, .geant-sous, .atouts li { text-shadow: var(--ds-ombre-texte); }
@keyframes geant-entre { from { opacity: 0; transform: translateY(28px); } }

/* Voile sous le texte (01-11, landing et pages de compte) : en thème clair, les éclats les plus clairs de la lave descendaient
   sous 4,5:1 derrière le texte blanc (~6 % des pixels). Un aplat vert nuit flouté (.45) sous chaque bloc de texte
   garde 4,5:1 sur le pixel le plus clair (5,23:1 mesuré) sans toucher la lave ailleurs. Thème sombre : inutile. */
.voile { position: relative; }
.voile:empty::before { display: none; }   /* titre du paiement pas encore rempli : pas de voile à vide */
@media (prefers-color-scheme: light) {
  /* aplat flouté : plein (≈ 98 %) jusqu'au bord du texte, fondu sur les 40 px au-delà */
  .voile::before { content: ""; position: absolute; z-index: -1; inset: -40px; border-radius: 64px; pointer-events: none;
    background: rgba(16, 38, 33, .45); filter: blur(20px); }
}
@media (prefers-color-scheme: light) and (prefers-reduced-transparency: reduce) {
  .voile::before { background: rgba(16, 38, 33, .6); }
}

/* Le panneau du formulaire : net, posé sur la lave */
.panneau { position: relative; align-self: center; border-radius: var(--ds-r-xl); padding: 44px 40px;
  box-shadow: var(--ds-ombre-2), 0 0 0 1px rgba(255, 255, 255, .06); }

/* Téléphone : il tient dans la hauteur restante, penché, il suit la souris (connexion.js pose --rx, --ry) */
.tel-zone { --tel-l: clamp(210px, min(19vw, 28.5vh), 290px); position: relative; flex: 1; display: flex; align-items: center;
  justify-content: space-between; gap: 24px; padding-right: 7%; perspective: 1600px; min-height: calc(var(--tel-l) * 2.05 + 20px); }
/* Connexion, grand écran (31-10, « le téléphone et le cadre ne sont pas du tout assez centrés ») : la paire
   téléphone + cadre se pose au milieu de l'écran. 3ᵉ colonne vide à droite = largeur de la colonne héros moins
   le téléphone, son retrait et l'écart (520 − 60 − 40) : le bloc centré, la paire l'est aussi. Le titre suit la
   largeur de sa colonne pour tenir en deux lignes. Plus étroit : la colonne vide rétrécit d'abord. */
@media (min-width: 1400px) {
  .ecran-plein:not(:has(> .heros-paiement)) { --tel-l: clamp(210px, min(19vw, 28.5vh), 290px); padding-left: 24px;
    grid-template-columns: calc(var(--tel-l) + 520px) 460px minmax(0, 420px);
    /* titre : deux lignes qui tiennent dans la colonne héros (11,4 % de sa largeur) */
    --titre: min(clamp(46px, 6.3vw, 108px), calc(.114 * (var(--tel-l) + 520px)));
    /* 31-10 (« il est un peu trop bas par rapport au cadre », puis choix au QCM « Cadre au niveau du téléphone ») :
       le téléphone remonte vers le milieu de l'écran sans passer sous le titre (8 px gardés) ; ce qui lui manque,
       le cadre le descend : leurs centres au même niveau. --monter-tout = ce qu'il faudrait pour le milieu exact. */
    --monter-tout: calc((108px + 1.86 * var(--titre)) / 2);
    --monter: max(0px, min(var(--monter-tout), (100dvh - 156px - 1.86 * var(--titre) - 2.05 * var(--tel-l)) / 2 + 20px)); }
  .heros:not(.heros-paiement) .geant { font-size: var(--titre, clamp(46px, 6.3vw, 108px)); }   /* sans :has, la taille d'avant */
  .heros:not(.heros-paiement) .tel-zone { padding-right: 60px; }
  .heros:not(.heros-paiement) .tel-3d { translate: 0 calc(-1 * var(--monter)); }
  /* écran bas : le cadre (≈ 590 px) ne descend jamais sous le bord (marge de 24 px gardée) */
  .ecran-plein:not(:has(> .heros-paiement)) > .panneau { translate: 0 max(0px, min(var(--monter-tout) - var(--monter), 50dvh - 320px)); }
}
/* Trois promesses en bas à gauche, en face du téléphone */
.atouts { align-self: flex-end; list-style: none; margin: 0 auto 4% 0; padding: 0; display: grid; gap: 16px;
  animation: geant-entre 1s .3s cubic-bezier(.16, 1, .3, 1) both; }
.atouts li { display: flex; align-items: baseline; gap: 14px; font: 600 clamp(17px, 1.45vw, 21px)/1.25 var(--ds-police);
  letter-spacing: -.017em; color: #f6fbf9; }
.atouts span { font: 600 12px/1 var(--ds-police); color: #cfe6df; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.tel-3d { position: relative; transform-style: preserve-3d; will-change: transform;
  transform: rotateX(var(--rx, 6deg)) rotateY(var(--ry, -16deg)) rotateZ(2deg);
  animation: tel-entre 1.2s .15s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes tel-entre { from { opacity: 0; translate: 0 60px; } }
.tel { width: var(--tel-l); height: calc(var(--tel-l) * 2.05); padding: calc(var(--tel-l) * .038); border-radius: calc(var(--tel-l) * .19);
  background: linear-gradient(150deg, #34343a, #0b0b0d 45%, #1c1c20);
  box-shadow: inset 0 0 0 1.5px #4a4a52, inset 0 0 0 5px #0c0c0e, var(--ds-ombre-3); }
.tel-ecran { position: relative; height: 100%; display: flex; flex-direction: column; overflow: hidden;
  border-radius: calc(var(--tel-l) * .155); background: #fff; color: #000; font-family: var(--ds-police); }
.tel-ilot { position: absolute; z-index: 2; top: 9px; left: 50%; width: 32%; height: 25px; border-radius: 20px; background: #000; translate: -50% 0; }
/* comme iOS : l'heure et les icônes centrées chacune dans une « oreille » de part et d'autre de l'îlot (32 %) */
.tel-barre { flex: none; height: 44px; display: grid; grid-template-columns: 1fr 32% 1fr; align-items: center; padding-top: 4px;
  font: 600 13.5px/1 var(--ds-police); }
.tel-barre b { justify-self: center; }
.tel-icones { grid-column: 3; justify-self: center; display: flex; gap: calc(var(--tel-l) * .02); align-items: center; }
.tel-icones svg { display: block; height: calc(var(--tel-l) * .042); width: auto; }
.tel-icones .ic-batterie { height: calc(var(--tel-l) * .046); }
.ig-tete { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 14px 10px; border-bottom: 1px solid #efefef; }
.ig-tete svg { flex: none; width: 21px; height: 21px; }
.ig-tete svg:nth-of-type(2) { margin-left: auto; }
.ig-qui { display: grid; gap: 2px; min-width: 0; white-space: nowrap; }
.ig-qui b { font: 600 14px/1.1 var(--ds-police); }
.ig-qui span { font-size: 11.5px; color: #8e8e8e; }
.avatar { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(140deg, #dcebe7, #9cc3b8); color: #2f4f47; font: 600 13px/1 var(--ds-police); }
.ig-saisie { flex: none; display: flex; align-items: center; gap: 10px; height: 42px; margin: 6px 10px 14px; padding: 0 6px;
  border: 1px solid #e6e6e6; border-radius: var(--ds-r-lg); color: #8e8e8e; font-size: 13.5px; white-space: nowrap; overflow: hidden; }
.ig-photo { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(140deg, var(--ds-accent-2), var(--ds-accent-fonce)); }

/* Le fil : pile ancrée en bas, les anciennes bulles montent sous le fondu du haut */
.fil { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; overflow: hidden;
  padding: 12px 12px 6px; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%); mask-image: linear-gradient(to bottom, transparent, #000 18%); }
.fil > * { flex: none; transform-origin: left bottom; transition: transform .5s cubic-bezier(.16, 1, .3, 1), opacity .35s ease; }
.fil > .toi { transform-origin: right bottom; }
.fil > :not(.vu) { display: none; }
.fil > .entre { opacity: 0; transform: translateY(12px) scale(.9); }
.fil > .sort, .notif.sort { opacity: 0; }
.bulle { max-width: 80%; }
.bulle p { margin: 0; padding: 8px 12px; border-radius: 19px; font: 400 13.5px/1.32 var(--ds-police); }
.bulle.lui { align-self: flex-start; }
.bulle.lui p { background: #efefef; color: #000; }
.bulle.toi { align-self: flex-end; }
.bulle.toi p { background: linear-gradient(160deg, #5a8a7e, #365a51); color: #fff; }
.bulle.lui + .bulle.toi, .bulle.toi + .bulle.lui { margin-top: 6px; }
.frappe .points { display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 19px; background: #efefef; }
.frappe i { width: 6px; height: 6px; border-radius: 50%; background: #9b9b9b; animation: frappe 1.1s ease-in-out infinite; }
.frappe:not(.vu) i { animation: none; }   /* l'indicateur ne tourne que pendant qu'il est à l'écran */
.frappe i:nth-child(2) { animation-delay: .15s; }
.frappe i:nth-child(3) { animation-delay: .3s; }
@keyframes frappe { 30% { transform: translateY(-3px); background: #5c5c5c; } 60% { transform: none; } }

/* Texte du téléphone et de la notification : tracking d'Inter vers 13–15 px (la page porte -0,009 em, trop serré ici) */
.tel, .notif { letter-spacing: -.004em; }

/* La notification de Business Manager jaillit hors du téléphone, devant lui */
.notif { position: absolute; left: calc(var(--tel-l) * -.62); bottom: 21%; width: min(340px, calc(var(--tel-l) * 1.25)); display: flex;
  align-items: center; gap: 12px; padding: 12px 14px 12px 12px; border-radius: var(--ds-r-lg); color: #141414;
  /* Matière d'une notification iOS, presque pleine : dans un contexte 3D le flou d'arrière-plan ne s'applique pas,
     un verre transparent laisserait lire les bulles à travers. Arête haute éclairée. */
  background: rgba(255, 252, 250, .98);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), var(--ds-ombre-2), 0 0 0 1px rgba(0, 0, 0, .05);
  transform-origin: 85% 50%;   /* elle naît du téléphone, à sa droite */
  transform: translate3d(calc(var(--tel-l) * .5), 26px, 0) scale(.6); opacity: 0; pointer-events: none;
  transition: transform .8s cubic-bezier(.16, 1, .3, 1), opacity .4s ease; }
.notif.vu { transform: translate3d(0, 0, 110px); opacity: 1; }
.notif img { flex: none; width: 40px; height: 40px; border-radius: var(--ds-r-sm); box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); }
.notif-texte { flex: 1; display: grid; gap: 2px; min-width: 0; }
.notif-texte small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 500 11px/1.2 var(--ds-police); color: #8a8a8a; text-transform: uppercase; letter-spacing: .04em; }
.notif-texte b { font: 600 15px/1.2 var(--ds-police); letter-spacing: -.009em; }
.notif-texte > span { font: 400 13px/1.25 var(--ds-police); color: #555; }
.rdv-coche { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ds-vert);
  color: #fff; transform: scale(0); transition: transform .5s .45s cubic-bezier(.16, 1, .3, 1); }
.rdv-coche svg { width: 15px; height: 15px; }
.notif.vu .rdv-coche { transform: none; }

@media (prefers-color-scheme: dark) {
  .page-scene { background: radial-gradient(90% 80% at 25% 40%, #12241f, #040706 70%); }
  .geant em, .atouts span { color: var(--ds-accent-2); }
  .tel-ecran { background: #000; color: #fff; }
  .ig-tete { border-color: #1f1f1f; }
  .ig-saisie { border-color: #2a2a2a; }
  .bulle.lui p, .frappe .points { background: #262626; color: #fff; }
  .notif { background: rgba(38, 38, 42, .98); color: #f4f4f5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), var(--ds-ombre-2), 0 0 0 1px rgba(255, 255, 255, .07); }
  .notif-texte > span { color: #a1a1aa; }
}

/* Paiement : la carte 3D occupe la scène sous le titre (fond transparent sur la lave). La scène tient dans
   l'écran et reste en place quand le formulaire, plus haut, défile : sinon la carte se centre sous la ligne
   de flottaison (31-10, grand écran). */
.heros-paiement { position: sticky; top: 24px; align-self: start; height: calc(100vh - 48px); height: calc(100dvh - 48px); }
/* La scène remonte sous le titre (fond transparent) : la carte se tient à mi-hauteur de l'écran, pas en bas */
.heros-paiement .scene3d { position: relative; flex: 1; min-height: 420px; margin: -150px -24px 0 -48px; }
.heros-paiement .scene3d canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.heros-paiement .scene3d canvas:active { cursor: grabbing; }
.heros-paiement .indice { position: absolute; left: 50%; translate: -50% 0; white-space: nowrap; bottom: 8px; z-index: 1; margin: 0; display: flex; gap: 8px;
  align-items: center; justify-content: center; font-size: 13px; color: rgba(255, 255, 255, .9); pointer-events: none; transition: opacity .6s ease; }
.heros-paiement .geant { font-size: clamp(56px, 7.4vw, 128px); }
.geant-sous { margin: -10px 0 0; max-width: 34ch; font: 600 19px/1.4 var(--ds-police); letter-spacing: -.017em; color: #f6fbf9; }

@media (max-width: 980px) {
  .ecran-plein { grid-template-columns: 1fr; gap: 0; padding: 16px 16px 24px; }
  .heros { gap: 18px; }
  .geant { font-size: clamp(38px, 11vw, 64px); }
  .tel-zone { --tel-l: 200px; justify-content: center; padding: 6px 0 0 30%; min-height: 0; }
  .atouts { display: none; }
  .notif { left: calc(var(--tel-l) * -.66); bottom: 14%; width: 250px; padding: 10px 12px 10px 10px; gap: 10px; }
  .notif-texte small { font-size: 9.5px; }
  .ig-tete svg:last-of-type { display: none; }
  .ig-tete { gap: 8px; padding: 4px 12px 8px; }
  .notif img { width: 34px; height: 34px; }
  .notif-texte b { font-size: 14px; }
  .notif-texte > span { font-size: 12px; }
  .panneau { margin-top: 18px; padding: 28px 20px; }
  .geant-sous { font-size: 16px; letter-spacing: -.011em; }
  /* 31-10 (choix au QCM « Formulaire visible d'entrée ») : la scène se resserre pour que le formulaire commence
     dans le premier écran. Connexion : titre à gauche, téléphone en petit à droite (zoom : même dessin, réduit,
     la notification posée sur lui) ; paiement : la carte 3D en bande basse sous le titre, son indice dessous. */
  .heros:not(.heros-paiement) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
  .heros:not(.heros-paiement) > .marque { grid-column: 1 / -1; justify-self: start; }
  /* « rendez‑vous. » insécable doit tenir à côté du téléphone, jusqu'à 320 px de large (contre-avis 31-10) */
  .heros:not(.heros-paiement) .geant { font-size: clamp(26px, 8.4vw, 48px); }
  .heros:not(.heros-paiement) .tel-zone { zoom: .55; padding: 0; justify-content: center; }
  .heros:not(.heros-paiement) .notif { left: 50%; translate: -50% 0; bottom: 10%; transform-origin: 50% 50%; }
  /* cachée, elle attend sur le téléphone même (sur grand écran elle sort à sa droite : ici, hors de l'écran) */
  .heros:not(.heros-paiement) .notif:not(.vu) { transform: translate3d(0, 26px, 0) scale(.6); }
  .heros-paiement { position: relative; height: auto; }
  .heros-paiement .geant { font-size: clamp(38px, 11vw, 56px); }
  .heros-paiement .scene3d { flex: none; min-height: 0; height: 190px; margin: -6px -16px 0; }
}
/* Retour au doigt dès l'appui (pas au relâché) */
.segment button:active { transform: scale(.97); transition: transform .1s ease-out, color .3s; }
@media (prefers-reduced-transparency: reduce) { .notif { background: #fcfbfa; } }
@media (prefers-reduced-transparency: reduce) and (prefers-color-scheme: dark) { .notif { background: #26262a; } }
@media (prefers-contrast: more) {
  .panneau { box-shadow: 0 0 0 2px var(--ds-encre); }
  .notif { background: #fff; color: #000; box-shadow: 0 0 0 2px #000; }
}
@media (prefers-contrast: more) and (prefers-color-scheme: light) { .geant em { color: #000; } }
@media (prefers-reduced-motion: reduce) {
  .geant, .tel-3d, .atouts { animation: none; }
  .liquide, .notif, .rdv-coche, .fil > * { transition: none; }
  .frappe i { animation: none; }
}

/* Navigateur sans `zoom` (Firefox avant 126) : le téléphone resterait en grand et déborderait, on le retire sur mobile */
@supports not (zoom: 1) {
  @media (max-width: 980px) { .heros:not(.heros-paiement) .tel-zone { display: none; } }
}
