/* web/porte.css — la porte d'entrée (accueil public + inscription). Panneau sombre à gauche, carte claire à droite.
 *
 * EXCEPTION ASSUMÉE AU SYSTÈME DE DESIGN (demande de Theodor, 9 novembre 2026) : cet écran est une page PUBLIQUE de présentation, pas un écran de
 * chiffres. Il a donc sa propre palette (noir, blanc, violet de la marque), une ombre douce sous la carte, un halo de focus de 3 px et des durées de
 * 110 à 120 ms. Rien de cela ne sort d'ici : tests/unit/design-system.test.js continue de garder systeme.css, intact. Les couleurs sont déclarées UNE fois,
 * ci-dessous, et vérifiées par tests/unit/porte.test.js (3:1 minimum partout, 4,5:1 pour le texte).
 */
#acces.acces-porte { max-width: none; padding: 0; margin: 0; }

#acces .porte {
  display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; min-height: 100dvh;
  font-family: var(--police); color-scheme: light; background: var(--p-fond);
}

/* ---------------- colonne gauche : aplat noir, un argumentaire (titre, sous-titre, trois arguments), pas un titre et un pied de page */
#acces .porte .porte-gauche { position: sticky; top: 0; height: 100vh; height: 100dvh; box-sizing: border-box; padding: 48px 64px; background: var(--p-noir); color: #fff;
  display: flex; flex-direction: column; overflow-y: auto; }
#acces .porte .porte-marque { display: flex; align-items: center; gap: 10px; align-self: flex-start; color: inherit; text-decoration: none; font-size: 20px; font-weight: 600; letter-spacing: -.03em; }
#acces .porte .porte-marque img { display: block; width: 24px; height: 24px; }
#acces .porte .porte-panneau h1 { margin: 72px 0 0; font-size: 44px; font-weight: 500; line-height: 1.05; letter-spacing: -.03em; max-width: 580px; }
#acces .porte .porte-intro { margin: 20px 0 0; font-size: 16px; line-height: 1.5; color: var(--p-sombre-gris); max-width: 480px; }
#acces .porte .porte-preuves { list-style: none; margin: 48px 0 0; padding: 0; max-width: 520px; }
#acces .porte .porte-preuves li { display: grid; grid-template-columns: 30px 1fr; padding: 16px 0; border-top: 1px solid var(--p-sombre-filet); font-size: 15px; color: var(--p-sombre-texte); }
#acces .porte .porte-preuves li:last-child { border-bottom: 1px solid var(--p-sombre-filet); }
#acces .porte .porte-preuves svg { margin-top: 2px; color: var(--p-violet-clair); }
#acces .porte .porte-preuves small { display: block; margin-top: 2px; font-size: 13px; color: var(--p-sombre-gris); }

/* RÉSERVE, DÉSACTIVÉE : motif de barres. Pour l'allumer, ajouter la classe « avec-barres » sur .porte-gauche (web/porte.js, htmlPorte).
   10 barres à 3,5 % d'opacité, écarts irréguliers, départs décalés, une seule violette et immobile ; sous les arguments. */
#acces .porte .porte-barres { display: none; }
#acces .porte .porte-gauche.avec-barres .porte-barres { display: block; position: relative; flex: 1; min-height: 160px; margin: 24px -64px 0; }
#acces .porte .porte-barres i { position: absolute; height: 2.8%; min-height: 8px; border-radius: 7px; background: rgba(255,255,255,.035); transform-origin: left; }
#acces .porte .porte-barres i.v { background: rgba(91,82,240,.08); }
@media (prefers-reduced-motion: no-preference) {
  #acces .porte .porte-barres i:not(.v) { animation: respire var(--t) ease-in-out var(--d) infinite alternate; }
  @keyframes respire { from { transform: scaleX(.8); } to { transform: scaleX(1); } }
}

