/* Dedicated authentication/bootstrap shell for cloud runtimes.
   Feature-local styles only: official tokens and components remain canonical.
   2026-10-08 — identité V3 (css/v3/tokens.css) : canevas, carte 24 px à bande marine portant le mot-symbole V3
   (même rendu que la barre latérale), typographie et proportions des contrôles V3. Aucun changement de balisage
   fonctionnel : formulaire, messages et états restent ceux de l'authentification existante. */

.cloudAccessShell[hidden],
.cloudAccessShell [hidden]{
  display:none!important;
}

/* Dimensions stables (2026-10-08) : la carte est une grille à rangées constantes — logo, surtitre, titre
   (une ligne), message (hauteur réservée) et une case d'étape de hauteur FIXE que partagent le chargement, le
   formulaire, le panneau organisation et la déconnexion. Quel que soit l'état affiché, la carte garde la même
   taille : 320 px reservent le formulaire de connexion enrichi et les etapes activation/recuperation, tandis que
   les etats plus courts conservent la meme geometrie sans deplacement des controles. */

.cloudAccessShell{
  position:fixed;
  z-index:10000;
  inset:0;
  display:grid;
  place-items:center;
  min-width:0;
  min-height:100vh;
  padding:var(--fi-space-4xl);
  overflow:auto;
  background:var(--v3-home-canvas);
  color:var(--v3-home-ink);
  font-family:var(--v3-font);
}

/* Bande marine de 104 px en tête de carte : le mot-symbole V3 y est posé comme dans la barre latérale. */
.cloudAccessShell__card.fi-card{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto auto auto auto 320px;
  align-content:start;
  width:min(440px,100%);
  padding:30px 36px 36px;
  border:1px solid var(--v3-home-line);
  border-radius:var(--v3-home-radius-shell);
  background:linear-gradient(180deg,var(--v3-home-shell) 0,var(--v3-home-shell-strong) 104px,var(--v3-home-surface) 104px);
  box-shadow:0 24px 60px rgba(31,42,74,.10);
}

.cloudAccessShell__wordmark{
  display:block;
  width:min(184px,58vw);
  height:auto;
}

.cloudAccessShell__eyebrow{
  margin:56px 0 6px;
  color:var(--v3-home-blue);
  font-size:var(--fi-text-sm2);
  font-weight:750;
  letter-spacing:.12em;
  text-transform:uppercase;
}

