/* The PIN gate's sign-in screen: a brand poster beside the code form, stacked on a phone (references/screen.md).
   Brand comes in through the token map below and nowhere else. Fill it from the app's brand skill
   ($om-brand-design-system, $omd-brand-design-system, $phd-brand-design-system) or the client's design system;
   check every pair with the contrast table in references/screen.md. Worked example (Notino Markets, 14 Nov 2026):
     --gate-poster #CAADEB (Pastel Violine)  --gate-on-poster #000  --gate-font Roboto  --gate-focus #DC0069 / #FF4D9A
   Type: one scale (here 1.25: .75 .875 1 1.25 2 2.5 3.5 4.375 5.47 rem); space: 4/8 px steps; radius 2 px on
   controls, none on the poster; no shadows. Motion: the form fades in when its step changes, nothing else moves. */
:root {
  /* VLM tokens, the same as the VLM decks and the dashboard (app.b220c6e31c.css); Carlito is self-hosted there. */
  --gate-font: "Carlito", "Calibri", "Segoe UI", Arial, sans-serif;
  --gate-poster: #013A5E;        /* VLM navy: the one bold surface */
  --gate-on-poster: #FFFFFF;     /* 11.9 : 1 on the poster */
  --gate-page: #FFFFFF; --gate-ink: #1E242C; --gate-ink-2: #5A6472; --gate-muted: #667180;
  --gate-line: #D9E1E9; --gate-line-strong: #7B8794; --gate-soft: #F4F9FD;
  --gate-btn: #0069A8; --gate-on-btn: #FFFFFF; --gate-btn-hover: #013A5E;
  --gate-focus: #007CC6; --gate-error: #B42318; --gate-warn-bg: #F6E4C4; --gate-warn-ink: #1E242C;
  --gate-bar-h: 0px;
  --gate-s1: .25rem; --gate-s2: .5rem; --gate-s3: .75rem; --gate-s4: 1rem; --gate-s5: 1.25rem; --gate-s8: 2rem;
  --gate-s10: 2.5rem; --gate-s12: 3rem; --gate-s16: 4rem; --gate-gutter: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --gate-page: #0B1722; --gate-ink: #FFFFFF; --gate-ink-2: #C9D9E6; --gate-muted: #9FB3C4;
    --gate-line: #1B3348; --gate-line-strong: #6E8BA3; --gate-soft: #12283A;
    --gate-btn: #7FC0E8; --gate-on-btn: #013A5E; --gate-btn-hover: #B9D2E4; --gate-focus: #7FC0E8; --gate-error: #FF8A80;
    --gate-warn-bg: #5A3A00; --gate-warn-ink: #FFFFFF;
  }
}
:root[data-theme="dark"] {
  --gate-page: #0B1722; --gate-ink: #FFFFFF; --gate-ink-2: #C9D9E6; --gate-muted: #9FB3C4;
  --gate-line: #1B3348; --gate-line-strong: #6E8BA3; --gate-soft: #12283A;
  --gate-btn: #7FC0E8; --gate-on-btn: #013A5E; --gate-btn-hover: #B9D2E4; --gate-focus: #7FC0E8; --gate-error: #FF8A80;
  --gate-warn-bg: #5A3A00; --gate-warn-ink: #FFFFFF;
}

