/* Atrium : la charte d'Angelus, version blanche (site public, 5 octobre 2026).
   Schibsted Grotesk sans gras pour les titres, texte de 17 px au moins,
   boutons arrondis à 14 px (jamais en pilule), bouton principal noir,
   le dégradé iris avec parcimonie (l'orbe, un filet, un halo), beaucoup
   d'air, des micro-animations discrètes. Aucune bibliothèque. */

:root {
  /* Les valeurs de la charte (angelus-public/src/app/globals.css). */
  --fond: #ffffff;
  --fond-chaud: #f7f6f3;   /* void-deep */
  --surface: #f4f3f0;      /* obsidian */
  --surface-2: #ebe9e5;    /* slate */
  --trait: #e6e4e0;        /* ash */
  --trait-fort: #d0cdc8;   /* ash-soft */
  --texte: #1b1a17;        /* marble */
  --texte-2: #403e3a;      /* marble-dim */
  --doux: #585650;         /* bone */
  --signal: #3f7b0a;       /* le vert d'Angelus, foncé pour le blanc */
  --signal-pale: #eef4e6;
  --oracle: #5048e5;
  --bleu-nuit: #13234f;        /* ATRIUM, les boutons, vos répliques (Eddy, 14 octobre 2026) */
  --bleu-nuit-survol: #1c3170;
  --oracle-pale: rgba(80, 72, 229, 0.12);
  --alerte: #9b2a20;
  --alerte-fond: #fbefed;
  --veille: #7a5300;
  --veille-fond: #fdf4df;

  --grad-iris: linear-gradient(115deg, #b9ff3e 0%, #9a9cff 28%, #7be0d6 52%, #ff8fd6 76%, #9a9cff 100%);
  --grad-iris-deep: linear-gradient(115deg, #3f7d0a 0%, #4f46e5 30%, #0f8f84 55%, #c2368f 78%, #4f46e5 100%);

  --rayon-bouton: 14px;
  --rayon: 16px;
  --rayon-carte: 24px;
  --courbe: cubic-bezier(0.32, 0.72, 0, 1);
  --police: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--fond);
  background-image:
    radial-gradient(60% 42% at 50% -6%, rgba(80, 72, 229, 0.07), transparent 70%),
    radial-gradient(42% 32% at 88% 0%, rgba(63, 123, 10, 0.05), transparent 70%);
  background-repeat: no-repeat;
  color: var(--texte);
  font-family: var(--police);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(63, 123, 10, 0.22);
  color: var(--texte);
}

[hidden] {
  display: none !important;
}

img {
  max-width: 100%;
}

.visuellement-cache {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Mise en page ---------- */

.page {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
}

.contenu {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  padding: 32px 0 16px;
}

/* ---------- La marque ---------- */

.entete-site {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 6px;
}

.logo {
  display: block;
  width: auto;
  height: 34px;
}

.sous-marque {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--bleu-nuit);
  /* Fine et technique : Sora, capitales espacées (choix d'Eddy, 14 octobre
     2026). Le texte reste « Atrium » dans la page : les capitales viennent
     d'ici, pour que les lecteurs d'écran ne l'épellent pas. */
  font-family: "Sora", "Schibsted Grotesk", system-ui, sans-serif;
  font-style: normal;
  font-size: 19px;
  font-weight: 200;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  margin-right: -0.42em;     /* l'espacement après le dernier M ne décentre rien */
  /* Le mot « Angelus » est dessiné dans le bas du logo (la feuille occupe le
     haut) : on pose ATRIUM sur sa ligne d'écriture, pas au milieu de l'image. */
  transform: translateY(var(--descente-marque, 7px));
  line-height: 1;
}

.sous-marque::before {
  content: "";
  width: 1px;
  height: 30px;
  background: var(--trait-fort);
  /* Le trait, lui, reste au milieu du logo. */
  transform: translateY(calc(-1 * var(--descente-marque, 7px)));
}

@media (max-width: 420px) {
  .sous-marque { font-size: 16px; letter-spacing: 0.34em; margin-right: -0.34em; gap: 12px; }
  .sous-marque::before { height: 26px; }
}

/* L'œil du mot de passe (Eddy, 14 octobre 2026). */
.champ-avec-oeil {
  position: relative;
}

.champ-avec-oeil .champ {
  padding-right: 52px;
}

.bouton-oeil {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--doux);
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
}

