/* The way in (templates/auth_frame.html): sign-in, verification codes, password reset.

   The portal's own look with the website's hero: the flat page colour, the brand at the top left,
   a rounded panel with a photograph of Chicago (one of a set, changing with each page), one white card on it,
   the portal's footer. Colour, borders, radius, buttons and fields are the ui suite's; this file
   adds the layout, the panel, full-width buttons, the code field and the "or" row.
   Spacing follows the screen's height, so the whole form fits a short laptop screen without
   scrolling. */

html.auth-root {
  --auth-accent: var(--v2-brand);         /* focus colour; a white-label organisation's colour replaces it */
  --auth-gap: clamp(12px, 2vh, 18px);
  --auth-edge: clamp(10px, 1.6vw, 22px);  /* the panel to the screen's edges, as on benmore.tech */
  --auth-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;   /* the code field */
}

/* ── The page: brand, panel, footer, all on the panel's left and right edges ── */
.auth-top-inner { box-sizing: border-box; padding: clamp(10px, 1.8vh, 16px) calc(var(--auth-edge) + 6px); }
html.auth-root body > main.auth-main { display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  width: auto; max-width: none !important; margin-inline: var(--auth-edge); padding: clamp(14px, 3.4vh, 56px) 14px !important;
  border-radius: 24px; }
html.auth-root .v2-footer { border-top: 0; }
html.auth-root .v2-footer-inner { max-width: none; padding: clamp(10px, 1.8vh, 16px) calc(var(--auth-edge) + 6px); }
.auth-column { width: 100%; }

/* The panel: a photograph of Chicago (the template names which one and the point to keep in view),
   darkened a little toward the edges so the white card sits forward.
   It loads in two steps. A tiny copy of the photograph is part of the page: it is stretched over the panel
   and blurred hard, so what shows at once is a smooth wash of the picture's own colours, never a dark blank
   and never the tiny copy's squares. The full photograph lies over it, invisible until it has arrived,
   then fades in. */
.auth-main.auth-photo { position: relative; isolation: isolate; overflow: hidden; background-color: #5b6470; }
.auth-photo-layers { position: absolute; inset: 0; z-index: -2; overflow: hidden; border-radius: inherit; }
/* Larger than the panel, so the blur's faded rim falls outside it. */
.auth-photo-soft { position: absolute; inset: -12%; background-position: var(--auth-focus, center); background-size: cover;
  background-repeat: no-repeat; filter: blur(max(36px, 4vw)); }
.auth-photo-full { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  object-position: var(--auth-focus, center); opacity: 0; transition: opacity 0.6s ease; }
.auth-photo-full.is-in { opacity: 1; }
.auth-photo-full.is-in-now { transition: none; }
@media (prefers-reduced-motion: reduce) { .auth-photo-full { transition: none; } }
.auth-main.auth-photo::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 45%, rgba(10, 13, 20, 0.1), rgba(10, 13, 20, 0.45)); }
.auth-photo .auth-card { border-color: transparent; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.55); }

/* ── The card ──────────────────────────────────────────────────────────────── */
.auth-card { padding: clamp(22px, 4.4vh, 36px) 36px clamp(20px, 4vh, 32px); background: var(--v2-surface);
  border: 1px solid var(--v2-line); border-radius: var(--ui-radius-lg); }
.auth-card-head { margin-bottom: clamp(14px, 2.8vh, 24px); }
.auth-card .ui-title { font-size: clamp(26px, 3.8vh, 30px); }
.auth-card .ui-subtitle { margin-top: 6px; font-size: 15px; color: var(--v2-muted); }
.auth-card .ui-form { gap: var(--auth-gap); }
.auth-card .ui-field > input:not([type='checkbox']):not([type='radio']), .auth-card .ui-field > select, .auth-card .ui-input { height: 44px; }
.auth-card .ui-field > input:focus, .auth-card .ui-field > select:focus, .auth-card .ui-input:focus {
  border-color: var(--auth-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--auth-accent) 16%, transparent); }
.auth-card .ui-notice { margin-bottom: 16px; }

/* The six-digit code: one real field (so a texted code can autofill), set like a display. */
.auth-card .ui-field > input[data-code-input]:not([type='checkbox']):not([type='radio']) { height: 62px; padding: 0 0 0 0.5em; text-align: center;
  font: 500 26px/1 var(--auth-mono); letter-spacing: 0.5em; font-variant-numeric: tabular-nums; }
.auth-card input[data-code-input]::placeholder { letter-spacing: 0.5em; color: var(--v2-line-2); }

/* Buttons run the card's width. */
.auth-card .ui-btn-primary, .auth-card .ui-btn-outline { width: 100%; height: 44px; }
.auth-card .ui-btn:focus-visible, .auth-card a:focus-visible { outline: 2px solid var(--auth-accent); outline-offset: 3px; }

/* Other ways in, under the form: one "or", then a button for each. */
.auth-alt { display: grid; gap: 10px; margin-top: var(--auth-gap); }
.auth-alt[hidden], .auth-alt [hidden] { display: none; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 0; font-size: 13px; color: var(--v2-muted); }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--v2-line); }
.auth-alt .ui-btn-outline { gap: 10px; }

.auth-under > p { margin: 0; }
.auth-under > :first-child { margin-top: clamp(12px, 2.6vh, 22px); }
.auth-under, .auth-under a { color: var(--v2-muted); }
.auth-under a:hover { color: var(--v2-ink); }

@media (max-width: 640px) {
  .auth-card { padding: 24px 20px 22px; }
}