.cloudAccessShell h1{
  margin:0;
  color:var(--v3-home-ink);
  font-family:var(--v3-font);
  font-size:var(--v3-text-title);
  font-weight:800;
  line-height:1.2;
  letter-spacing:-.03em;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.cloudAccessShell__message{
  box-sizing:border-box;
  height:62px;
  margin:8px 0 0;
  overflow-y:auto;
  overflow-wrap:anywhere;
  scrollbar-width:thin;
  border:1px solid transparent;
  color:var(--v3-home-muted);
  font-size:var(--v3-text-label);
  line-height:1.5;
}

/* Contrôles aux proportions V3 (composants officiels conservés : états focus/survol/désactivé inchangés). */
.cloudAccessShell .fi-field__label{color:var(--v3-home-muted);font-size:var(--fi-text-sm2);font-weight:700}
.cloudAccessShell .fi-input.fi-input,
.cloudAccessShell .fi-select.fi-select{height:44px;min-height:44px;border-radius:var(--v3-home-radius-md);font-family:var(--v3-font);font-size:var(--v3-text-label)}
.cloudAccessShell .fi-button.fi-button{height:44px;min-height:44px;border-radius:999px;font-family:var(--v3-font);font-size:var(--v3-text-button);font-weight:750}

/* Écrans de lien (activation, récupération, lien invalide/expiré/utilisé) : message affiché en entier, sans défilement
   interne — la hauteur réservée (62 px) reste un minimum ; la carte, puis la fenêtre compacte, suivent. */
html:is([data-cloud-ux-state="AUTH_LINK_ERROR"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"]) .cloudAccessShell__message{height:auto;min-height:62px;overflow:visible}

.cloudAccessShell__message[data-kind="error"]{
  padding:8px 12px;
  border:1px solid var(--fi-danger-line);
  border-radius:var(--v3-home-radius-md);
  background:var(--fi-danger-soft);
  color:var(--fi-danger);
}

.cloudAccessShell__loading,
.cloudAccessShell__form,
.cloudAccessShell__organization,
.cloudAccessShell__signout{
  grid-row:5;
  grid-column:1;
  margin-top:20px;
}
.cloudAccessShell__form,
.cloudAccessShell__organization{ align-self:start; }
.cloudAccessShell__loading{ align-self:center; justify-self:center; }

.cloudAccessShell__form,
.cloudAccessShell__organization{
  display:flex;
  flex-direction:column;
  gap:var(--fi-space-xl);
}

.cloudAccessShell__form .fi-button,
.cloudAccessShell__organization .fi-button{
  width:100%;
}

.cloudAccessShell__signout.fi-button{
  align-self:end;
  width:100%;
}
/* Chargement (formulaire masqué) avec Déconnexion : l'indicateur et le bouton forment un seul groupe centré dans
   l'espace de la carte, au lieu d'être écartés aux deux extrémités. Hauteur de carte inchangée entre connexion et
   chargement : aucun redimensionnement de fenêtre après l'authentification. */
.cloudAccessShell__card:has(.cloudAccessShell__signout:not([hidden])) .cloudAccessShell__loading:not([hidden]){ transform:translateY(-32px); }
.cloudAccessShell__card:has(.cloudAccessShell__loading:not([hidden])) .cloudAccessShell__signout.fi-button:not([hidden]){ align-self:center; transform:translateY(17px); }

html[data-cloud-ux-state]:not([data-cloud-ux-state="READY"]):not([data-cloud-ux-state="LOCAL"]) body>.topbar,
html[data-cloud-ux-state]:not([data-cloud-ux-state="READY"]):not([data-cloud-ux-state="LOCAL"]) body>#workspaceHome,
html[data-cloud-ux-state]:not([data-cloud-ux-state="READY"]):not([data-cloud-ux-state="LOCAL"]) body>#clientWorkspace{
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

@media (max-width:600px){
  .cloudAccessShell{
    align-items:start;
    padding:var(--fi-space-xl);
  }

  .cloudAccessShell__card.fi-card{
    margin-block:var(--fi-space-xl);
    padding:26px 22px 28px;
  }

  .cloudAccessShell h1{
    display:-webkit-box;
    height:2.4em;
    white-space:normal;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:2;
  }
}

@media (prefers-reduced-motion:reduce){
  .cloudAccessShell,
  .cloudAccessShell__card{
    scroll-behavior:auto;
  }
}

/* Écran de connexion compact (fenêtre réduite à la carte) : aucun fond autour de la carte, seuls ses coins arrondis
   laissent voir le bureau. État lu directement dans le DOM (formulaire de connexion affiché, ou premier chargement avant l’affichage de
   l’application : data-access-initial, retiré par js/app.js), donc appliqué et retiré
   sans délai. La carte sert aussi de poignée de déplacement ; les champs et boutons restent cliquables. */
html:has(#cloudRuntimePendingState:not([hidden])):is([data-access-initial], [data-cloud-ux-state="AUTHENTICATING"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"], [data-cloud-ux-state="AUTH_LINK_ERROR"], :has(#cloudAuthForm:not([hidden]))),
html:has(#cloudRuntimePendingState:not([hidden])):is([data-access-initial], [data-cloud-ux-state="AUTHENTICATING"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"], [data-cloud-ux-state="AUTH_LINK_ERROR"], :has(#cloudAuthForm:not([hidden]))) body{min-width:0;background:transparent;overflow:hidden}
html:has(#cloudRuntimePendingState:not([hidden])):is([data-access-initial], [data-cloud-ux-state="AUTHENTICATING"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"], [data-cloud-ux-state="AUTH_LINK_ERROR"], :has(#cloudAuthForm:not([hidden]))) body > :not(.cloudAccessShell):not(.fi-session-security):not(.appWindowChrome):not(#devTestModeBanner):not(script):not(style){display:none}
html:has(#cloudRuntimePendingState:not([hidden])):is([data-access-initial], [data-cloud-ux-state="AUTHENTICATING"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"], [data-cloud-ux-state="AUTH_LINK_ERROR"], :has(#cloudAuthForm:not([hidden]))) .cloudAccessShell{inset:var(--login-compact-offset,0px) 0 0 0;min-height:0;padding:0;place-items:start stretch;overflow:hidden;background:transparent}
html:has(#cloudRuntimePendingState:not([hidden])):is([data-access-initial], [data-cloud-ux-state="AUTHENTICATING"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"], [data-cloud-ux-state="AUTH_LINK_ERROR"], :has(#cloudAuthForm:not([hidden]))) .cloudAccessShell__card.fi-card{width:100%;margin:0;border:0;box-shadow:none;-webkit-app-region:drag}
html:has(#cloudRuntimePendingState:not([hidden])):is([data-access-initial], [data-cloud-ux-state="AUTHENTICATING"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"], [data-cloud-ux-state="AUTH_LINK_ERROR"], :has(#cloudAuthForm:not([hidden]))) .cloudAccessShell__card :is(form,input,button,select,label,a,.fi-field){-webkit-app-region:no-drag}
html:has(#cloudRuntimePendingState:not([hidden])):is([data-access-initial], [data-cloud-ux-state="AUTHENTICATING"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"], [data-cloud-ux-state="AUTH_LINK_ERROR"], :has(#cloudAuthForm:not([hidden]))) .appWindowChrome .appWindowChrome__button{color:#fff}
html:has(#cloudRuntimePendingState:not([hidden])):is([data-access-initial], [data-cloud-ux-state="AUTHENTICATING"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"], [data-cloud-ux-state="AUTH_LINK_ERROR"], :has(#cloudAuthForm:not([hidden]))) .appWindowChrome [data-window-action="toggle-maximize"]{display:none}
html:has(#cloudRuntimePendingState:not([hidden])):is([data-access-initial], [data-cloud-ux-state="AUTHENTICATING"], [data-cloud-ux-state="RECOVERY_REQUEST"], [data-cloud-ux-state="PASSWORD_SETUP"], [data-cloud-ux-state="AUTH_LINK_ERROR"], :has(#cloudAuthForm:not([hidden]))) #devTestModeBanner{position:fixed;top:0;left:0;right:0;margin:0;padding-inline-end:76px;font-size:var(--fi-text-sm)}