.bouton-oeil:hover,
.bouton-oeil:focus-visible {
  color: var(--texte, #1b1a17);
  background: rgba(0, 0, 0, 0.05);
}

.bouton-oeil svg {
  width: 20px;
  height: 20px;
}

.bouton-oeil .oeil-ferme,
.bouton-oeil[aria-pressed="true"] .oeil-ouvert {
  display: none;
}

.bouton-oeil[aria-pressed="true"] .oeil-ferme {
  display: block;
}

/* ---------- Texte ---------- */

h1,
h2,
h3 {
  font-family: var(--police);
  font-weight: 400;
  text-wrap: balance;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(40px, 10.5vw, 58px);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

h2 {
  margin: 0 0 12px;
  font-size: clamp(26px, 6vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

h3 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 16px;
  text-wrap: pretty;
}

.intro {
  color: var(--texte-2);
  font-size: 19px;
}

.doux {
  color: var(--doux);
}

.note {
  margin-top: 16px;
  color: var(--doux);
  font-size: 16px;
}

.surtitre {
  margin: 0 0 10px;
  color: var(--signal);
  font-size: 15px;
  font-weight: 500;
}

/* ---------- Écrans et micro-animations ---------- */

.ecran-centre {
  text-align: center;
}

/* Chaque écran entre en montant, élément par élément. « backwards » et non
   « both » : une fois finie, l'animation rend la main (le survol des
   boutons garde son mouvement). */
.ecran > * {
  animation: monte 0.7s var(--courbe) backwards;
}

.ecran > :nth-child(2) { animation-delay: 0.05s; }
.ecran > :nth-child(3) { animation-delay: 0.1s; }
.ecran > :nth-child(4) { animation-delay: 0.15s; }
.ecran > :nth-child(5) { animation-delay: 0.2s; }
.ecran > :nth-child(n + 6) { animation-delay: 0.25s; }

@keyframes monte {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Boutons ---------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin-top: 28px;
  padding: 0 26px;
  border: 1px solid var(--bleu-nuit);
  border-radius: var(--rayon-bouton);
  background: var(--bleu-nuit);
  color: #ffffff;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 24px -16px rgba(19, 35, 79, 0.65);
  transition: transform 0.2s var(--courbe), background-color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.bouton:hover {
  background: var(--bleu-nuit-survol);
  border-color: var(--bleu-nuit-survol);
  transform: translateY(-1px);
}

.bouton:active {
  transform: translateY(0) scale(0.98);
}

.bouton:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.bouton-secondaire {
  border-color: var(--trait-fort);
  background: var(--fond);
  color: var(--texte);
  box-shadow: none;
}

.bouton-secondaire:hover {
  border-color: rgba(27, 26, 23, 0.45);
  background: var(--fond);
}

.bouton-petit {
  width: auto;
  min-height: 42px;
  margin-top: 0;
  padding: 0 16px;
  font-size: 15px;
  white-space: nowrap;
}

.bouton-lien {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 8px 2px;
  border: 0;
  background: none;
  color: var(--texte-2);
  font: inherit;
  font-size: 16px;
  text-decoration: underline;
  text-decoration-color: var(--trait-fort);
  text-underline-offset: 5px;
  cursor: pointer;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.bouton-lien:hover {
  color: var(--texte);
  text-decoration-color: currentColor;
}

.bouton-lien:disabled {
  color: var(--doux);
  text-decoration: none;
  cursor: default;
  font-variant-numeric: tabular-nums;
}

:focus-visible {
  outline: 2px solid var(--oracle);
  outline-offset: 3px;
}

/* ---------- Champs ---------- */

.etiquette {
  display: block;
  margin: 22px 0 8px;
  color: var(--texte);
  font-size: 16px;
  font-weight: 500;
}

.aide {
  display: block;
  margin: 8px 0 0;
  color: var(--doux);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
}

.champ {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--trait-fort);
  border-radius: var(--rayon-bouton);
  background: var(--fond);
  color: var(--texte);
  font: inherit;
  font-size: 17px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.champ::placeholder {
  color: #a9a59e;
}

.champ:hover {
  border-color: #b9b5ae;
}

.champ:focus {
  border-color: var(--texte);
  outline: none;
  box-shadow: 0 0 0 4px var(--oracle-pale);
}

textarea.champ {
  min-height: 112px;
  line-height: 1.5;
  resize: vertical;
}

select.champ {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23585650' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 16px center;
  background-repeat: no-repeat;
  -webkit-appearance: none;
  appearance: none;
}

/* Le code : un seul champ, large et espacé (le copier-coller marche). */
.champ-code {
  width: 100%;
  max-width: 340px;
  min-height: 80px;
  margin: 8px auto 0;
  padding: 0 0 0 0.42em;    /* compense l'espace laissé après le dernier chiffre */
  border-radius: 20px;
  background: var(--fond-chaud);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: 0.42em;
  text-align: center;
  caret-color: var(--oracle);
}

.champ-code::placeholder {
  color: #cfcbc4;
}

.champ-code:focus {
  background: var(--fond);
}

/* La case à cocher en interrupteur. */
.case {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
  font-size: 17px;
  cursor: pointer;
}

.case input {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background-color 0.25s var(--courbe);
  -webkit-appearance: none;
  appearance: none;
}

.case input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(27, 26, 23, 0.25);
  transition: transform 0.25s var(--courbe);
}

.case input:checked {
  background: var(--signal);
}

.case input:checked::after {
  transform: translateX(18px);
}

/* ---------- Messages ---------- */

.message {
  margin: 18px 0 0;
  padding: 14px 18px;
  border-radius: var(--rayon);
  background: var(--alerte-fond);
  color: var(--alerte);
  font-size: 16px;
  line-height: 1.45;
  text-align: left;
}

.message-ok {
  background: var(--signal-pale);
  color: var(--signal);
}

/* ---------- L'orbe ---------- */
/* Le script pose `transform: scale(...)` sur #orbe selon le volume : les
   animations vivent donc sur ses deux couches (::before = le halo,
   ::after = la sphère), jamais sur #orbe lui-même. */

.orbe-cadre {
  position: relative;
  display: grid;
  place-items: center;
  width: 212px;
  height: 212px;
  margin: 2px auto 6px;
}

/* Un anneau fin autour de l'orbe. */
.orbe-cadre::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid var(--trait);
  border-radius: 50%;
}

/* Un arc qui tourne sur l'anneau quand l'assistant réfléchit. */
.orbe-cadre::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(80, 72, 229, 0.85) 100%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  opacity: 0;
  transition: opacity 0.4s;
  animation: orbe-tourne 1.6s linear infinite;
}

.orbe-cadre:has(.orbe[data-etat="reflechit"])::after {
  opacity: 1;
}

.orbe {
  position: relative;
  width: 136px;
  height: 136px;
  border-radius: 50%;
  transition: transform 0.08s linear;
  will-change: transform;
}

.orbe::before {
  content: "";
  position: absolute;
  inset: -26%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #b9ff3e, #9a9cff, #7be0d6, #ff8fd6, #9a9cff, #b9ff3e);
  filter: blur(26px);
  opacity: 0.4;
  transition: opacity 0.6s;
  animation: orbe-souffle 4.8s ease-in-out infinite;
}

.orbe::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, 0.92) 0, rgba(255, 255, 255, 0) 34%),
    radial-gradient(circle at 82% 30%, rgba(255, 143, 214, 0.62) 0, rgba(255, 143, 214, 0) 54%),
    radial-gradient(circle at 18% 80%, rgba(185, 255, 62, 0.58) 0, rgba(185, 255, 62, 0) 56%),
    radial-gradient(circle at 74% 88%, rgba(80, 72, 229, 0.62) 0, rgba(80, 72, 229, 0) 62%),
    linear-gradient(135deg, #9a9cff 0%, #7be0d6 50%, #9a9cff 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 200% 200%;
  box-shadow:
    inset 0 -14px 30px rgba(80, 72, 229, 0.26),
    inset 0 8px 18px rgba(255, 255, 255, 0.55),
    0 30px 52px -28px rgba(80, 72, 229, 0.6);
  transition: filter 0.6s, opacity 0.6s;
  animation: orbe-flux 9s ease-in-out infinite;
}

