/* ===== LOGIN GATE ===== */
.gate{position:fixed;inset:0;z-index:90;background:var(--bg);display:flex;align-items:center;justify-content:center;padding:24px}
.gate-card{width:100%;max-width:340px;background:var(--sf);border:1px solid var(--bd);border-radius:16px;padding:28px 22px;display:flex;flex-direction:column;gap:11px;box-shadow:0 10px 40px rgba(0,0,0,.08);animation:gateCard .5s cubic-bezier(.2,.8,.2,1)}
.gate{animation:gateBg .35s ease}
@keyframes gateBg{from{opacity:0}to{opacity:1}}
@keyframes gateCard{from{opacity:0;transform:translateY(14px) scale(.975)}to{opacity:1;transform:none}}
.g-load{display:none;justify-content:center;align-items:center;padding:36px 0}
/* Le voyant de chargement ne vise plus `.gate-card` : l'ecran de connexion
   est passe a `.gate-sheet`, et `#i2`, `#i3` et `#mdp` gardent `.gate-card`.
   Une seule regle pour les deux formes, `g-loading` n'etant pose que la. */
.g-loading .g-load{display:flex}
.g-loading .g-form{display:none}
.g-spin{width:26px;height:26px;border:2.5px solid var(--b2);border-top-color:var(--ac);border-radius:50%;animation:gSpin .7s linear infinite}
@keyframes gSpin{to{transform:rotate(360deg)}}
.g-form{display:flex;flex-direction:column;gap:11px;animation:gForm .5s cubic-bezier(.2,.8,.2,1) both}
@keyframes gForm{from{opacity:0;transform:translateY(12px) scale(.985)}to{opacity:1;transform:none}}
.gate .f{padding:11px}
.gate .bt{margin-top:2px}
.gate-alt{border:none;background:none;color:var(--t2);font-size:12px;cursor:pointer;padding:5px;font-family:var(--body)}
.gate-alt:active{color:var(--ink)}
.gate-err{background:#FCEAE6;color:#6F1810;border-radius:8px;padding:9px 11px;font-size:12px;line-height:1.4}
.gate-ok{background:#E6F5ED;color:#085830;border-radius:8px;padding:9px 11px;font-size:12px;line-height:1.4}
[data-dark="1"] .gate-err{background:#281410;color:#F5A090}[data-dark="1"] .gate-ok{background:#12251A;color:#70D8A0}
@media(prefers-color-scheme:dark){.gate-err{background:#281410;color:#F5A090}.gate-ok{background:#12251A;color:#70D8A0}}

/* ===== L'ECRAN DE CONNEXION : BANDEAU DE MARQUE + FEUILLE ================ */

/* La carte centree a 340 px flottait au milieu d'un fond vide : sur un
   telephone, un ecran qui n'a qu'une chose a faire n'a pas besoin d'un cadre
   pour le dire. Le bandeau porte la marque, la feuille porte le formulaire,
   et la feuille defile — c'est elle qui empeche le clavier iOS de recouvrir
   le bouton principal.

   `.gate-v9` ne s'applique qu'a `#gate`. `#i2`, `#i3` et `#mdp` reutilisent
   `.gate` nu, donc le plein ecran et le centrage : ne rien ecrire sur `.gate`
   seul ici, sous peine de les deplacer tous les trois.

   Le bleu nuit du bandeau est le meme en clair et en sombre — c'est la
   couleur de la marque, pas une couleur de theme. Il porte malgre tout son
   propre jeton : une valeur ecrite en dur dans trois regles finit par n'etre
   corrigee que dans deux. */
:root{--gate-brand:#0C1A2B;--gate-brand-t2:#9AA6B4}

.gate.gate-v9{display:flex;flex-direction:column;align-items:stretch;
  justify-content:flex-start;padding:0;background:var(--gate-brand)}
/* Le bandeau porte sa couleur lui-meme et ne compte pas sur celle de
   `.gate-v9` : au-dela de 800 px le fond redevient celui de la page, et le
   bandeau s y serait retrouve en blanc sur clair, donc illisible. */
.gate-band{flex:0 0 auto;min-height:30vh;background:var(--gate-brand);
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:9px;color:#fff;text-align:center;
  padding:calc(env(safe-area-inset-top) + 30px) 24px 44px}
.gate-mark{display:block;color:#fff}
.gate-nm{font-family:var(--mono);font-weight:700;font-size:23px;letter-spacing:.16em}
.gate-tg{font-size:13px;color:var(--gate-brand-t2)}

.gate-sheet{flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
  background:var(--sf);border-radius:22px 22px 0 0;margin-top:-22px;
  padding:24px 24px calc(env(safe-area-inset-bottom) + 28px);
  animation:gateCard .5s cubic-bezier(.2,.8,.2,1)}
.gate-v9 .g-form{display:flex;flex-direction:column;gap:0}
.gate-h{font-family:var(--body);font-size:18px;font-weight:600;color:var(--ink);
  margin:0 0 16px}

/* Un champ : l'icone est posee dessus, le texte lui laisse la place. */
.gate-ch{position:relative;display:block}
.gate-ch+.gate-ch{margin-top:10px}
.gate-ic{position:absolute;left:13px;top:50%;transform:translateY(-50%);
  width:18px;height:18px;color:var(--t3);pointer-events:none}
.gate-v9 .f{height:44px;padding:0 14px 0 40px;border:1px solid var(--bd);
  border-radius:10px;background:var(--fi);
  /* 16 px : en dessous, Safari zoome sur le champ des la mise au point et
     l'ecran part de travers. */
  font-size:16px}
.gate-v9 .f.f-oeil{padding-right:46px}
.gate-v9 .f:focus{outline:none;border-color:var(--ink)}
.gate-v9 .f.f-no{border-color:var(--no)}
.gate-oeil{position:absolute;top:0;right:0;height:44px;width:44px;
  display:flex;align-items:center;justify-content:center;
  background:none;border:0;cursor:pointer;color:var(--t3);padding:0}
.gate-oeil svg{width:19px;height:19px}
.gate-oeil.vu{color:var(--bl-ink)}

/* L'erreur d'un champ se pose sous ce champ : posee ailleurs, elle oblige a
   la relire pour savoir quoi corriger. Seules celles qui ne visent aucun
   champ — identifiants refuses, serveur injoignable — restent en bandeau. */
.gate-fe{font-size:12.5px;color:var(--no-ink);margin:6px 2px 0;line-height:1.4}
.gate-v9 .gate-err,.gate-v9 .gate-ok{margin-top:14px}
.gate-go{margin-top:18px;height:46px;padding:0;font-size:15px;border-radius:10px}

.gate-row{display:flex;align-items:center;justify-content:space-between;
  gap:12px;margin-top:12px}
.gate-v9 .gate-alt{padding:4px 0;font-size:13px}
.gate-alt-f{color:var(--ink);font-weight:500}
.gate-sep{height:1px;background:var(--bd);margin:20px 0 16px}
.gate-guest{width:100%;text-align:center;font-size:13.5px}
.gate-note{margin:4px 0 0;text-align:center;font-size:11px;color:var(--t2);
  line-height:1.45}

/* Au-dela de 800 px de large ET de 500 px de haut, la pleine hauteur n'a plus
   de sens : les deux blocs redeviennent une colonne posee au milieu. La
   double condition suit celle de la coquille — en changer une seule laisse un
   trou ou aucune des deux mises en page ne s'applique. */
@media(min-width:801px) and (min-height:501px){
  .gate.gate-v9{background:var(--bg);align-items:center;justify-content:center;padding:24px}
  .gate-band{width:100%;max-width:420px;min-height:0;
    padding:38px 24px 46px;border-radius:18px 18px 0 0}
  .gate-sheet{width:100%;max-width:420px;flex:0 0 auto;overflow:visible;
    border-radius:22px;box-shadow:var(--sh2);padding-bottom:26px}
}

/* Ecran court — iPhone en paysage, 812 x 375 : le bandeau prendrait un tiers
   d'une hauteur qui manque deja. Il se couche, la feuille recupere la place. */
@media(max-height:500px){
  .gate-band{min-height:0;flex-direction:row;gap:12px;
    padding:calc(env(safe-area-inset-top) + 14px) 24px 30px}
  .gate-mark{width:24px;height:24px}
  .gate-nm{font-size:19px}
  .gate-tg{font-size:12px}
}
