/* Pages d'accès (connexion, invitation) : un panneau de marque — une scène
   en papier découpé (l'arche, sa clé de voûte, la fiche du projet, une
   bulle, un document) et une phrase — puis le formulaire. Sous 860 px, la
   marque devient un bandeau court : le formulaire tient dans le premier
   écran. Le seul détail en or de l'écran : le filet du pied.
   Jetons et composants : app.css (surchargés ici, scope body.acces). */
/* Pas de barre d'onglets sur la connexion et l'invitation : rien à réserver en bas d'écran (app.css la prévoit pour le back-office). */
body { --onglets-h: 0px; }
body.acces { min-height: 100vh; min-height: 100dvh; }
.acces-cadre { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }

/* ── Papier : teintes, grain, ombre (clair puis sombre) ── */

.acces {
  --pap-1: #ffffff; --pap-2: #e8ebef; --pap-3: #dce0e6; --pap-socle: #cfd4db;
  --pap-granit: #2a2f37; --pap-cle: #2638c8; --pap-trait: #c9ced6; --pap-trait-lapis: #aeb6ee;
  --pap-ombre: rgba(22, 26, 33, 0.34);
  --pap-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .09 0 0 0 0 .1 0 0 0 0 .13 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .acces {
    --pap-1: #4b5361; --pap-2: #434a57; --pap-3: #3b424e; --pap-socle: #58616f;
    --pap-granit: #c9ced6; --pap-cle: #5f6cf0; --pap-trait: #3d4552; --pap-trait-lapis: #4b56b8;
    --pap-ombre: rgba(0, 0, 0, 0.62);
    --pap-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)'/%3E%3C/svg%3E");
  }
}
:root[data-theme="dark"] .acces {
  --pap-1: #4b5361; --pap-2: #434a57; --pap-3: #3b424e; --pap-socle: #58616f;
  --pap-granit: #c9ced6; --pap-cle: #5f6cf0; --pap-trait: #3d4552; --pap-trait-lapis: #4b56b8;
  --pap-ombre: rgba(0, 0, 0, 0.62);
  --pap-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ── Panneau de marque ── */

.acces-marque {
  position: relative; display: flex; flex-direction: column; gap: var(--space-6);
  padding: var(--space-12); background: var(--calcaire); border-right: 1px solid var(--joint); min-width: 0;
}
.acces-marque > .logo { height: 24px; width: auto; align-self: flex-start; flex: none; }
/* Scene and words sit together in the middle; the footer keeps to the bottom. */
.acces-scene { margin-top: auto; }
.acces-pied { margin-top: auto; }
.acces-marque .logo .ns-cle { animation: ns-pose var(--duree-base) var(--courbe-rebond) 160ms both; }
.acces-scene { display: grid; place-items: center; min-height: 0; align-self: stretch; }
.acces-texte { display: flex; flex-direction: column; gap: var(--space-4); max-width: 460px; }
.acces-devise { font-family: var(--font-titre); font-size: 30px; line-height: 38px; font-weight: 800; letter-spacing: -0.015em; text-wrap: balance; }
.acces-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); color: var(--schiste); font-size: 16px; line-height: 24px; }
.acces-points li { display: flex; align-items: center; gap: var(--space-3); }
/* Small paper chips echo the three pieces of the scene. */
.acces-puce { position: relative; width: 22px; height: 16px; flex: none; border-radius: 3px; background: var(--pap-grain), var(--surface);
  box-shadow: 0 0 0 1px var(--joint), 0 2px 3px var(--pap-ombre); }
.acces-puce.puce-fiche::after { content: ""; position: absolute; left: 4px; top: 6px; width: 5px; height: 4px; background: var(--pap-cle); border-radius: 1px; }
.acces-puce.puce-bulle { border-radius: 5px 5px 5px 1px; }
.acces-puce.puce-doc { width: 16px; height: 20px; margin: 0 3px; border-radius: 2px; }
.acces-puce.puce-doc::after { content: ""; position: absolute; right: 0; top: 0; width: 6px; height: 6px; background: var(--joint); clip-path: polygon(0 0, 100% 100%, 0 100%); }
.filet-pyrite { display: block; width: 40px; height: 2px; background: var(--pyrite); }
.acces-pied { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; }