/* Connexion : l'orbe attend, presque sans couleur. */
.orbe[data-etat="connexion"]::before {
  opacity: 0.12;
  animation-duration: 2.4s;
}

.orbe[data-etat="connexion"]::after {
  filter: saturate(0.2) brightness(1.06);
  opacity: 0.55;
}

/* Vous écoute : un souffle lent. */
.orbe[data-etat="ecoute"]::before {
  opacity: 0.34;
}

/* Réfléchit : le halo tourne, les couleurs coulent. */
.orbe[data-etat="reflechit"]::before {
  opacity: 0.5;
  animation: orbe-tourne 3s linear infinite;
}

.orbe[data-etat="reflechit"]::after {
  animation-duration: 2.8s;
}

/* Parle : le halo s'allume et respire vite. */
.orbe[data-etat="parle"]::before {
  opacity: 0.62;
  animation-duration: 1.7s;
}

.orbe[data-etat="parle"]::after {
  animation-duration: 4s;
}

/* La petite orbe de l'accueil, purement décorative. */
.orbe-petite {
  width: 76px;
  height: 76px;
  margin: 0 auto 30px;
}

.orbe-petite::before {
  filter: blur(16px);
  opacity: 0.38;
}

@keyframes orbe-souffle {
  0%, 100% { transform: scale(0.9); }
  50% { transform: scale(1.07); }
}

