/* exui page compositions — auth: client_login* via exui_auth_start/end.pdt (DESIGN §7.9; prototype login.html, styles.css §13.7).
   Loaded on every page after exui.css; every rule is scoped to the sign-in frame
   (body.exui .ex-page--auth, printed by structure.pdt's sign-in branch) or to the
   .ex-auth root printed by exui_auth_start.pdt.

   Markup (exui_auth_start.pdt + view + exui_auth_end.pdt), inside the shell's
   main#main-content.ex-main.ex-wrap.exui-auth:
     div.ex-auth
       div.ex-auth__bg · div.ex-auth__scrim          (hall still; absolute to .ex-page)
       div.ex-auth__grid
         section.ex-window.ex-auth__card             (DOM first: h1 + form; column 2 on desktop)
           .ex-window__pool · .ex-window__frame > (.ex-blade, .ex-window__bar, .ex-window__body >
             p.ex-kicker (> span.ex-auth__kphone?: "· Step n of m", phones only),
             h1.ex-auth__title#page-title, p.ex-auth__sub, div.ex-auth__msg?,
             form.ex-form.ex-auth__form, p.ex-auth__alt, p.ex-auth__note)
         aside.ex-auth__aside                        (column 1 on desktop; after the card on phones)
                                                     sign in: kicker, h2, lede, .ex-auth__list
                                                     recovery and two-factor (.ex-auth--steps):
                                                     h2, ol.ex-steps.ex-auth__steps,
                                                     p.ex-steps__end.ex-auth__stepsend?; hidden on phones
   The language switcher is the shell footer's (one per page, as on exact.gg).
*/

/* ---------- frame ------------------------------------------------------- */

/* The grid carries its own bottom space; the shell's 104px would push the
   footer a screen away. */
body.exui .ex-page--auth > .ex-main { padding-bottom: 0; }

/* Backdrop: exact.gg's server-hall still under the support-portal scrim.
   .ex-auth is deliberately not positioned, so both layers size to .ex-page
   (position: relative; header to footer). They sit at z -1 in the root
   context after .ex-atmos (DOM order), so they cover it; the header, the
   content and the footer (own background) paint above them. */
/* The canvas colour at the alphas the scrims and halos use, from the token
   (no literals): color-mix with transparent keeps --ex-bg at that alpha.
   A browser without color-mix() (Safari < 16.2, Chrome < 111) would make
   every declaration that uses these invalid at computed-value time (no
   scrim, no halo, aside copy on the bare photo), so the shades first get
   the nearest tokens: the 80% scrim for the dark ones and the aside's
   side, transparent for the two lightest; then @supports refines them. */