/* ── La scène ── */

.pap-scene { position: relative; width: min(100%, 480px, 62vh); aspect-ratio: 480 / 360; container-type: inline-size;
  perspective: 150cqw; --k: 1; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.pap-plateau { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.pf { position: absolute; transform-style: preserve-3d; pointer-events: none;
  transform: translateZ(calc(var(--z) * var(--k) * 1.1cqw));
  transition: transform var(--duree-moyenne) var(--courbe-entree); transition-delay: calc(var(--i, 0) * 14ms); }
.pf > .pc, .pf > .ps, .pf > .ps > i { position: absolute; inset: 0; display: block; }
.pf > .pc, .pf > .ps > i { clip-path: var(--clip, none); border-radius: var(--r, 0); }
.pf > .pc { background: var(--pap-grain), var(--col, var(--pap-1)); overflow: hidden; }
/* The cast shadow: a blurred copy of the sheet, pushed down as the sheet lifts. */
.pf > .ps > i { background: var(--pap-ombre); }
.pf > .ps { filter: blur(calc(0.6px + var(--z) * 0.22cqw)); opacity: 0.55;
  transform: translate3d(0, calc(0.15cqw + var(--z) * var(--k) * 0.22cqw), 0);
  transition: transform var(--duree-moyenne) var(--courbe-entree), opacity var(--duree-moyenne) var(--courbe-entree); }
.pap-socle { --col: var(--pap-socle); }
.pap-pierre.t1 { --col: var(--pap-1); }
.pap-pierre.t2 { --col: var(--pap-2); }
.pap-pierre.t3 { --col: var(--pap-3); }
.pap-pierre.granit { --col: var(--pap-granit); }
.pap-fiche { --col: var(--pap-1); }
.pap-fiche > .pc { display: flex; flex-direction: column; gap: 9%; padding: 0 0 12%; }
.pap-fiche-tete { display: block; height: 16%; background: var(--pap-3); }
.pap-fiche-pas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6%; padding: 0 12%; }
.pap-fiche-pas b { display: block; aspect-ratio: 1; border-radius: 12%; background: var(--pap-2); }
.pap-fiche-pas b.fait { background: var(--pap-trait); }
.pap-fiche-pas b.cours { background: var(--pap-trait-lapis); }
.pap-ligne { display: block; height: 6%; margin: 0 12%; border-radius: 99px; background: var(--pap-trait); }
.pap-ligne.courte { margin-right: 40%; }
.pap-bulle { --col: var(--pap-1); }
.pap-bulle > .pc { display: flex; flex-direction: column; justify-content: center; gap: 14%; overflow: visible; }
.pap-bulle .pap-ligne { height: 9%; margin: 0 14%; }
.pap-bulle .pap-ligne.courte { margin-right: 44%; }
.pap-doc { --col: var(--pap-1); }
.pap-doc > .pc { display: flex; flex-direction: column; justify-content: flex-end; gap: 10%; padding-bottom: 22%; }
.pap-doc .pap-ligne { height: 5%; margin: 0 16%; }
.pap-coin { --col: var(--pap-3); }

/* The keystone waits above its place; it settles once the form is ready. */
.pap-cle { --col: var(--pap-cle); --cy: 0cqw; --cr: 0deg;
  transform: translateZ(calc(var(--z) * var(--k) * 1.1cqw)) translate3d(0, var(--cy), 0) rotate(var(--cr));
  transition: transform 520ms var(--courbe-rebond); transition-delay: 0ms; }
.pap-scene[data-cle="levee"] .pap-cle { --cy: -9cqw; --cr: -7deg; transition: transform var(--duree-moyenne) var(--courbe-entree); }
.pap-scene[data-cle="levee"] .pap-cle > .ps { transform: translate3d(0, 7cqw, 0); opacity: 0.45; }
.pap-scene[data-cle="appui"] .pap-cle { --cy: 0.6cqw; transition-duration: var(--duree-instant); }
.pap-scene.pap-refus .pap-cle > .pc { animation: pap-refus 360ms var(--courbe-standard); }
@keyframes pap-refus { 20% { transform: translateX(-4%); } 45% { transform: translateX(4%); } 70% { transform: translateX(-2%); } }

@media (hover: hover) { .acces-marque:hover .pap-scene { --k: 2; } }
.pap-scene.vive { --k: 2; }

/* ── Formulaire ── */

.acces-zone { display: grid; place-items: center; padding: var(--space-12) var(--space-6); background: var(--surface); min-width: 0; }
.acces-carte { width: min(420px, 100%); display: flex; flex-direction: column; gap: var(--space-5); }
.acces-carte > header { display: flex; flex-direction: column; gap: var(--space-2); }
.acces-carte h1 { font-size: 32px; line-height: 38px; overflow-wrap: anywhere; }
.acces-carte .chapo { color: var(--schiste); font-size: 16px; line-height: 24px; }
.acces-carte form { display: flex; flex-direction: column; gap: var(--space-5); }
.acces .input { min-height: 48px; font-size: 16px; padding: 11px var(--space-4); background: var(--surface); }
.acces .input[aria-invalid="true"] { border-color: var(--erreur); box-shadow: inset 0 0 0 1px var(--erreur); }
.acces .input[aria-invalid="true"]:focus-visible { outline-color: var(--erreur); }
.acces-carte .btn-lg { width: 100%; min-height: 52px; }
.acces-aide { padding-top: var(--space-4); border-top: 1px solid var(--joint); font-size: 14px; line-height: 22px; color: var(--schiste); }
.acces-aide a { font-weight: 600; }
.acces-fiche { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-1) var(--space-4); padding: var(--space-4);
  background: var(--calcaire); border: 1px solid var(--joint); border-left: 3px solid var(--lapis); border-radius: var(--radius-sm);
  font-size: 14px; line-height: 22px; }
