/* Accueil et pages d'usage : le produit travaille devant le visiteur. Chaque image est un vrai fragment de
   BetterCall (racine data-ui), posé dans une bulle de réponse couleur ambre pâle, sur le papier de la page. */
.accueil { font-size: var(--step-body); line-height: 1.55; }
.accueil h1, .accueil h2 { margin: 0; }
.accueil h2 { font-size: var(--step-head); line-height: 1.04; }
.accueil section { padding-left: var(--bord); padding-right: var(--bord); }

/* ---------- Héros : le titre en haut à gauche, la voix du client en haut à droite, la réponse dessous ----------
   La bulle est une réponse : sa queue, sur le bord du haut, pointe vers l'onde en caractères (ascii.js),
   dont les lettres tombent dedans. --queue-x : position de la pointe (lue aussi par ascii.js). */
.heros { position: relative; isolation: isolate; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gouttiere);
  min-height: min(calc(100svh - 76px), 940px); padding-top: 88px; overflow: hidden; }
.heros-texte { grid-column: 1 / 11; grid-row: 1; position: relative; z-index: 1; align-self: start; }
.onde-ascii { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.heros h1 { font-size: var(--step-display); line-height: 0.98; letter-spacing: -0.03em; }
.heros-phrase { font-size: var(--step-lead); line-height: 1.4; max-width: 37ch; margin: 32px 0 36px; }
.heros-prerequis { margin: 18px 0 0; font-size: var(--step-small); color: var(--bc-encre-douce); max-width: 30em; }
.heros-prerequis a { color: var(--bc-encre); }
.scene { --queue-h: 44px; --queue-x: 40%; position: relative; z-index: 1; grid-column: 5 / 13; grid-row: 1; margin-top: min(40svh, 380px); margin-right: calc(-1 * var(--bord));
  background: var(--teinte); min-height: min(60svh, 580px); padding: calc(var(--queue-h) + 48px) var(--bord) 0 56px; overflow: hidden;
  display: flex; flex-direction: column;
  clip-path: polygon(0 var(--queue-h), calc(var(--queue-x) + 30px) var(--queue-h), var(--queue-x) 0, calc(var(--queue-x) + 118px) var(--queue-h),
    100% var(--queue-h), 100% 100%, 0 100%); }

/* ---------- Le fragment « En direct » : une fenêtre de l'appli, thème clair (règles de l'interface, data-ui) ---------- */
.scene .fragment-direct { flex: 1; }
.fragment-direct { width: min(620px, 100%); background: var(--bc-blanc); color: var(--bc-encre); border: 1px solid var(--bc-filet); border-bottom: 0;
  border-radius: 16px 16px 0 0; font-size: 14px; line-height: 1.45; }
.fragment-direct .ui-barre { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--bc-filet); }
.fragment-direct .ui-barre svg { width: 24px; height: 24px; flex: none; }
.fragment-direct .ui-barre strong { font-size: 15px; font-weight: 500; }
.ui-chip { border: 1px solid var(--bc-filet); border-radius: 99px; padding: 2px 10px; color: var(--bc-encre-douce); font-size: 13px; white-space: nowrap; }
.ui-espace { flex: 1; }
.ui-son { display: inline-flex; gap: 3px; align-items: center; height: 18px; }
.ui-son i { width: 3px; height: 16px; border-radius: 2px; background: var(--bc-ok); transform: scaleY(.25); }
@media (prefers-reduced-motion: no-preference) { .ui-son i { animation: son 1.1s ease-in-out infinite; } .ui-son i:nth-child(2) { animation-delay: .15s; } .ui-son i:nth-child(3) { animation-delay: .3s; } .ui-son i:nth-child(4) { animation-delay: .45s; } .ui-son i:nth-child(5) { animation-delay: .6s; } }
@keyframes son { 50% { transform: scaleY(1); } }
.ui-terminer { border: 1px solid var(--bc-filet); border-radius: 8px; padding: 4px 10px; font-size: 13px; color: var(--bc-encre-douce); }
.ui-saisie { padding: 14px 16px 10px; display: grid; gap: 8px; }
.ui-saisie label { color: var(--bc-encre-douce); font-size: 13px; }
.ui-ligne { display: flex; gap: 8px; }
.ui-ligne input { flex: 1; min-width: 0; background: var(--bc-papier); color: var(--bc-encre); border: 1px solid var(--bc-filet); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; }
.ui-ligne input:focus { outline: none; border-color: var(--bc-encre-pale); }
.ui-ligne button { background: var(--bc-encre); color: var(--bc-papier); border: 0; border-radius: 10px; padding: 0 16px; font: inherit; font-weight: 500; cursor: pointer; transition: transform 120ms var(--ease-out); }
.ui-ligne button:active, .ui-exemples button:active { transform: scale(0.96); }
.ui-ligne #micro-live { background: var(--bc-papier-3); color: var(--bc-encre); }
.ui-exemples { display: flex; flex-wrap: wrap; gap: 6px; }
.ui-exemples button { background: var(--bc-papier-2); color: var(--bc-encre-douce); border: 0; border-radius: 99px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; transition: background-color 160ms ease, color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .ui-exemples button:hover { color: var(--bc-encre); background: var(--bc-papier-3); } .ui-ligne button:hover { background: var(--bc-encre-survol); } }
.ui-statut { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 16px; color: var(--bc-encre-douce); font-size: 13px; }
#statut-live { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-latence, .ui-format button { white-space: nowrap; }
@media (max-width: 480px) { .ui-format button { padding: 4px 8px; } .fragment-direct .ui-son, .fragment-direct .ui-chip { display: none; } }
.ui-format { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--bc-papier-2); margin-left: auto; }
.ui-format button { background: none; border: 0; border-radius: 7px; padding: 4px 10px; font: inherit; font-size: 13px; color: var(--bc-encre-douce); cursor: pointer; }
.ui-format button[aria-pressed="true"] { background: var(--bc-encre); color: var(--bc-papier); }
.ui-mots { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; font-weight: 500; }
.ui-mots li::before { content: "•"; color: var(--bc-ambre); margin-right: 8px; }
.ui-latence { color: var(--bc-ok); font-weight: 500; font-variant-numeric: tabular-nums; }
/* Les cartes de réponse : un fond pâle par type, le titre dans sa couleur. Fiche : bleu. IA : ambre. */
.ui-carte { margin: 0 16px 10px; border-radius: 12px; padding: 12px 14px; background: var(--bc-fiche-pale); }
.ui-carte .ui-titre { font-size: 13px; font-weight: 500; color: var(--bc-fiche); margin-bottom: 4px; }
.ui-carte.ia { background: var(--bc-ambre-pale); }
.ui-carte.ia .ui-titre { color: var(--bc-ambre-encre); }
.ui-carte .ui-corps { font-size: 16px; }
.ui-carte.ancienne { background: var(--bc-papier-2); color: var(--bc-encre-douce); }
.ui-carte.ancienne .ui-titre { color: var(--bc-encre-pale); }
.ui-carte.nouvelle { animation: arrivee 380ms var(--ease-out); }
@keyframes arrivee { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Accueil : la bulle porte le choix, un usage par porte ----------
   Chaque porte joue son petit appel : la phrase de l'interlocuteur s'écrit mot à mot, comme la transcription,
   et la carte de BetterCall saute avant la fin de la phrase (accueil.js, classe .anime). Sans script, tout est affiché. */
.heros-portail .heros-texte { grid-column: 1 / 9; }
.heros-portail h1 em { font-weight: 400; }
.heros-portail .heros-phrase { max-width: 29ch; }
.heros-griffon { grid-column: 1 / 5; grid-row: 1; align-self: end; z-index: 1; margin: 0 0 150px; rotate: -4deg; justify-self: start; display: flex; align-items: center; gap: 6px; }
.heros-griffon .fleche { width: 104px; height: 48px; margin-top: 18px; flex: none; }
.portes { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; padding-bottom: 48px; }
.porte { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); grid-template-areas: "pour apercu" "titre apercu" "aller apercu";
  align-items: center; column-gap: 28px; row-gap: 6px; padding: 18px 18px 18px 26px; border-radius: 22px; background: var(--bc-blanc); color: var(--bc-encre);
  text-decoration: none; rotate: var(--penche, 0deg); box-shadow: 0 2px 0 rgba(27, 28, 25, .06);
  transition: transform 420ms var(--ressort), rotate 420ms var(--ressort), box-shadow 220ms ease; }