body.exui .ex-auth {
  --auth-shade-35: transparent;
  --auth-shade-45: transparent;
  --auth-shade-50: var(--ex-scrim);
  --auth-shade-55: var(--ex-scrim);
  --auth-shade-78: var(--ex-scrim);
  --auth-shade-82: var(--ex-scrim);
  --auth-shade-85: var(--ex-scrim);
  --auth-shade-90: var(--ex-scrim);
  --auth-shade-92: var(--ex-scrim);
}
@supports (color: color-mix(in srgb, red, blue)) {
  body.exui .ex-auth {
    --auth-shade-35: color-mix(in srgb, var(--ex-bg) 35%, transparent);
    --auth-shade-45: color-mix(in srgb, var(--ex-bg) 45%, transparent);
    --auth-shade-50: color-mix(in srgb, var(--ex-bg) 50%, transparent);
    --auth-shade-55: color-mix(in srgb, var(--ex-bg) 55%, transparent);
    --auth-shade-78: color-mix(in srgb, var(--ex-bg) 78%, transparent);
    --auth-shade-82: color-mix(in srgb, var(--ex-bg) 82%, transparent);
    --auth-shade-85: color-mix(in srgb, var(--ex-bg) 85%, transparent);
    --auth-shade-90: color-mix(in srgb, var(--ex-bg) 90%, transparent);
    --auth-shade-92: color-mix(in srgb, var(--ex-bg) 92%, transparent);
  }
}
body.exui .ex-auth__bg,
body.exui .ex-auth__scrim { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
body.exui .ex-auth__bg { background: var(--ex-bg) url("../../images/exui-hall.webp") 60% 30% / cover no-repeat; }
body.exui .ex-auth__scrim {
  background:
    linear-gradient(var(--auth-shade-82) 0%, transparent 24%),
    linear-gradient(transparent 28%, var(--auth-shade-45) 54%, var(--auth-shade-90) 84%, var(--ex-bg) 100%),
    linear-gradient(90deg, var(--auth-shade-78) 0%, var(--auth-shade-50) 34%, transparent 62%);
}
[dir="rtl"] body.exui .ex-auth__scrim,
body.exui[dir="rtl"] .ex-auth__scrim {
  background:
    linear-gradient(var(--auth-shade-82) 0%, transparent 24%),
    linear-gradient(transparent 28%, var(--auth-shade-45) 54%, var(--auth-shade-90) 84%, var(--ex-bg) 100%),
    linear-gradient(270deg, var(--auth-shade-78) 0%, var(--auth-shade-50) 34%, transparent 62%);
}

/* Aside left, window card right. The card is anchored, not centred: its
   top edge (and its kicker and title lines) stays put from one step to the
   next (Sign in → Forgot password → back), whatever each card's height.
   The min-height keeps the footer where it was on every step; align-content
   keeps the row at the card's height, so the aside is placed against the
   card, not against that floor.
   - Sign in: the aside is centred on the card, as in the prototype and the
     exact.gg sign-in split (its mass sits beside the whole card).
   - Recovery and two-factor (.ex-auth--steps): the aside has no kicker
     (the card's names the flow), so its heading starts on the card's title
     line: --auth-head (the window bar, 46px plus the frame's 1px border,
     then the body's 36px top padding) plus the card's kicker line (12px x
     1.45) and the title's 16px margin, plus 6px: the 48px title's capitals
     sit that much lower in its 1.0 line box than the 30px heading's in its
     1.12 box, so the two cap lines meet.
   At 1440x1000 the split and the footer's top edge (y 870) fit the first
   screen, as in the prototype; the 130px floor offset is about the sign-in
   card's own height there, so the footer stays put from step to step. */
body.exui .ex-auth__grid {
  --auth-head: 83px;
  --auth-title: calc(var(--auth-head) + 17.4px + 16px + 6px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); align-items: start; align-content: start; gap: 80px;
  min-height: clamp(640px, calc(100vh - var(--ex-header-h) - 130px), 864px);
  padding-top: clamp(32px, 5vh, 64px); padding-bottom: 72px;
}
body.exui .ex-auth__card { grid-column: 2; grid-row: 1; width: 100%; min-width: 0; --cut: 28px; --d: 80ms; }
body.exui .ex-auth__aside { grid-column: 1; grid-row: 1; min-width: 0; margin-top: var(--auth-title); }
body.exui .ex-auth:not(.ex-auth--steps) .ex-auth__aside { align-self: center; margin-top: 0; }
body.exui .ex-auth__aside--steps > .ex-auth__h:first-child { margin-top: 0; }

/* ---------- aside: SECURE ACCESS ---------------------------------------- */
body.exui .ex-auth__aside,
body.exui .ex-auth__aside .ex-kicker { text-shadow: 0 0 2px var(--auth-shade-85), 0 0 10px var(--auth-shade-90); }
body.exui .ex-auth__aside .ex-kicker { color: var(--ex-fg-72); }
body.exui .ex-auth__h {
  margin: 16px 0 0; max-width: 20ch;
  font-size: 30px; line-height: 1.12; font-weight: 700; letter-spacing: -.025em; color: #fff; text-wrap: balance;
}
/* 40ch keeps the lede inside the darker part of the side scrim at 1440
   (the beam in the photo crosses the 46ch line's end). */
body.exui .ex-auth__aside .ex-lede { max-width: 40ch; text-wrap: pretty; }
body.exui .ex-auth__list { margin: 32px 0 0; padding: 0; max-width: 448px; list-style: none; border-top: 1px solid var(--ex-line); }
body.exui .ex-auth__list li {
  display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 8px 0;
  border-bottom: 1px solid var(--ex-line); font-size: 15px; line-height: 1.4; color: var(--ex-fg-88);
}
body.exui .ex-auth__list .i { flex: none; color: var(--ex-muted); }
/* no one-word last lines when a row wraps (phones at 320) */
body.exui .ex-auth__list li > span { text-wrap: pretty; }

/* Recovery and two-factor steps: the checklist rail (.ex-steps) under the
   heading, on the same hairline as the sign-in list, then (two-factor) the
   rail's dashed conclusion line (.ex-steps__end). The component keeps its
   recipe (DESIGN §5.13: "Now" right-aligned, as on the maintenance card);
   only its place in the aside is set here. The rail is capped at about the
   heading's measure (20ch at 30px), so "Now" lands in one fixed column,
   not at the far end over the photo. */
body.exui .ex-auth__steps { margin: 28px 0 0; padding-top: 12px; max-width: 360px; border-top: 1px solid var(--ex-line); }
/* The conclusion's ring sits on the nodes' axis (a 20px column) and its
   text on the step labels' line (the rail's 16px gap). */
body.exui .ex-auth__stepsend { max-width: 360px; gap: 16px; }
body.exui .ex-auth__stepsend > .ex-ring { margin: 0 5.5px; }

/* ---------- window card -------------------------------------------------- */
body.exui .ex-auth__card .ex-window__body { padding: 36px; }
body.exui .ex-auth__shield { display: inline-flex; color: var(--ex-muted); }
body.exui .ex-auth__title {
  margin: 16px 0 0; font-size: var(--ex-fs-auth); line-height: 1; font-weight: 900; letter-spacing: -.045em;
  color: #fff; text-wrap: balance; overflow-wrap: anywhere;
}
body.exui .ex-auth__title:first-child { margin-top: 0; }
/* The kicker's "· Step n of m" is for phones, where the step rail is
   hidden; on desktop the rail alone says where the visitor is. */
@media (min-width: 768px) {
  body.exui .ex-auth__kphone { display: none; }
}
body.exui .ex-auth__sub { margin: 14px 0 0; max-width: 46ch; font-size: 15px; line-height: 1.6; color: var(--ex-muted); text-wrap: pretty; }
/* Numbers in the sub line and the footnote ("6-digit", "30 seconds") are
   mono (DESIGN principle 6), sized to the sentence like .ex-lede .num. */
body.exui :is(.ex-auth__sub, .ex-auth__note) .num { font-size: .92em; letter-spacing: -.01em; white-space: nowrap; }

/* $message (message.pdt alerts) sits between the sub line and the fields.
   The alerts are not dismissible here: the field they point at keeps its
   .is-invalid ring and is described by the alert line or by the hidden
   note below, so dismissing would leave an unexplained red field (and, on
   sign in, a dangling aria-describedby). Hiding the button also drops the
   phone padding that cleared it. */
body.exui .ex-auth__msg { margin-top: 24px; }
body.exui .ex-auth__msg > .alert.ex-alert { margin: 0; }
body.exui .ex-auth__msg > * + * { margin-top: 10px; }
body.exui .ex-auth__msg .ex-alert__close { display: none; }

body.exui .ex-auth__form { margin-top: 30px; }
body.exui .ex-auth__msg + .ex-auth__form { margin-top: 22px; }
body.exui .ex-auth__form .ex-checkrow { margin: 0; font-weight: 400; }
body.exui .ex-auth__form > .ex-btn { margin-top: 4px; }

/* A field with a link in its label row: Password ("Forgot password?") and
   the "sent" state's read-only Email ("Try another address"). The link comes
   after the input in the DOM (Tab goes field → link) but sits at the right
   of the label row, where .ex-flabel would put it. Anything exui.js adds
   after the input spans the row. */
body.exui .ex-auth__pw { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; }
body.exui .ex-auth__pw > .ex-flabel { grid-column: 1; grid-row: 1; align-self: baseline; }
body.exui .ex-auth__pw > .ex-auth__pwlink { grid-column: 2; grid-row: 1; align-self: baseline; justify-self: end; font-size: 13px; line-height: 1.4; }
body.exui .ex-auth__pw > :not(.ex-flabel, .ex-auth__pwlink) { grid-column: 1 / -1; }
/* The alert sits just above the fields (and cannot be dismissed, see
   .ex-auth__msg), so the per-field note exui.js adds would repeat it word
   for word. The note stays in the DOM as the field's description
   (aria-describedby resolves a display:none node); the field keeps its
   .is-invalid ring. */
body.exui .ex-auth__form .ex-error { display: none; }
/* …except the empty-field line the page adds itself on reset and forgot
   (exui_auth_require_js): no alert says it, so it shows. */
body.exui .ex-auth__form .ex-error.ex-auth__required { display: flex; }

/* "Check your inbox" (reset, forgot): the read-only address reads as a
   value, not as a field waiting for input (exui.css dims [readonly]; no
   hover lift here). Keyboard focus keeps the field's ring. */
body.exui .ex-auth__form .ex-input[readonly] { cursor: default; }
body.exui .ex-auth__form .ex-input[readonly]:hover:not(:focus) { border-color: var(--ex-line); }
/* "Didn't get it? Send again": the quiet resend under "Back to sign in",
   set like the links row (.ex-auth__alt). Its button is a text link. */
body.exui .ex-auth__form > .ex-auth__again { margin: 2px 0 0; gap: 0 6px; }
body.exui .ex-auth__again > span { color: var(--ex-muted); }
body.exui .ex-auth__again > button.ex-link {
  padding: 0; border: 0; border-radius: 2px; background: none;
  font: inherit; line-height: inherit; cursor: pointer;
}

/* Links under the form, the hairline footnote. */
body.exui .ex-auth__alt {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 10px;
  margin: 22px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ex-fg-72); text-align: center;
}
body.exui .ex-auth__alt .sep { color: var(--ex-line-strong); }
/* An external link's glyph (exui_auth_end.pdt): inline-block, so the
   link's underline stops at the text. */
