/* ════════════════════════════════════════════════════════════════════════════
   LA PORTE — skin « Le Grand Registre ».
   Intégration des rendus Claude Design visés au gate G1 (24/08/2026), projet
   « Écran Décider ANSEMOK OS » : Porte.dc.html (bureau 1440, panneaux d'état,
   téléphone 390) et PortePad.dc.html (iPad 1194, Face ID, clavier à l'écran).

   TROIS COMPOSITIONS, pas un responsive étiré — doctrine devices du 24/08 :
     consulter = iPhone · piloter = iPad (le device CENTRAL) · opérer = MacBook.
     · < 768   POCHE   : emblème en tête sur papier, formulaire sur carte, fleuve en pied.
     · 768-1279 PAD    : barre EN HAUT (doctrine nav), grille 55/45, cibles 56-60 px.
     · ≥ 1280  BUREAU  : pas de barre, grille 60/40, fleuve traversant à gauche.

   Toutes les couleurs viennent de /brand/tokens.css (@ansemok/brand-tokens).
   Aucune valeur de marque n'est écrite ici : une seule en dur = une dérogation G1.
   Matérialité papier : zéro ombre portée, zéro dégradé, zéro effet de verre.
   ════════════════════════════════════════════════════════════════════════════ */

.porte {
  min-height: 100vh;
  min-height: 100dvh;              /* iOS : la barre d'URL ne doit pas rogner le bouton */
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  display: flex;
  flex-direction: column;
}

/* ── L'emblème et le fleuve — le fleuve est un AXE, jamais un ornement ────── */
.porte-embleme { display: block; }
.porte-embleme path { stroke: var(--text); fill: none; }
.porte-embleme circle { fill: var(--ocre); }
.porte-fleuve path { stroke: var(--ocre); fill: none; stroke-width: 1.5; }

.porte-marque {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: .16em;
  line-height: 1;
  color: var(--text);
}
.porte-baseline {
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint);
}
.porte-lieux {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ── Le volet de saisie ───────────────────────────────────────────────────── */
.porte-volet {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}
.porte-titre {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  margin: 0;
}
.porte-sous {
  font-size: 13px;
  color: var(--faint);
  margin-top: var(--space-2);
}

.porte-champ { display: flex; flex-direction: column; gap: var(--space-2); }
.porte-champ label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--text);
}
.porte-champ input {
  box-sizing: border-box;
  width: 100%;
  padding: 0 14px;
  background: var(--bg-input);
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-input);
  font-family: var(--font-body);
  color: var(--text);
  outline: none;
}
/* Le focus épaissit le filet en ocre — et compense au padding pour que rien ne bouge. */
.porte-champ input:focus-visible {
  border: 2px solid var(--ocre);
  padding: 0 13px;
}
.porte-champ input[aria-invalid="true"] { border-color: var(--terre); }
.porte-champ input::placeholder { color: var(--faint); }

.porte-entrer {
  width: 100%;
  background: var(--text);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-button);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: .06em;
  cursor: pointer;
}
.porte-entrer:hover:not(:disabled) { background: var(--ink-hover); }
.porte-entrer:focus-visible { outline: 2px solid var(--ocre); outline-offset: 2px; }
.porte-entrer:disabled { opacity: .55; cursor: default; }

.porte-secondaire {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  color: var(--ocre-ink);
  cursor: pointer;
  text-align: left;
}
.porte-secondaire:hover { color: var(--text); }
.porte-secondaire:focus-visible { outline: 2px solid var(--ocre); outline-offset: 2px; }

/* ── Les deux états d'échec, distincts — c'est tout l'objet du rendu G1 ─────
   « Le service d'identité est injoignable » ≠ « identifiants incorrects ».
   Le premier est un PANNEAU (encadré, filet de vigilance à gauche) : la faute
   n'est pas à l'utilisateur, il n'a rien à corriger. Le second est un FEU sous
   les champs : pastille + libellé, jamais la couleur seule. ────────────────── */
.porte-panne {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  border: 1px solid var(--hair-strong);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius-card);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}
.porte-panne .pastille {
  width: 10px; height: 10px;
  border-radius: var(--radius-card);
  background: var(--warn);
  flex: 0 0 10px;
  margin-top: 4px;
}
.porte-refus {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-top: 2px solid var(--terre);
  padding-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--terre);
}
.porte-refus .pastille {
  width: 10px; height: 10px;
  border-radius: var(--radius-card);
  background: var(--terre);
  flex: 0 0 10px;
}
.porte-panne:empty, .porte-refus:empty { display: none; }

/* ════════════════════════════════════════════════════════════════════════════
   COMPOSITION 1 — POCHE (< 768). Consulter : une main, au pouce.
   Rendu Porte.dc.html, cadre « Téléphone 390 ».
   ════════════════════════════════════════════════════════════════════════════ */