body:has(> #gate:not([hidden])) { margin: 0; background: var(--gate-page); }
#gate, #gate * { box-sizing: border-box; }
#gate { font-family: var(--gate-font); color: var(--gate-ink); background: var(--gate-page); -webkit-font-smoothing: antialiased; }
#gate :focus-visible { outline: 2px solid var(--gate-focus); outline-offset: 2px; }
.gate {
  /* the poster title: fluid between the scale's 2.5 rem and 5.47 rem steps */
  --gate-title: clamp(2.5rem, 1.5rem + 4vw, 5.46875rem);
  display: grid; grid-template-columns: minmax(0, 1fr);
  min-height: calc(100vh - var(--gate-bar-h)); min-height: calc(100dvh - var(--gate-bar-h));
  background: var(--gate-page);
}
@media (min-width: 960px) { .gate { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }

.gate__poster {
  background: var(--gate-poster); color: var(--gate-on-poster);
  display: flex; flex-direction: column; justify-content: flex-end; gap: 1.5rem;
  padding: var(--gate-s12) var(--gate-gutter) var(--gate-s8); min-width: 0;
}
@media (min-width: 960px) { .gate__poster { padding: var(--gate-s16) var(--gate-s12) var(--gate-s12); } }
/* line-height ≥ the face's content area (ascent + descent), or the glyphs spill out of the element: 1.32 for
   Roboto's web files (1.319 em). Measure yours (references/screen.md). One line where it fits, balanced if it wraps. */
.gate__title {
  margin: 0; font-size: var(--gate-title); line-height: 1.32; font-weight: 300; letter-spacing: -0.02em;
  color: inherit; overflow-wrap: anywhere; text-wrap: balance;
}
.gate__lead { margin: 0; max-width: 32ch; font-size: 1.25rem; line-height: 1.75rem; font-weight: 300; color: inherit; }

/* stacked: the form starts on the poster's left edge; side by side: centred on its half */
.gate__panel {
  display: grid; align-content: start; justify-items: start; min-width: 0;
  padding: var(--gate-s10) var(--gate-gutter) var(--gate-s12);
}
@media (min-width: 960px) { .gate__panel { align-content: center; justify-items: center; padding: var(--gate-s16) var(--gate-s12); } }
/* The screen never scrolls (references/screen.md; Notino Markets, 16 Nov 2026). Stacked on a short phone, the poster
   becomes a band with the title only and the panel tightens: at 375 x 667 the code step had run 112-154 px down. */
@media (max-width: 959.98px) and (max-height: 760px) {
  .gate { --gate-title: 2rem; }
  .gate__poster { padding: var(--gate-s5) var(--gate-gutter); gap: var(--gate-s2); }
  .gate__lead { display: none; }
  .gate__panel { padding: var(--gate-s5) var(--gate-gutter); }
  .signin { gap: var(--gate-s4); }
}
/* minmax(0, 1fr) everywhere: a grid column must never grow to an input's natural width (the code field's wide
   monospace did, 22 px past the card at 375 px) */
.signin {
  width: 100%; max-width: 24rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gate-s5);
  animation: gate-step 320ms cubic-bezier(0.2, 0, 0, 1);
}
@keyframes gate-step { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .signin { animation: none; } }
.signin__title { margin: 0; font-size: 2rem; line-height: 1.32; font-weight: 300; letter-spacing: -0.015em; color: var(--gate-ink); text-wrap: balance; }
.signin__lead { margin: 0; font-size: 1rem; line-height: 1.5rem; color: var(--gate-ink-2); overflow-wrap: anywhere; }
.signin__lead strong { color: var(--gate-ink); font-weight: 700; }
.signin__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gate-s2); margin-top: var(--gate-s2); }
.signin__label { font-size: .875rem; line-height: 1.25rem; font-weight: 500; color: var(--gate-ink); }
.signin__input {
  font: inherit; font-size: 1rem; color: var(--gate-ink); background: var(--gate-page);
  border: 1px solid var(--gate-line-strong); border-radius: 2px; min-height: 48px; min-width: 0; padding: 0 var(--gate-s4);
}
.signin__input:focus { outline: 2px solid var(--gate-focus); outline-offset: 1px; border-color: var(--gate-ink); }
.signin__input[aria-invalid="true"] { border-color: var(--gate-error); }
.signin__input:disabled { opacity: .55; }
/* the code field: six digit places drawn under one input (one control, so paste, autofill and screen readers work) */
.signin__input--code {
  --cell: 1.6ch; /* one digit: 1ch glyph + .6ch letter spacing, so the six underlines sit under the six digits */
  justify-self: start; width: calc(6 * var(--cell) + 2 * var(--gate-s4));
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Roboto Mono", monospace;
  font-size: 2rem; letter-spacing: .6ch; min-height: 64px;
  background-image: repeating-linear-gradient(90deg, var(--gate-line-strong) 0 1ch, transparent 1ch var(--cell));
  background-repeat: no-repeat; background-size: calc(6 * var(--cell)) 2px;
  background-position: var(--gate-s4) calc(100% - var(--gate-s3));
}
.signin__input--code:focus { background-image: repeating-linear-gradient(90deg, var(--gate-ink) 0 1ch, transparent 1ch var(--cell)); }
.signin__btn {
  font: inherit; font-size: 1rem; font-weight: 500; min-height: 48px; margin-top: var(--gate-s2); cursor: pointer;
  background: var(--gate-btn); color: var(--gate-on-btn); border: 0; border-radius: 2px; padding: 0 var(--gate-s5);
}
.signin__btn:hover { background: var(--gate-btn-hover); }
.signin__btn:disabled { opacity: .55; cursor: default; }
.signin__actions { display: flex; flex-wrap: wrap; gap: var(--gate-s2) var(--gate-s5); }
.signin__link {
  font: inherit; font-size: .875rem; color: var(--gate-ink); background: none; border: 0; padding: var(--gate-s1) 0;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; justify-self: start; min-height: 24px;
}
.signin__link:disabled { color: var(--gate-muted); text-decoration: none; cursor: default; }
.signin__note { margin: 0; font-size: .875rem; line-height: 1.25rem; color: var(--gate-ink); background: var(--gate-soft); padding: var(--gate-s3) var(--gate-s4); border-radius: 2px; }
.signin__note--warn { background: var(--gate-warn-bg); color: var(--gate-warn-ink); }
.signin__error { margin: 0; min-height: 1.25em; font-size: .875rem; line-height: 1.25rem; color: var(--gate-error); }
.signin__access { margin: var(--gate-s3) 0 0; padding-top: var(--gate-s4); border-top: 1px solid var(--gate-line); font-size: .875rem; line-height: 1.25rem; color: var(--gate-muted); overflow-wrap: anywhere; }
.signin__access a { color: var(--gate-ink); text-underline-offset: 3px; }
[hidden] { display: none !important; }

/* VLM poster: the white VLM logo top-left and the VLM wave as on the deck covers (brand files, not a generated pattern).
   Hidden on short stacked phones, where the poster is a title-only band. */
.gate__poster { position: relative; overflow: hidden; isolation: isolate; }
.gate__poster::before {
  content: ""; position: absolute; top: var(--gate-s8); left: var(--gate-gutter); width: 132px; height: 41px;
  background: url("img/vlm-logo-white.96aa656afb.png") no-repeat left center / contain;
}
.gate__poster::after {
  content: ""; position: absolute; right: -6%; top: -8%; width: 62%; aspect-ratio: 338 / 311; z-index: -1;
  background: url("img/wave-white.724e2948ab.svg") no-repeat center / contain; opacity: .06;
}
@media (max-width: 959.98px) { .gate__poster { padding-top: calc(var(--gate-s8) + 41px + var(--gate-s8)); } }
@media (min-width: 960px) { .gate__poster::before { top: var(--gate-s12); left: var(--gate-s12); width: 168px; height: 52px; } }
@media (max-width: 959.98px) and (max-height: 760px) {
  .gate__poster::before, .gate__poster::after { display: none; }
  .gate__poster { padding-top: var(--gate-s5); }
}