@keyframes orbe-tourne {
  to { transform: rotate(360deg); }
}

@keyframes orbe-flux {
  0%, 100% { background-position: 0 0, 0 0, 0 0, 0 0, 0% 50%; }
  50% { background-position: 0 0, 0 0, 0 0, 0 0, 100% 50%; }
}

/* ---------- Page du visiteur ---------- */

.formulaire-code {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Écran d'information : quatre lignes, chacune avec son pictogramme. */
.liste-info {
  margin: 28px 0 0;
  padding: 6px 20px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-carte);
  background: var(--fond);
  list-style: none;
  text-align: left;
}

.liste-info li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  font-size: 17px;
  line-height: 1.45;
}

.liste-info li + li {
  border-top: 1px solid var(--trait);
}

.picto {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--surface);
  color: var(--texte);
}

.picto svg {
  width: 20px;
  height: 20px;
}

.picto img {
  width: auto;
  height: 22px;
}

.liste-info strong {
  font-weight: 500;
}

.note-reprise {
  display: inline-block;
  margin: 0 0 4px;
  padding: 10px 16px;
  border-radius: var(--rayon);
  background: var(--surface);
  color: var(--texte-2);
  font-size: 16px;
}

/* La conversation tient dans l'écran : tout est centré, le fil prend la
   place qui reste et défile ; « Terminer » reste toujours visible. */
.ecran-conversation {
  text-align: center;
}

.ecran-conversation:not([hidden]) {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.ecran-conversation > * {
  flex-shrink: 0;
}

@supports selector(:has(*)) {
  .page:has(.ecran-conversation:not([hidden])) {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
  }

  .page:has(.ecran-conversation:not([hidden])) .contenu {
    min-height: 0;
    padding: 12px 0 0;
  }

  .ecran-conversation > .fil {
    flex-shrink: 1;
    min-height: 0;
    max-height: none;
  }
}

.minuterie {
  display: inline-block;
  margin: 0 0 4px;
  padding: 5px 14px;
  border: 1px solid var(--trait);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  min-width: 76px;
  color: var(--doux);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ecran-conversation h1 {
  margin: 0 0 6px;
  font-size: clamp(32px, 8vw, 40px);
}

.etat {
  min-height: 1.5em;
  margin: 0 0 8px;
  color: var(--doux);
  font-size: 18px;
}

.avertissement {
  display: inline-block;
  margin: 6px 0 0;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--veille-fond);
  color: var(--veille);
  font-size: 16px;
}

/* Le bandeau de reconnexion flotte en haut, sans pousser la page. */
.bandeau {
  position: fixed;
  z-index: 10;
  top: max(14px, env(safe-area-inset-top));
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 0 auto;
  padding: 10px 16px;
  border: 1px solid #f1e1b5;
  border-radius: var(--rayon);
  background: var(--veille-fond);
  color: var(--veille);
  font-size: 15px;
  line-height: 1.35;
  text-align: left;
  box-shadow: 0 18px 40px -24px rgba(27, 26, 23, 0.45);
}

.bandeau::before {
  content: "";
  flex: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: orbe-tourne 0.9s linear infinite;
}

/* Les répliques, comme de vrais messages : l'assistant à gauche, vous à
   droite ; chaque bulle grandit depuis son coin. */
.fil {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: 8px;
  max-height: min(34vh, 340px);
  max-height: min(34dvh, 340px);
  margin: 22px -6px 0;
  padding: 26px 6px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  text-align: left;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 34px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 34px);
  scrollbar-width: thin;
  scrollbar-color: var(--trait-fort) transparent;
}