/* ---------------- carte */
#acces .porte .porte-zone { display: flex; padding: 48px 24px; box-sizing: border-box; min-width: 0; }
#acces .porte .porte-carte { box-sizing: border-box; width: 440px; max-width: 100%; margin: auto; padding: 44px 40px 40px; background: var(--p-carte); color: var(--p-encre);
  border: 1px solid var(--p-filet); border-radius: 16px; box-shadow: 0 8px 30px rgba(10,37,64,.07); }
#acces .porte .porte-carte[hidden] { display: none; }
#acces .porte .porte-carte h2 { margin: 0 0 28px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--p-encre); }
#acces .porte .porte-note { margin: -8px 0 28px; padding: 12px 14px; background: var(--p-fond); border-radius: 10px; font-size: 14px; line-height: 1.45; color: var(--p-encre); }
/* L'écart entre deux champs est CONSTANT (34 px). Le message d'un champ (aide, erreur, état) vit DANS cet écart, en position absolue : il ne pousse rien.
   Un message qui ne tient pas sur une ligne passe en « .long » (web/porte.js, ajuster) et repasse alors dans le flux, plutôt que de recouvrir le champ suivant. */
#acces .porte .champ { position: relative; margin-bottom: 34px; }
#acces .porte .champ .msg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; }
#acces .porte .champ.long { margin-bottom: 34px; }
#acces .porte .champ.long .msg, #acces .porte .champ.long .force { position: static; margin-top: 8px; }
#acces .porte .champ label { display: block; margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--p-encre); }
#acces .porte .etiquette-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 8px; }
#acces .porte .etiquette-ligne label { margin: 0; }
#acces .porte .aide-champ { margin: 0 0 8px; font-size: 13px; line-height: 1.45; color: var(--p-encre-2); }
#acces .porte .aide-info { flex-basis: 100%; margin: 6px 0 0; padding: 12px 14px; background: var(--p-fond); border-radius: 10px; font-size: 13px; line-height: 1.45; color: var(--p-encre); }
#acces .porte .aide-info[hidden] { display: none; }
#acces .porte .champ input, #acces .porte .champ select { display: block; box-sizing: border-box; width: 100%; height: 48px; margin: 0; padding: 0 14px; background: var(--p-carte); color: var(--p-encre);
  border: 1px solid var(--p-bord); border-radius: 10px; font: inherit; font-size: 16px; }
#acces .porte .champ select { appearance: none; padding-right: 40px; 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='%235B6472' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
#acces .porte .champ input:focus-visible, #acces .porte .champ select:focus-visible { outline: 2px solid transparent; border-color: var(--p-violet); box-shadow: 0 0 0 3px rgba(91,82,240,.28); transform: translateY(-1px); }
#acces .porte .champ input[aria-invalid="true"], #acces .porte .champ select[aria-invalid="true"] { border-color: var(--p-rouge); }
#acces .porte .avec-bouton, #acces .porte .avec-suffixe { position: relative; }
#acces .porte .avec-bouton input { padding-right: 52px; }
#acces .porte .oeil { position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 8px;
  background: none; color: var(--p-encre-2); cursor: pointer; }
#acces .porte .oeil[aria-pressed="true"] { color: var(--p-violet); }
#acces .porte .suffixe { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); color: var(--p-encre-2); font-size: 16px; pointer-events: none; }
#acces .porte .info { width: 44px; height: 44px; margin: -12px -12px -12px 0; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: none;
  color: var(--p-encre-2); cursor: pointer; }
#acces .porte .info[aria-expanded="true"] { color: var(--p-violet); }
#acces .porte .oeil:focus-visible, #acces .porte .info:focus-visible, #acces .porte .lien:focus-visible, #acces .porte a:focus-visible, #acces .porte .go:focus-visible { outline: 2px solid var(--p-violet); outline-offset: 2px; }