.porte-corps {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.porte-tete {
  padding: 48px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}
.porte-tete .porte-fleuve { display: none }   /* le fleuve du pied suffit en poche */
.porte-tete .porte-lieux { display: none }
.porte-fleuve--pied { width: 100%; height: 26px; display: block }
.porte-tete .porte-embleme { width: 72px; height: 96px; }
.porte-tete .porte-marque { font-size: 32px; }
.porte-tete .porte-baseline { display: none; }

.porte-volet {
  border-top: 1px solid var(--hair-strong);
  padding: 24px 20px 28px;
  gap: var(--space-5);
  flex: 1;
}
.porte-titre { font-size: 32px; }
.porte-champs { display: flex; flex-direction: column; gap: 18px; }
.porte-champ input { height: var(--touch-secondary); font-size: 16px; } /* 16px : pas de zoom iOS */
.porte-entrer { min-height: var(--touch-secondary); font-size: 16px; }
.porte-actions { display: flex; flex-direction: column; gap: var(--space-4); }

.porte-pied {
  padding: 16px 0 12px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.porte-pied .porte-lieux { text-align: center; font-size: 11px; }
.porte-pied .porte-fleuve { width: 100%; height: 26px; display: block; }
.porte-barre { display: none; }

/* ════════════════════════════════════════════════════════════════════════════
   COMPOSITION 2 — PAD (768-1279). Piloter : le device central.
   Rendu PortePad.dc.html. Barre EN HAUT (doctrine navigation, verrouillée).
   ════════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .porte-barre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    flex: 0 0 64px;
    padding: 0 20px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--hair);
  }
  .porte-barre .g { display: flex; align-items: center; gap: var(--space-3); }
  .porte-barre .porte-embleme { width: 20px; height: 28px; }
  .porte-barre .porte-embleme path { stroke-width: 1.5; }
  .porte-barre .porte-marque { font-size: 19px; letter-spacing: .1em; }
  .porte-barre .porte-role {
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--faint);
    margin-left: 14px;
  }
  .porte-barre .porte-date { font-size: 12px; color: var(--faint); }

  .porte-corps { display: grid; grid-template-columns: 55fr 45fr; }
  .porte-tete .porte-fleuve--pad { display: block }
  .porte-tete .porte-lieux { display: block }
  .porte-tete {
    position: relative;
    justify-content: center;
    padding: 0 48px;
    border-right: 1px solid var(--hair);
    overflow: hidden;
    gap: 0;
  }
  .porte-tete .porte-embleme { width: 220px; height: 300px; }
  .porte-tete .porte-embleme path { stroke-width: .9; }
  .porte-tete .porte-marque { font-size: 56px; letter-spacing: .14em; margin-top: 26px; }
  .porte-tete .porte-baseline { display: block; margin-top: 10px; font-size: 12px; letter-spacing: .18em; }
  /* le fleuve traverse le panneau, à hauteur de l'axe de l'emblème */
  .porte-tete .porte-fleuve--pad {
    position: absolute;
    left: 0; right: 0; top: 39%;   /* 300 px sur les 770 du rendu PortePad */
    width: 100%; height: 120px;
  }
  .porte-tete .porte-lieux { position: absolute; left: 32px; bottom: 24px; letter-spacing: normal; text-transform: none; }

  .porte-volet {
    border-top: none;
    padding: 48px 44px 28px;
    gap: 0;
  }
  .porte-titre { font-size: 46px; }
  .porte-champs { gap: 20px; margin-top: 32px; }
  .porte-champ label {
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .porte-champ input { height: var(--touch-secondary); font-size: 16px; }
  .porte-entrer { min-height: 60px; font-size: 17px; margin-top: 26px; }
  .porte-actions { margin-top: 0; }
  .porte-secondaire {
    margin-top: auto;
    border-top: 1px solid var(--hair);
    padding-top: 14px;
  }
  .porte-pied { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   COMPOSITION 3 — BUREAU (≥ 1280). Opérer : au clavier, deux volets.
   Rendu Porte.dc.html, cadre « Desktop 1440 · nominal » — pas de barre en haut :
   sur le bureau la navigation est un rail, et la porte n'a rien à naviguer.
   ════════════════════════════════════════════════════════════════════════════ */
@media (min-width: 1280px) {
  .porte-barre { display: none; }
  .porte-corps { grid-template-columns: 60fr 40fr; }
  .porte-tete { padding: 64px; border-right: none; }
  .porte-tete .porte-embleme { width: 180px; height: 240px; }
  .porte-tete .porte-embleme path { stroke-width: .7; }
  .porte-tete .porte-marque { font-size: 64px; letter-spacing: .16em; margin-top: 24px; }
  /* Sur le bureau, le fleuve descend en travers de tout le panneau — c'est le
     tracé du rendu « Desktop 1440 », pas la bande du pad remise à l'échelle. */
  .porte-tete .porte-fleuve--pad { display: none }
  .porte-tete .porte-fleuve--bureau { position: absolute; inset: 0; width: 100%; height: 100%; display: block }
  .porte-tete .porte-lieux { left: 40px; bottom: 32px; letter-spacing: .14em; text-transform: uppercase; }

  .porte-volet {
    border-left: 1px solid var(--hair-strong);
    padding: 64px 56px;
    justify-content: center;
    gap: 32px;
  }
  .porte-titre { font-size: 48px; }
  .porte-champs { gap: 20px; margin-top: 0; }
  .porte-champ label { font-size: 13px; letter-spacing: .04em; text-transform: none; color: var(--text); }
  .porte-champ input { height: 52px; font-size: 15px; }
  .porte-entrer { min-height: 52px; font-size: 16px; margin-top: 0; }
  .porte-actions { display: flex; flex-direction: column; gap: var(--space-4); }
  .porte-secondaire { margin-top: 0; border-top: none; padding-top: 0; }
}

/* Sur écran étroit ET bas (téléphone couché, clavier ouvert) : on rend la tête
   discrète plutôt que de pousser le bouton hors de vue. */
@media (max-width: 767px) and (max-height: 560px) {
  .porte-tete { padding: 16px 20px 8px; }
  .porte-tete .porte-embleme { width: 40px; height: 54px; }
  .porte-tete .porte-marque { font-size: 22px; }
  .porte-pied { display: none; }
}