.fil:empty {
  display: none;
}

.replique {
  max-width: 86%;
  margin: 0;
  padding: 10px 15px 11px;
  border-radius: 20px;
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  animation: bulle 0.5s var(--courbe) backwards;
}

.replique-agent {
  align-self: flex-start;
  border: 1px solid var(--trait);
  border-bottom-left-radius: 6px;
  background: var(--surface);
  color: var(--texte);
  transform-origin: 0% 100%;
}

.replique-vous {
  align-self: flex-end;
  border: 1px solid var(--bleu-nuit);
  border-bottom-right-radius: 6px;
  background: var(--bleu-nuit);
  color: #ffffff;
  transform-origin: 100% 100%;
}

.qui {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.replique-agent .qui {
  color: var(--signal);
}

.replique-vous .qui {
  color: rgba(255, 255, 255, 0.62);
}

/* Plusieurs phrases de suite du même côté : un seul nom, bulles serrées. */
.replique-agent + .replique-agent,
.replique-vous + .replique-vous {
  margin-top: -4px;
}

.replique-agent + .replique-agent .qui,
.replique-vous + .replique-vous .qui {
  display: none;
}

@keyframes bulle {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: none; }
}

.bouton-terminer {
  margin-top: 26px;
}

.icone-stop {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: #c2362b;
}

/* La fin : une coche qui se dessine dans un cercle au filet iris. */
.coche {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 30px;
  isolation: isolate;
}

.coche::before,
.coche::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
}

.coche::before {
  background: var(--grad-iris);
  filter: blur(14px);
  opacity: 0.45;
}

.coche::after {
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--fond), var(--fond)) padding-box,
    var(--grad-iris-deep) border-box;
}

.coche svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--texte);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coche path {
  stroke-dasharray: 24;
  animation: coche 0.6s 0.35s ease-out backwards;
}

@keyframes coche {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

.marque-pied {
  margin: 0;
  color: var(--doux);
  font-size: 14px;
  text-align: center;
}

/* ---------- Administration ---------- */

.page-admin {
  max-width: 1040px;
}

.entete-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0 18px;
  border-bottom: 1px solid var(--trait);
}

.marque-admin {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  text-decoration: none;
}

.page-admin main {
  flex: 1;
  padding: 40px 0 24px;
}

.vue {
  animation: monte 0.6s var(--courbe) backwards;
}

/* Connexion : une carte seule, au milieu. */
.carte-connexion {
  max-width: 440px;
  margin: 6vh auto 0;
  padding: 36px 28px 32px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-carte);
  background: var(--fond);
  box-shadow: 0 40px 80px -56px rgba(27, 26, 23, 0.35);
}

.carte-connexion h1 {
  font-size: clamp(36px, 8vw, 44px);
}

/* L'en-tête d'une vue : titre à gauche, action à droite. */
.tete-vue {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 36px;
}

.tete-vue h1 {
  margin-bottom: 10px;
}

.tete-vue p {
  max-width: 520px;
  margin: 0;
}

.tete-vue .bouton {
  margin-top: 16px;
}

.icone {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Le lien, montré une seule fois : le filet iris l'entoure. */
.lien-unique {
  margin: 0 0 36px;
  padding: 28px 24px;
  border: 1.5px solid transparent;
  border-radius: var(--rayon-carte);
  background:
    linear-gradient(var(--fond), var(--fond)) padding-box,
    var(--grad-iris-deep) border-box;
  background-size: 100% 100%, 220% 220%;
  box-shadow: 0 30px 60px -36px rgba(79, 70, 229, 0.4);
  animation: monte 0.6s var(--courbe) backwards, contour-iris 7s ease-in-out infinite;
}

.lien-unique p {
  color: var(--texte-2);
  font-size: 17px;
}

.lien-ligne {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.lien-ligne .champ {
  background: var(--fond-chaud);
  font-size: 16px;
  text-overflow: ellipsis;
}

.lien-ligne .bouton {
  margin-top: 0;
}

@keyframes contour-iris {
  0%, 100% { background-position: 0 0, 0% 50%; }
  50% { background-position: 0 0, 100% 50%; }
}

/* Le formulaire de création : des sections, un titre et une phrase à
   gauche, les champs à droite (empilés sur téléphone). */
.formulaire-salle {
  margin: 0 0 44px;
  padding: 8px 22px 26px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-carte);
  background: var(--fond);
  box-shadow: 0 40px 80px -60px rgba(27, 26, 23, 0.35);
  animation: monte 0.6s var(--courbe) backwards;
}

.formulaire-tete {
  padding: 24px 0 4px;
}

.formulaire-tete h2 {
  margin: 0 0 6px;
}

.formulaire-tete p {
  margin: 0;
}

.section-form {
  min-width: 0;
  padding: 26px 0 30px;
  border-top: 1px solid var(--trait);
}

.formulaire-tete + .section-form {
  margin-top: 20px;
}

.section-titre {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 19px;
  font-weight: 500;
  letter-spacing: -0.015em;
}

.section-num {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--texte-2);
  font-size: 14px;
  font-weight: 500;
}