.acces-fiche dt { color: var(--schiste); }
.acces-fiche dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }

/* Field errors and the summary: an icon, a sentence that says what to do. */
.acces .champ-message::before, .acces-majuscules::before { content: ""; width: 16px; height: 16px; margin-top: 2px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4M12 16h.01'/%3E%3C/svg%3E") center / contain no-repeat; }
.acces-majuscules:not([hidden]) { display: flex; gap: var(--space-2); align-items: flex-start; color: var(--alerte); font-weight: 500; }
.acces .encart { padding: var(--space-3) var(--space-4); border-left: 3px solid currentColor; animation: acces-entre var(--duree-base) var(--courbe-entree); }
.acces .encart > .ico { margin-top: 2px; }
.acces .encart b { font-weight: 600; }
.acces .encart .encart-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acces .encart .encart-texte span { color: var(--granit); }
@keyframes acces-entre { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Password with a show / hide button sitting inside the field. */
.mdp { position: relative; }
.mdp .input { padding-right: 56px; }
.mdp-voir {
  position: absolute; top: 2px; right: 2px; width: 44px; height: 44px; display: inline-flex;
  align-items: center; justify-content: center; border: 0; border-radius: var(--radius-sm); background: transparent;
  color: var(--schiste); cursor: pointer;
  transition: background-color var(--duree-rapide) var(--courbe-standard), color var(--duree-rapide) var(--courbe-standard), transform 180ms var(--courbe-rebond);
}
.mdp-voir:hover { background: var(--pierre); color: var(--granit); }
.mdp-voir:active { transform: scale(0.94); transition-duration: var(--duree-instant); }
.mdp-voir:focus-visible { outline: 2px solid var(--anneau-focus); outline-offset: -2px; }
.mdp-voir[aria-pressed="true"] { color: var(--lapis); }
.mdp-voir .ico-cache { display: none; }
.mdp-voir[aria-pressed="true"] .ico-voit { display: none; }
.mdp-voir[aria-pressed="true"] .ico-cache { display: block; }
.champ-tete { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); }

/* Busy and suspended: the frozen-width button of app.css, made explicit. */
.acces .btn[aria-disabled="true"] { opacity: 0.45; }
.acces .btn-primaire[aria-busy="true"] { background: var(--lapis-profond); }

/* Strength: four stones, laid as the password grows. */
.solidite { display: flex; align-items: center; gap: var(--space-3); min-height: 20px; }
.solidite-pierres { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; width: 112px; flex: none; }
.solidite-pierres span { height: 6px; background: var(--pierre); border-radius: 1px; transform-origin: left;
  transition: background-color var(--duree-rapide) var(--courbe-standard); }
.solidite[data-niveau="1"] .solidite-pierres span:nth-child(-n+1) { background: var(--erreur); }
.solidite[data-niveau="2"] .solidite-pierres span:nth-child(-n+2) { background: var(--alerte); }
.solidite[data-niveau="3"] .solidite-pierres span:nth-child(-n+3) { background: var(--succes); }
.solidite[data-niveau="4"] .solidite-pierres span { background: var(--succes); }
.solidite-texte { font-size: 13px; line-height: 20px; color: var(--schiste); }

.compte-a-rebours { font-variant-numeric: tabular-nums; font-weight: 600; }
.acces-succes { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.acces-succes-anim { width: 96px; height: 96px; }
.acces-succes-anim:empty { display: none; }

/* ── Petits écrans : la marque devient un bandeau court ── */

@media (max-width: 860px) {
  .acces-cadre { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  /* Clear space around the logotype: at least the height of its n (20 px). */
  .acces-marque { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: var(--space-5) var(--space-4);
    padding: var(--space-5) var(--space-4) var(--space-4); border-right: 0; border-bottom: 1px solid var(--joint); align-items: center; }
  .acces-marque > .logo { height: 20px; grid-column: 1; grid-row: 1; }
  .acces-scene { grid-column: 2; grid-row: 1 / span 2; margin: 0; align-self: center; }
  .acces-pied { margin: 0; }
  .pap-scene { width: 132px; }
  .pap-bulle, .pap-doc, .pap-coin { display: none; }
  .acces-texte { grid-column: 1; grid-row: 2; gap: 0; }
  .acces-devise { font-size: 19px; line-height: 25px; }
  .acces-points, .acces-pied { display: none; }
  .acces-zone { place-items: start center; padding: var(--space-6) var(--space-4) var(--space-12); }
  .acces-carte { gap: var(--space-4); }
  .acces-carte form { gap: var(--space-4); }
  .acces-carte h1 { font-size: 26px; line-height: 32px; }
  .acces-carte .chapo { font-size: 15px; line-height: 22px; }
}
@media (max-width: 360px) {
  .pap-scene { width: 104px; }
  .acces-devise { font-size: 17px; line-height: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .acces-marque .logo .ns-cle, .acces .encart, .pap-scene.pap-refus .pap-cle > .pc { animation: none; }
  .pf, .pf > .ps, .pap-cle { transition: none; }
  .pap-scene[data-cle] .pap-cle { --cy: 0cqw; --cr: 0deg; }
  .pap-scene[data-cle] .pap-cle > .ps { transform: translate3d(0, 1cqw, 0); opacity: 0.55; }
  .pap-scene, .acces-marque:hover .pap-scene { --k: 1; }
  .mdp-voir:active { transform: none; }
}
@media (forced-colors: active) {
  .pap-scene { display: none; }
}