.porte:nth-child(1) { --penche: -0.7deg; }
.porte:nth-child(2) { --penche: 0.6deg; }
.porte:nth-child(3) { --penche: -0.3deg; }
@media (hover: hover) and (pointer: fine) {
  .porte:hover { rotate: 0deg; transform: translateY(-4px); box-shadow: 0 14px 28px -16px rgba(27, 28, 25, .35); }
  .porte:hover .porte-aller { text-decoration-color: currentColor; }
}
.porte:active { transform: scale(0.98); }
.porte-pour { grid-area: pour; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: var(--step-small); color: var(--bc-encre-douce); }
.porte-titre { grid-area: titre; font-family: var(--police-titre); font-weight: 400; font-size: clamp(1.25rem, 1.02rem + 0.62vw, 1.625rem); line-height: 1.12; letter-spacing: -0.015em; text-wrap: balance; }
.porte-aller { grid-area: aller; justify-self: start; margin-top: 4px; white-space: nowrap; font-weight: 500; text-decoration: underline; text-decoration-color: var(--teinte-encre);
  text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
.porte-liste { display: none; }
/* L'aperçu : la bulle grise de l'interlocuteur, la carte de BetterCall dans la couleur de l'usage (data-ui). */
.porte-apercu { grid-area: apercu; display: grid; gap: 8px; align-content: center; font-size: 14px; line-height: 1.4; }
.porte-phrase { justify-self: start; max-width: 100%; background: var(--bc-papier-2); border-radius: 16px 16px 16px 4px; padding: 8px 13px; }
.porte-carte { position: relative; display: block; background: var(--teinte-pale); border-radius: 14px; padding: 10px 60px 11px 13px; transform-origin: 20% 0; }
.porte-carte b { display: block; font-size: 12.5px; font-weight: 500; color: var(--teinte-encre); margin-bottom: 2px; }
.porte-carte i { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: 12.5px; font-weight: 500; color: var(--bc-ok); font-variant-numeric: tabular-nums; }
/* L'animation, seulement quand le script la joue : la phrase mot à mot, la carte qui saute. */
.portes.anime .porte-phrase .mot { opacity: 0; transition: opacity 140ms ease; }
.portes.anime .porte-phrase .mot.dit { opacity: 1; }
.portes.anime .porte-phrase.ecoute::after { content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--bc-encre); animation: curseur 800ms steps(1) infinite; }
.portes.anime .porte-carte { opacity: 0; transform: translateY(8px) scale(0.86); }
.portes.anime .porte.repond .porte-carte { opacity: 1; transform: none; transition: opacity 200ms ease, transform 620ms var(--ressort); }
@keyframes curseur { 50% { opacity: 0; } }
/* Sur l'accueil, la bulle remonte pour que les portes tiennent dans le premier écran. */
@media (min-width: 901px) { .heros-portail .scene { margin-top: min(29svh, 264px); min-height: 0; padding-top: calc(var(--queue-h) + 36px); } }
@media (min-width: 901px) and (max-width: 1180px) { .porte { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pour" "titre" "apercu" "aller"; } .porte-apercu { margin-top: 8px; } .heros-griffon { display: none; } }

/* ---------- Pages d'usage : la grille de la page de recrutement dans la bulle ---------- */
.heros-capture .scene { padding-bottom: 0; }
.heros-capture .capture-app { width: min(460px, 100%); flex: 1; }
.heros-capture .capture-app img { border-radius: 16px 16px 0 0; }

/* ---------- Les pages, par onglets ---------- */
.pages { padding-top: 160px; }
.pages-tete { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 56px; }
.pages-tete h2 span { color: var(--bc-encre-pale); display: block; }
.pages-corps { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; }
.onglets-pages { display: grid; gap: 6px; align-content: start; }
.onglets-pages button { display: grid; justify-items: start; gap: 2px; min-height: 64px; padding: 10px 18px; background: var(--bc-papier-2); color: var(--bc-encre); border: 0; border-radius: 12px; font: inherit; text-align: left; cursor: pointer; transition: background-color 160ms ease; }
.onglets-pages button small { font-size: var(--step-small); color: var(--bc-encre-pale); }
.onglets-pages button[aria-selected="true"] { background: var(--bc-encre); color: var(--bc-papier); }
.onglets-pages button[aria-selected="true"] small { color: var(--bc-papier-4); }
@media (hover: hover) and (pointer: fine) { .onglets-pages button[aria-selected="false"]:hover { background: var(--bc-papier-3); } }
.liste-pages { display: grid; gap: 6px; align-content: start; }
.liste-pages[hidden] { display: none; }
.liste-pages a { display: grid; grid-template-columns: 3.4em 1fr auto; align-items: center; gap: 20px; min-height: 76px; padding: 12px 22px; border-radius: 12px; background: var(--bc-papier-2); text-decoration: none; transition: background-color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .liste-pages a:hover { background: var(--bc-papier-3); } }
.liste-pages .nombre { font-family: var(--police-titre); font-size: var(--step-lead); font-variant-numeric: tabular-nums; }
.liste-pages .nom { font-weight: 500; }
.liste-pages .nom small { display: block; font-weight: 400; font-size: var(--step-small); color: var(--bc-encre-douce); }
.liste-pages .aller { font-size: var(--step-small); color: var(--bc-encre-douce); }

/* ---------- Sans / Avec BetterCall : la colonne « Avec » est la seule sur l'ambre pâle ---------- */
.avant-apres { padding-top: 160px; display: grid; gap: 48px; }
.avant-apres-tete { display: grid; gap: 20px; max-width: 64ch; }
.avant-apres-tete p { margin: 0; font-size: var(--step-lead); line-height: 1.4; }
.avant-apres-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0 6px; font-size: var(--step-body); margin: 0; }
.avant-apres-table th, .avant-apres-table td { border: 0; }
.avant-apres-table thead td:first-child { width: 24%; }
.avant-apres-table thead th { font-weight: 500; font-size: var(--step-small); padding: 0 24px 8px; }
.avant-apres-table thead th::before { display: inline-block; width: 22px; height: 22px; margin-right: 10px; border-radius: 50%; text-align: center; line-height: 22px; font-size: 12px; font-weight: 500; vertical-align: middle; }
.avant-apres-table thead th.sans { color: var(--bc-encre-douce); }
.avant-apres-table thead th.sans::before { content: "✕"; background: var(--bc-papier-3); color: var(--bc-alerte); }
.avant-apres-table thead th.avec::before { content: "✓"; background: var(--bc-ambre); color: var(--bc-encre); }
.avant-apres-table tbody th { font-weight: 500; padding: 24px; background: var(--bc-papier-2); border-radius: 12px 0 0 12px; }
.avant-apres-table td { padding: 24px; vertical-align: top; }
.avant-apres-table td.sans { background: var(--bc-papier-2); color: var(--bc-encre-douce); }
.avant-apres-table td.avec { background: var(--teinte-pale); border-radius: 0 12px 12px 0; }
.avant-apres-table td.sans::before, .avant-apres-table td.avec::before { margin-right: 8px; }
.avant-apres-table td.sans::before { content: "✕"; color: var(--bc-alerte); }
.avant-apres-table td.avec::before { content: "✓"; color: var(--bc-ambre-encre); font-weight: 500; }
.avant-apres-action { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.avant-apres-action span { color: var(--bc-encre-douce); }

/* ---------- Entrées des sections (le contenu reste visible sans script) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js [data-entree] { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
  .js [data-entree].is-in { opacity: 1; transform: none; }
  /* La bulle s'ouvre depuis la pointe de sa queue, comme une réponse qui arrive. */
  .js .shutter { opacity: 0; transform: scale(.94); transform-origin: var(--queue-x) 0; transition: opacity 500ms var(--ease-out), transform 900ms var(--ease-out); }
  .js .shutter.is-in { opacity: 1; transform: none; }
  .js .shutter .fragment-direct, .js .shutter .portes { transform: translateY(24px); transition: transform 1200ms var(--ease-soft); }
  .js .shutter.is-in .fragment-direct, .js .shutter.is-in .portes { transform: none; }
}

@media (max-width: 900px) {
  .onde-ascii { display: none; }
  .heros { display: block; padding-top: 40px; min-height: 0; }
  .heros h1 { font-size: clamp(2.25rem, 9.6vw, 3.5rem); }
  .heros-phrase { font-size: 19px; margin: 20px 0 28px; }
  .heros .bouton { width: 100%; }
  .scene { --queue-h: 40px; margin: 48px calc(-1 * var(--bord)) 0; padding: calc(var(--queue-h) + 20px) 16px 0; min-height: 0;
    clip-path: polygon(0 var(--queue-h), 44px var(--queue-h), 24px 0, 108px var(--queue-h), 100% var(--queue-h), 100% 100%, 0 100%); }
  .js .shutter { transform-origin: 24px 0; }
  .fragment-direct { width: 100%; max-width: 100%; min-width: 0; }
  .ui-ligne { flex-wrap: wrap; }
  .ui-ligne input { flex-basis: 100%; }
  .ui-ligne button { padding: 10px 16px; }
  .portes { padding-bottom: 20px; }
  .porte { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pour" "titre" "apercu" "aller"; padding: 18px 18px 20px; }
  .porte-apercu { margin-top: 8px; }
  .porte-aller { margin-top: 10px; }
  .heros-griffon { margin: 40px 0 -34px 4px; font-size: 1.5rem; }
  .heros-griffon .fleche { width: 64px; height: 30px; margin-top: 30px; rotate: 40deg; }
  .pages, .avant-apres { padding-top: 112px; }
  .pages-tete { display: grid; margin-bottom: 32px; }
  .pages-tete .bouton { justify-self: start; }
  .pages-corps { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .onglets-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .liste-pages a { grid-template-columns: 2.6em minmax(0, 1fr); padding: 12px 16px; gap: 14px; }
  .liste-pages .aller { display: none; }
  .avant-apres { gap: 32px; }
  .avant-apres-table, .avant-apres-table tbody, .avant-apres-table tr, .avant-apres-table th, .avant-apres-table td { display: block; width: auto; }
  .avant-apres-table thead { display: none; }
  .avant-apres-table tr { margin-bottom: 14px; }
  .avant-apres-table tbody th { padding: 18px 18px 8px; border-radius: 12px 12px 0 0; }
  .avant-apres-table td { padding: 8px 18px 18px; }
  .avant-apres-table td.avec { border-radius: 0 0 12px 12px; padding-top: 14px; }
  .avant-apres-table td.sans::before { content: "✕  " attr(data-libelle); display: block; font-size: var(--step-small); margin-bottom: 4px; }
  .avant-apres-table td.avec::before { content: "✓  " attr(data-libelle); display: block; font-size: var(--step-small); margin-bottom: 4px; }
}
/* Petits téléphones : la barre de la démo garde son bouton Terminer, sans l'étiquette du client. */
@media (max-width: 380px) { .fragment-direct .ui-chip { display: none; } }

/* ==========================================================================
   Nouveau style : le haut des pages d'usage en deux colonnes qui ne se touchent pas.
   À gauche le texte, à droite un panneau de la couleur de la page, dans les marges, avec la fenêtre entière.
   ========================================================================== */
.heros { min-height: 0; padding-top: clamp(24px, 4vw, 56px); padding-bottom: var(--partie); overflow: visible; align-items: start; row-gap: 48px; }
.heros h1 { font-size: clamp(2.5rem, 1.1rem + 4vw, 5rem); line-height: 1.04; letter-spacing: -0.04em; }
.heros-phrase { max-width: 34ch; margin: 28px 0 32px; font-weight: 500; }
.heros .scene { clip-path: none; border-radius: var(--rayon); margin: 0; padding: clamp(20px, 3vw, 36px); min-height: 0; overflow: visible; }
.scene .fragment-direct { border-radius: 16px; border-bottom: 1px solid var(--bc-filet); width: 100%; flex: none; }
.heros-capture .scene { padding-bottom: clamp(20px, 3vw, 36px); }
.heros-capture .capture-app { width: min(440px, 100%); flex: none; margin-inline: auto; }
.heros-capture .capture-app img { border-radius: 16px; }
@media (min-width: 901px) {
  .heros:not(.heros-portail) .heros-texte { grid-column: 1 / 7; }
  .heros:not(.heros-portail) .scene { grid-column: 7 / 13; grid-row: 1; margin: 0; }
}
@media (max-width: 900px) {
  .heros .scene { margin: 40px 0 0; padding: 16px; }
}
/* Aucun texte coupé dans la fenêtre de démo : l'état passe à la ligne au lieu de finir par « … » */
.ui-statut { flex-wrap: wrap; }
#statut-live { white-space: normal; overflow: visible; text-overflow: clip; }