.section-texte {
  margin: 6px 0 0;
  color: var(--doux);
  font-size: 15px;
  line-height: 1.45;
}

.section-champs {
  padding-top: 4px;
}

.section-champs > .etiquette:first-child,
.section-champs > .deux-colonnes:first-child .etiquette {
  margin-top: 18px;
}

.deux-colonnes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 16px;
}

.actions-form {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  padding-top: 22px;
  border-top: 1px solid var(--trait);
}

.actions-form .bouton {
  margin-top: 0;
}

.formulaire-salle .message {
  margin-top: 16px;
}

/* Les salles en cartes aérées. */
.titre-liste {
  margin: 0 0 18px;
  color: var(--doux);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.grille-salles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.grille-salles > .doux,
.liste-conversations > .doux {
  grid-column: 1 / -1;
  padding: 36px 24px;
  border: 1px dashed var(--trait-fort);
  border-radius: var(--rayon-carte);
  text-align: center;
}

.carte {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 22px 22px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon-carte);
  background: var(--fond);
  transition: border-color 0.25s, box-shadow 0.35s var(--courbe), transform 0.35s var(--courbe);
  animation: monte 0.6s var(--courbe) backwards;
}

.carte:hover {
  border-color: var(--trait-fort);
  box-shadow: 0 26px 50px -34px rgba(27, 26, 23, 0.3);
}

.carte h3 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 10px;
  font-size: 23px;
  overflow-wrap: anywhere;
}

.carte p {
  margin: 0 0 6px;
  font-size: 17px;
}

/* L'objectif : trois lignes au plus. */
.carte h3 + p:not(.doux) {
  display: -webkit-box;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--texte-2);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Les détails sous un filet. */
.carte p.doux {
  margin-bottom: 4px;
  color: var(--doux);
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.carte h3 + p:not(.doux) + p.doux,
.grille-salles .carte h3 + p.doux {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--trait);
}

.pastille {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  margin-top: 3px;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--signal-pale);
  color: var(--signal);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pastille::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pastille-fermee {
  background: var(--surface);
  color: var(--doux);
}

/* Le tableau de bord classé (14 octobre 2026). */
.bilan-salles {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.bilan {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--fond-chaud);
}

.bilan strong {
  color: var(--bleu-nuit);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.bilan span {
  color: var(--doux);
  font-size: 14px;
}

.groupe-salles {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 -4px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--doux);
}

.groupe-salles .compte {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--texte);
  font-size: 13px;
  letter-spacing: 0;
}

.carte-close {
  background: var(--fond-chaud);
}

.carte-close h3 {
  color: var(--doux);
}

.chiffres-salle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 16px 0 12px;
  color: var(--bleu-nuit);
  font-size: 15px;
  font-weight: 500;
}

.temps-salle {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--trait);
}

.temps-salle .doux {
  font-size: 14px;
}

.barre-temps {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface);
}

.barre-temps span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--bleu-nuit);
  transition: width 0.6s var(--courbe);
}

/* Le résumé par Oracle, en tête d'une conversation. */
.resume-oracle {
  margin: 14px 0 16px;
  padding: 18px 20px;
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  background: var(--fond-chaud);
}