/* ---------------- messages sous les champs */
#acces .porte .msg { margin: 8px 0 0; font-size: 13px; line-height: 1.4; color: var(--p-encre-2); }
#acces .porte .msg:empty { display: none; }
#acces .porte .msg.mauvais { color: var(--p-rouge); }
#acces .porte .msg.bon { color: var(--p-vert); }
#acces .porte .lien { display: inline; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--p-lien); text-decoration: underline; cursor: pointer; }
#acces .porte .etat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#acces .porte .etat.repos { display: none; }
#acces .porte .etat .ico { display: inline-block; width: 16px; height: 16px; text-align: center; line-height: 16px; font-weight: 700; }
#acces .porte .etat.ok { color: var(--p-vert); } #acces .porte .etat.ok .ico::before { content: "✓"; }
#acces .porte .etat.ko { color: var(--p-rouge); } #acces .porte .etat.ko .ico::before { content: "✕"; }
#acces .porte .etat.charge .ico { border: 2px solid var(--p-bord); border-top-color: var(--p-violet); border-radius: 50%; box-sizing: border-box; }

/* ---------------- force du mot de passe */
#acces .porte .force { position: absolute; left: 0; right: 0; top: calc(100% + 4px); display: flex; align-items: center; gap: 12px; }
#acces .porte .force .msg { position: static; margin: 0; }
#acces .porte .force-piste { flex: 0 0 72px; height: 3px; border-radius: 2px; background: var(--p-filet); overflow: hidden; }
#acces .porte .force-piste i { display: block; height: 100%; }
#acces .porte .force-piste i.force-faible { background: var(--p-rouge); } #acces .porte .force-piste i.force-moyen { background: var(--p-orange); } #acces .porte .force-piste i.force-fort { background: var(--p-vert); }

/* ---------------- bouton */
#acces .porte .go { position: relative; display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; height: 48px; padding: 0 16px; border: 0; border-radius: 10px;
  background: var(--p-violet); color: #fff; font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer; }
#acces .porte .go:hover:not(:disabled) { background: var(--p-violet-fonce); }
#acces .porte .go:disabled { cursor: progress; opacity: 1; background: var(--p-violet); color: #fff; }   /* en envoi, le bouton garde son contraste : c'est le rond qui dit « en cours » */
#acces .porte .go-rond, #acces .porte .go-coche { position: absolute; left: 18px; top: 50%; width: 18px; height: 18px; margin-top: -9px; display: none; }
#acces .porte .go.charge .go-rond { display: block; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; box-sizing: border-box; }
#acces .porte .go.ok .go-coche { display: block; color: #fff; }
#acces .porte .gratuit { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--p-encre-3); }
#acces .porte .deja { margin: 22px 0 0; padding-top: 22px; border-top: 1px solid var(--p-filet); text-align: center; font-size: 14px; }
#acces .porte .legal { margin: 16px 0 0; text-align: center; font-size: 12px; line-height: 1.5; color: var(--p-encre-2); }
#acces .porte .deja a, #acces .porte .legal a { color: var(--p-lien); font-weight: 600; text-decoration: none; }
#acces .porte .legal a { text-decoration: underline; }
#acces .porte .erreur-globale { margin-top: 12px; text-align: center; color: var(--p-rouge); }
#acces .porte #ins-reussite h2 { margin-bottom: 16px; }
#acces .porte #ins-reussite p { margin: 0 0 14px; font-size: 15px; line-height: 1.5; }