body.exui .ex-auth__ext > .i { display: inline-block; margin-left: 5px; vertical-align: -1px; color: var(--ex-muted); }
[dir="rtl"] body.exui .ex-auth__ext > .i { margin: 0 5px 0 0; }
/* Block with an inline icon, so a note that wraps (phones) stays centred
   with the icon on its first line. */
body.exui .ex-auth__note {
  display: block; margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--ex-line);
  font-size: 12px; line-height: 20px; color: var(--ex-fg-58); text-align: center; text-wrap: pretty;
}
body.exui .ex-auth__note > .i { display: inline-block; margin: 0 8px 0 0; vertical-align: -3px; color: var(--ex-muted); }
[dir="rtl"] body.exui .ex-auth__note > .i { margin: 0 0 0 8px; }
body.exui .ex-auth__note .ex-link { color: var(--ex-fg-72); white-space: nowrap; }

/* Captcha (Blesta's markup, printed raw). The internal captcha arrives as a
   Bootstrap card; inside the window it is flattened to an image + field.
   The instruction sits in the label row after "Security check" (the field
   has no placeholder, exui_auth_captcha_html); it keeps its words together
   and wraps under the label as a unit on narrow cards. */
body.exui .ex-auth__captchahint { white-space: nowrap; }
body.exui .ex-auth__captcha { container-type: inline-size; }
body.exui .ex-auth__captcha .captcha.card { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
/* answers application.min.css `.captcha { margin-bottom: 1rem !important }`; the form's grid gap spaces it */
body.exui .ex-auth__captcha .captcha { margin-bottom: 0 !important; }
body.exui .ex-auth__captcha .captcha.card::before,
body.exui .ex-auth__captcha .captcha.card::after,
body.exui .ex-auth__captcha .captcha .card-body::before,
body.exui .ex-auth__captcha .captcha .card-body::after { content: none; }
body.exui .ex-auth__captcha .captcha .card-body { display: grid; gap: 10px; padding: 0; }
/* answers Bootstrap's .mb-2 (!important) on the captcha image; the grid gap spaces it */
body.exui .ex-auth__captcha .captcha img { display: block; width: auto; max-width: 100%; height: 50px; margin: 0 !important; border-radius: var(--ex-r-sm); }
/* Image and field side by side where the card body is wide enough (keyed
   to the block's own width, not the viewport: 360px leaves the field about
   160px for a 5-8 character phrase): one 50px row instead of two keeps the
   submit nearer the fold. Narrower (phones), or without container queries,
   the image stacks above a full-width field. */
@container (min-width: 360px) {
  body.exui .ex-auth__captcha .captcha .card-body { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
}
/* The phrase is a code: mono, like every other code field (DESIGN §5.14).
   A placeholder a plugin's captcha may still bring keeps the field's prose
   voice and no tracking, so it is not clipped mid-word. */
body.exui .ex-auth__captcha input[name="phrase"] { font-family: var(--ex-mono); letter-spacing: .06em; }
body.exui .ex-auth__captcha input[name="phrase"]::placeholder { font-family: var(--ex-font); letter-spacing: 0; }
/* Third-party widgets: reCAPTCHA / hCaptcha 304x78, Turnstile 300x65
   (exui_auth_captcha_html() switches all three to their dark theme). */
body.exui .ex-auth__captcha :is(.g-recaptcha, .h-captcha) { max-width: 100%; min-height: 78px; }
body.exui .ex-auth__captcha .cf-turnstile { max-width: 100%; min-height: 65px; }

/* ---------- one-time code ------------------------------------------------ */
/* Shared with the Account area's 2FA setup (.ex-otp and .ex-2fa* belong to
   the Auth composition). :where() keeps these at (0,1,0) so an area file can
   refine them; they still beat .ex-input by load order. text-indent offsets
   the trailing letter-spacing so the digits sit centred. */
:where(body.exui) .ex-otp {
  height: 60px; padding: 0 16px;
  font: 600 24px/1 var(--ex-mono); letter-spacing: .5em; text-indent: .5em; text-align: center;
}
/* The placeholder is the shape cue (on sign-in, six dots: "······",
   Exui.auth.otp_placeholder), at the placeholder tier (fg-58, 6.2:1 on the
   field; DESIGN §10). opacity answers Firefox's default .54 on
   ::placeholder. */
:where(body.exui) .ex-otp::placeholder { color: var(--ex-fg-58); opacity: 1; }
/* Sign-in's two-factor field: the dots are set at 400, lighter than a typed
   code (600), so the cue never reads as a code someone entered, nor as a
   rejected one under the error ring. */
body.exui .ex-auth__form .ex-otp::placeholder { font-weight: 400; }
/* Phones: the field is about 240px wide at 320, and a 10-character code
   (maxlength) at .5em spacing needs about 276px; .3em keeps 10 in. */
@media screen and (max-width: 399.98px) {
  :where(body.exui) .ex-otp { letter-spacing: .3em; text-indent: .3em; }
}
:where(body.exui) .ex-2fa { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; align-items: start; border-top: 1px solid var(--ex-line); }
:where(body.exui) .ex-2fa .ex-step__body { display: grid; gap: 10px; }
/* background: the well token first, for a browser without color-mix() */
:where(body.exui) .ex-2fa__key { display: inline-flex; align-items: center; gap: 4px; width: max-content; max-width: 100%; height: 34px; padding: 0 4px 0 12px; border: 1px solid var(--ex-line); border-radius: var(--ex-r-item); background: var(--ex-well); background: color-mix(in srgb, var(--ex-bg) 50%, transparent); }
:where(body.exui) .ex-2fa__key code { font: 600 13px/1 var(--ex-mono); letter-spacing: .06em; color: #fff; overflow-wrap: anywhere; }
:where(body.exui) .ex-2fa .ex-otp { max-width: 220px; }

/* ---------- responsive --------------------------------------------------- */
@media screen and (max-width: 1199.98px) {
  body.exui .ex-auth__grid { gap: 56px; }
}

/* Short desktop viewports (a 1366x768 laptop leaves about 625px): drop the
   640px floor and tighten the card so Sign in stays above the fold, with an
   error alert too. */
@media (min-width: 1024px) and (max-height: 820px) {
  body.exui .ex-auth__grid { --auth-head: 75px; --auth-title: calc(var(--auth-head) + 17.4px + 12px); min-height: 0; padding-top: 16px; padding-bottom: 48px; }
  body.exui .ex-auth__card .ex-window__body { padding: 28px 32px 30px; }
  body.exui .ex-auth__title { font-size: 40px; margin-top: 12px; }
  body.exui .ex-auth__sub { margin-top: 10px; }
  body.exui .ex-auth__msg { margin-top: 18px; }
  body.exui .ex-auth__form { margin-top: 22px; gap: 16px; }
  body.exui .ex-auth__msg + .ex-auth__form { margin-top: 18px; }
  body.exui .ex-auth__alt { margin-top: 18px; }
  body.exui .ex-auth__note { margin-top: 18px; padding-top: 14px; }
  /* After a rejected password (sign in, choose a new password) the alert
     says what to do, so the sub line gives way and the submit stays above
     the fold. */
  body.exui .ex-auth__card:has(input[type="password"]):has(.ex-auth__msg) .ex-auth__sub { display: none; }
  /* With a captcha in the form (usually after a failed sign-in, so with the
     alert too), the decorative kicker and the sub line give way and the
     fields tighten, so Sign in stays above a 625px fold. The title then
     starts at --auth-head, and so does the sign-in aside's kicker or the
     step aside's heading. */
  body.exui .ex-auth__card:has(.ex-auth__captcha) .ex-window__body > .ex-kicker,
  body.exui .ex-auth__card:has(.ex-auth__captcha) .ex-auth__sub { display: none; }
  body.exui .ex-auth--steps .ex-auth__grid:has(.ex-auth__captcha) { --auth-title: var(--auth-head); }
  body.exui .ex-auth__card:has(.ex-auth__captcha) .ex-auth__title { margin-top: 0; font-size: 34px; }
  body.exui .ex-auth__card:has(.ex-auth__captcha) .ex-auth__msg { margin-top: 14px; }
  body.exui .ex-auth__card:has(.ex-auth__captcha) .ex-auth__form { gap: 12px; }
  body.exui .ex-auth__card:has(.ex-auth__captcha) .ex-auth__msg + .ex-auth__form { margin-top: 14px; }
  body.exui .ex-auth__card:has(.ex-auth__captcha) .ex-auth__form :is(.ex-input, .form-control) { height: 44px; }
  /* answers the inline style="height: 50px" Blesta prints on the captcha image */
  body.exui .ex-auth__card:has(.ex-auth__captcha) .ex-auth__captcha .captcha img { height: 44px !important; }
}

/* Tablet and phone: one column, the card first (DOM order), the aside under
   it at the card's width. The backdrop stops at about a screen so the hall
   keeps its scale instead of stretching down a tall page. */
@media screen and (max-width: 1023.98px) {
  body.exui .ex-auth__grid { grid-template-columns: minmax(0, 1fr); gap: 48px; min-height: 0; padding-top: 24px; padding-bottom: 64px; }
  body.exui .ex-auth__card,
  body.exui .ex-auth__aside { grid-column: 1; grid-row: auto; width: 100%; max-width: 480px; justify-self: center; }
  body.exui .ex-auth__aside { margin-top: 0; }
  body.exui .ex-auth__bg,
  body.exui .ex-auth__scrim { bottom: auto; height: min(100%, 1080px); }
  body.exui .ex-auth__scrim {
    background:
      linear-gradient(var(--auth-shade-82) 0%, var(--auth-shade-35) 18%, var(--auth-shade-55) 46%, var(--auth-shade-92) 78%, var(--ex-bg) 100%);
  }
}

@media screen and (max-width: 767.98px) {
  body.exui .ex-auth__grid { gap: 40px; padding-top: 20px; padding-bottom: 56px; }
  body.exui .ex-auth__card .ex-window__body { padding: 26px 22px 24px; }
  body.exui .ex-auth__title { font-size: 38px; }
  body.exui .ex-auth__h { font-size: 26px; }
  /* Recovery and two-factor: the card is the whole job on a phone; the
     step rail would add a screen of scrolling under the form and push the
     footer away. The card's kicker keeps the position cue on every step
     ("Password reset · Step 2 of 3", "Sign in · Step 2 of 2"). */
  body.exui .ex-auth--steps .ex-auth__aside { display: none; }
  /* "Keep me signed in": a 40px row like every other tap target (DESIGN §9) */
  body.exui .ex-auth__form .ex-checkrow { min-height: 40px; align-items: center; }
  /* the alert's dismiss button is hidden here (.ex-auth__msg), so the room
     exui.css §15 keeps for it on phones goes back to the text */
  body.exui .ex-auth__msg .ex-alert--closable { padding-right: 16px; }
  /* 40px tap targets (DESIGN §9): the links under the form become 40px rows;
     "Forgot password?" and the footnote link grow their hit area with
     padding that equal negative margins keep out of the layout. */
  body.exui .ex-auth__alt { flex-direction: column; align-items: center; gap: 0; margin-top: 14px; }
  body.exui .ex-auth__alt .sep { display: none; }
  body.exui .ex-auth__alt .ex-link { display: inline-flex; align-items: center; min-height: 40px; }
  /* "Didn't get it? Send again" stays one line (the button is the 40px row) */
  body.exui .ex-auth__form > .ex-auth__again { flex-direction: row; flex-wrap: wrap; justify-content: center; margin-top: -4px; }
  body.exui .ex-auth__pw > .ex-auth__pwlink { padding: 11px 0 11px 8px; margin: -11px 0; }
  body.exui .ex-auth__note .ex-link { display: inline-block; padding: 11px 0; margin: -11px 0; }
}

/* reCAPTCHA / hCaptcha (304x78) and Turnstile (300x65) render a fixed frame;
   shrink it where the card body is narrower (phones under 390px). */
@media screen and (max-width: 389.98px) {
  body.exui .ex-auth__captcha :is(.g-recaptcha, .h-captcha) { min-height: 0; height: 69px; transform: scale(.88); transform-origin: 0 0; }
  body.exui .ex-auth__captcha .cf-turnstile { min-height: 0; height: 58px; transform: scale(.88); transform-origin: 0 0; }
}
/* Under 360px the card body is about 240px wide: the submit pill's side
   padding tightens so the English labels keep one line, and a label that
   still doesn't fit (a longer language, DESIGN §11) wraps inside the pill
   instead of being clipped by .ex-btn's nowrap. */
@media screen and (max-width: 359.98px) {
  body.exui .ex-auth__form > .ex-btn { height: auto; min-height: 50px; padding: 12px 20px; white-space: normal; line-height: 1.25; text-align: center; }
  body.exui .ex-auth__form > .ex-btn--arrow { padding-right: 18px; }
}
@media screen and (max-width: 339.98px) {
  body.exui .ex-auth__card .ex-window__body { padding: 24px 18px 22px; }
  body.exui .ex-auth__captcha :is(.g-recaptcha, .h-captcha) { height: 60px; transform: scale(.77); }
  body.exui .ex-auth__captcha .cf-turnstile { height: 50px; transform: scale(.77); }
}
[dir="rtl"] body.exui .ex-auth__captcha :is(.g-recaptcha, .h-captcha, .cf-turnstile),
body.exui[dir="rtl"] .ex-auth__captcha :is(.g-recaptcha, .h-captcha, .cf-turnstile) { transform-origin: 100% 0; }
