:root{--porte-accent:#7aa7d9}
/* Porte commune des gestions — même apparence sur tous les sites.
   La couleur du site arrive par --porte-accent (ajoutée par porte.php). */
.porte {
  --porte-fond: #f4f3f0; --porte-carte: #fff; --porte-texte: #22252b; --porte-doux: #6b707a; --porte-ligne: #e3e1dc;
  --porte-ok: #2f7d4a; --porte-err: #b3362f;
  margin: 0; min-height: 100vh; display: grid; place-items: start center;
  padding: max(6vh, 1.5rem) 1rem 3rem;
  background: var(--porte-fond); color: var(--porte-texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.porte *, .porte *::before, .porte *::after { box-sizing: border-box; }
.porte-boite {
  width: 100%; max-width: 400px; padding: 1.75rem 1.5rem;
  background: var(--porte-carte); border: 1px solid var(--porte-ligne); border-radius: 14px;
  box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .35);
}
.porte-boite--large { max-width: 620px; }
.porte-marque {
  display: flex; align-items: center; gap: .5rem; margin: 0 0 1.25rem;
  color: var(--porte-doux); font-size: .82rem; font-weight: 600; letter-spacing: .02em;
}
.porte-pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--porte-accent); flex: none; }
.porte h1 { margin: 0 0 1.25rem; font-size: 1.45rem; line-height: 1.2; }
.porte h2 { margin: 0 0 .6rem; font-size: 1.05rem; }
.porte-form { display: grid; gap: 1rem; }
.porte-form label { display: grid; gap: .35rem; font-size: .92rem; font-weight: 600; }
.porte input[type=password], .porte input[type=text], .porte input:not([type]), .porte input[inputmode] {
  width: 100%; min-height: 48px; padding: .6rem .8rem;
  border: 1px solid #cfccc5; border-radius: 10px; background: #fff; color: inherit;
  font: inherit; font-size: 16px; /* évite le zoom automatique sur iPhone */
}
.porte input:focus { outline: none; border-color: var(--porte-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--porte-accent) 22%, transparent); }
.porte-code { letter-spacing: .4em; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.2rem !important; }
.porte button {
  min-height: 48px; padding: 0 1.2rem; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--porte-accent); color: #fff; font: inherit; font-weight: 700;
}
.porte button:hover { filter: brightness(.94); }
.porte button:focus-visible, .porte a:focus-visible { outline: 3px solid color-mix(in srgb, var(--porte-accent) 45%, transparent); outline-offset: 2px; }
.porte .porte-bouton-second { background: transparent; color: var(--porte-texte); border: 1px solid #cfccc5; font-weight: 600; }
.porte .porte-petit { min-height: 36px; padding: 0 .8rem; font-size: .85rem; }
.porte-case { display: flex !important; align-items: center; gap: .55rem; font-weight: 500 !important; }
.porte-case input { width: 20px; height: 20px; accent-color: var(--porte-accent); }
.porte-liens { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin: 1.25rem 0 0; font-size: .9rem; }
.porte a { color: var(--porte-accent); }
.porte-discret { color: var(--porte-doux) !important; }
.porte-aide { margin: 0 0 .9rem; color: var(--porte-doux); font-size: .92rem; }
.porte-msg { margin: 0 0 1rem; padding: .7rem .9rem; border-radius: 10px; font-size: .92rem; }
.porte-msg--ok  { background: #e9f4ec; color: var(--porte-ok); }
.porte-msg--err { background: #f9e9e7; color: var(--porte-err); }
.porte-secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; word-break: break-all; }
.porte-bloc { padding: 1.25rem 0; border-top: 1px solid var(--porte-ligne); }
.porte-ligne { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .4rem 0; }
.porte-ligne small, .porte-journal small { color: var(--porte-doux); }
.porte-journal { width: 100%; border-collapse: collapse; font-size: .85rem; }
.porte-journal td { padding: .35rem .3rem; border-bottom: 1px solid var(--porte-ligne); vertical-align: top; }
.porte-refus td { color: var(--porte-err); }

/* Liens « Mon compte · Se déconnecter » dans les gestions */
.porte-menu { display: inline; }
.porte-menu a, .porte-menu-bouton { white-space: nowrap; }
.porte-menu-form { display: inline; margin: 0; }
.porte-menu-bouton { background: none; border: 0; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }

@media (prefers-color-scheme: dark) {
  .porte { --porte-fond: #14161a; --porte-carte: #1c1f24; --porte-texte: #e9e9ea; --porte-doux: #9aa0a9; --porte-ligne: #2c3038; }
  .porte input[type=password], .porte input[type=text], .porte input:not([type]), .porte input[inputmode] { background: #121418; border-color: #3a3f48; }
  .porte-msg--ok { background: #1d3325; } .porte-msg--err { background: #3a1f1d; }
}

/* Petit encart fixe « Mon compte · Se déconnecter » pour les gestions sans en-tête adapté */
.porte-coin {
  position: fixed; right: 12px; bottom: 12px; z-index: 9999;
  padding: .45rem .8rem; border-radius: 999px;
  background: rgba(20, 22, 26, .88); color: #fff;
  font: 600 13px/1.3 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .5);
}
.porte-coin a { color: #fff; }