.resume-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.resume-titre {
  color: var(--bleu-nuit);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.resume-oracle .resume-texte {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.55;
}

.etat-atteint {
  background: var(--signal-pale);
  color: var(--signal);
}

.etat-partiel {
  background: var(--veille-fond);
  color: var(--veille);
}

.etat-non {
  background: var(--alerte-fond);
  color: var(--alerte);
}

.points-cles {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.point-cle {
  display: grid;
  grid-template-columns: minmax(90px, 30%) minmax(0, 1fr);
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--trait);
}

.point-cle dt {
  color: var(--doux);
  font-size: 14px;
}

.point-cle dd {
  margin: 0;
  font-size: 16px;
}

.point-cle .citation {
  display: block;
  margin-top: 3px;
  color: var(--doux);
  font-size: 13px;
  font-style: italic;
}

.resume-oracle .resume-suite {
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--trait);
  font-size: 16px;
}

@media (max-width: 520px) {
  .bilan-salles { grid-template-columns: minmax(0, 1fr); }
  .point-cle { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

.carte-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 20px;
}

/* Les conversations d'une salle. */
.liste-conversations {
  display: grid;
  gap: 16px;
  max-width: 760px;
}

.liste-conversations .carte h3 {
  margin-bottom: 6px;
  font-size: 21px;
}

.liste-conversations .carte h3 + p.doux {
  margin-bottom: 0;
}

.liste-conversations audio {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 18px;
  border-radius: 999px;
}

.liste-conversations details {
  margin-top: 16px;
}

summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border: 1px solid var(--trait-fort);
  border-radius: 12px;
  color: var(--texte);
  font-size: 15px;
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  transition: border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s var(--courbe), margin 0.25s var(--courbe);
}

details[open] > summary::after {
  margin-top: 4px;
  transform: rotate(-135deg);
}

summary:hover {
  border-color: rgba(27, 26, 23, 0.45);
}

/* La transcription d'archive, en bulles, sans fondu ni défilement imposé. */
.fil-archive {
  max-height: none;
  margin: 14px 0 0;
  padding: 18px 16px;
  overflow: visible;
  border-radius: 20px;
  background: var(--fond-chaud);
  -webkit-mask-image: none;
  mask-image: none;
}

.fil-archive .replique {
  animation: none;
}

.fil-archive .replique-agent {
  background: var(--fond);
}

/* ---------- Écrans plus larges ---------- */

@media (min-width: 640px) {
  .page {
    padding-right: 32px;
    padding-left: 32px;
  }

  .logo {
    height: 40px;
  }

  .contenu {
    padding: 48px 0 24px;
  }

  .ecran > .bouton,
  .formulaire-code .bouton {
    width: auto;
    min-width: 240px;
  }

  .ecran-conversation .bouton-terminer {
    min-width: 200px;
  }

  .orbe-cadre {
    width: 260px;
    height: 260px;
  }

  .orbe {
    width: 164px;
    height: 164px;
  }

  .orbe-petite {
    width: 84px;
    height: 84px;
  }

  .liste-info {
    padding: 6px 26px;
  }

  .deux-colonnes {
    grid-template-columns: 1fr 1fr;
  }

  .lien-unique {
    padding: 32px;
  }

  .lien-ligne {
    flex-direction: row;
  }

  .lien-ligne .bouton {
    width: auto;
    min-width: 128px;
    min-height: 52px;
  }

  .formulaire-salle {
    padding: 8px 36px 32px;
  }

  .actions-form {
    flex-direction: row;
    justify-content: flex-end;
  }

  .actions-form .bouton {
    width: auto;
    min-width: 160px;
  }

  .carte-connexion {
    padding: 44px 40px 40px;
  }

  .carte-connexion .bouton {
    width: 100%;
  }

  .tete-vue .bouton {
    width: auto;
    margin-top: 0;
  }
}

@media (min-width: 820px) {
  .grille-salles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Chaque section : le titre à gauche, les champs à droite. */
  .section-form {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 0 40px;
  }

  .section-entete {
    grid-column: 1;
    padding-top: 18px;
  }

  .section-champs {
    grid-column: 2;
    padding-top: 0;
  }
}

@media (max-height: 680px) {
  .orbe-cadre {
    width: 172px;
    height: 172px;
  }

  .orbe {
    width: 110px;
    height: 110px;
  }
}

/* Moins de mouvement demandé : tout reste immobile. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .orbe-cadre:has(.orbe[data-etat="reflechit"])::after {
    opacity: 0;
  }
}

/* Le retour aux salles, en haut de la vue des conversations. */
.vue > .bouton-lien:first-child {
  margin: 0 0 22px;
  padding-left: 0;
  text-decoration: none;
}

.fil-archive .replique {
  margin-bottom: 0;
  white-space: pre-line;
}