/* ---------------- mouvement : tout est coupé quand l'appareil demande moins de mouvement */
@media (prefers-reduced-motion: no-preference) {
  #acces .porte .champ input, #acces .porte .champ select { transition: border-color 120ms, box-shadow 120ms, transform 120ms; }
  #acces .porte .force-piste i { transition: width 120ms, background-color 120ms; }
  #acces .porte .porte-arrivee .bloc { animation: monte 110ms ease-out both; animation-delay: calc(var(--i, 0) * 40ms); }
  @keyframes monte { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  #acces .porte .etat.charge .ico, #acces .porte .go.charge .go-rond { animation: tourne 800ms linear infinite; }
  @keyframes tourne { to { transform: rotate(360deg); } }
}

/* ---------------- téléphone : une colonne. Le bandeau (logo, titre, sous-titre) ouvre la page, la carte suit, les trois arguments ferment la page sur le même noir. */
@media (max-width: 900px) {
  #acces .porte { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; }
  #acces .porte .porte-gauche { display: contents; }
  #acces .porte .porte-panneau { order: 1; padding: 24px 16px 28px; background: var(--p-noir); color: #fff; }
  #acces .porte .porte-panneau h1 { margin-top: 28px; font-size: 30px; }
  #acces .porte .porte-intro { margin-top: 14px; font-size: 15px; }
  #acces .porte .porte-zone { order: 2; padding: 16px; align-items: flex-start; }
  #acces .porte .porte-carte { padding: 28px 20px; margin: 0 auto; }
  #acces .porte .porte-preuves { order: 3; max-width: none; margin: 0; padding: 8px 16px 32px; background: var(--p-noir); }
  #acces .porte .porte-barres { display: none !important; }
}

/* ---------------- /connexion : une carte seule, centrée, sous le logo */
#acces .porte.porte-seule { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 32px 16px; box-sizing: border-box; }
#acces .porte .porte-seule-logo { display: block; }
#acces .porte .porte-seule-logo img { display: block; height: 24px; width: auto; }
#acces .porte.porte-seule .porte-carte { margin: 0; }
#acces .porte .porte-carte h1 { margin: 0 0 28px; font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--p-encre); }

/* ---------------- pages ouvertes depuis un e-mail (/confirmer-adresse, /reinitialiser-mot-de-passe) et écran « et maintenant ? » (web/liens.js) */
#acces .porte .lien-ico { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0 0 20px; border-radius: 50%; }
#acces .porte .lien-ico.bon { background: var(--p-vert-fond); color: var(--p-vert); }
#acces .porte .lien-ico.attention { background: var(--p-rouge-fond); color: var(--p-orange); }
#acces .porte .lien-ico.neutre { background: var(--p-fond); color: var(--p-violet); }
#acces .porte .lien-carte h1:focus-visible, #acces .porte #ins-reussite h2:focus-visible { outline: none; }
#acces .porte .lien-texte { margin: 0 0 16px; font-size: 15px; line-height: 1.5; color: var(--p-encre); }
#acces .porte .lien-carte form { margin-top: 24px; }
#acces .porte .lien-carte .champ { margin-bottom: 40px; }
#acces .porte .lien-actions { display: grid; gap: 12px; margin-top: 24px; }
#acces .porte .lien-retour { margin-top: 16px; text-align: center; }
#acces .porte .go.second { background: var(--p-carte); color: var(--p-encre); border: 1px solid var(--p-bord); }
#acces .porte .go.second:hover:not(:disabled) { background: var(--p-fond); }
#acces .porte .go.second:disabled { background: var(--p-fond); color: var(--p-encre-3); cursor: default; }
#acces .porte .go.second.charge .go-rond { border-color: rgba(10,37,64,.25); border-top-color: var(--p-encre); }
#acces .porte .lien-etapes { margin: 0 0 8px; padding-left: 22px; font-size: 15px; line-height: 1.5; color: var(--p-encre); }
#acces .porte .lien-etapes li { margin-bottom: 8px; }
#acces .porte #ins-reussite .lien-ico { margin-bottom: 16px; }
#acces .porte .lien-renvoi { margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--p-filet); }
#acces .porte .lien-renvoi .lien-texte:empty { display: none; }
#acces .porte .lien-renvoi .msg { margin-top: 12px; }
#acces .porte .lien-suite { margin: 20px 0 0; padding-top: 20px; border-top: 1px solid var(--p-filet); }
#acces .porte .lien-suite .go { margin-top: 4px; }
