/* ============================================
   Sign-in — Studio's Lanes look (studio.css, loaded first) for the way in
   API Access's dark hero band, with a map from the Hub to each portal's lane
   (STUDIO_LANES), and the form on a sheet beside it: light in the light
   theme, dark in the dark. The lane stripe is the seam between the two.
   Loaded by /login.php, /forgot-password.php and /reset-password.php, which
   share the band (includes/login-ui.php).
   ============================================ */

/* No Hub shell here: the body is the page (body.sx), on the docs' paper */
.lx { min-height: 100vh; background: var(--sx-paper); }
.lx-page { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(460px, 1fr); min-height: 100vh; min-height: 100dvh; }

/* ---- the hero: always dark, the full height beside the form ---- */
.lx-hero { display: flex; flex-direction: column; gap: 28px; padding: 36px clamp(36px, 4.5vw, 72px) 44px; }
.lx-logo { display: flex; align-items: center; min-height: 34px; }
.lx-logo img { display: block; height: 34px; width: auto; }
.lx-hero-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; max-width: 680px; }
.lx-hero .sx-intro { margin-bottom: 30px; }
/* the lane stripe runs down the seam */
.lx-hero .sx-stripe { left: auto; top: 0; width: 6px; height: auto; flex-direction: column; }

/* the map: the Hub's card, what it looks after, then each portal */
.lx-map .sx-map-body { grid-template-columns: minmax(0, 180px) minmax(0, 1fr); }
.lx-map-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; }
.lx-map-tags span { font: 600 10.5px/1 var(--sx-mono) !important; padding: 5px 7px; border-radius: 6px; color: #2c3458; background: #f1f3fa; }

/* ---- the form side: one track that may shrink below the fields' natural width ---- */
.lx-side { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 48px 40px; }
.lx-sheet { width: 100%; max-width: 440px; padding: 32px 34px 26px; border-radius: 24px; background: var(--sx-sheet); border: 1px solid var(--sx-line); box-shadow: 0 30px 60px -36px rgba(10, 15, 50, .4); animation: lx-rise .35s ease-out both; }
[data-bs-theme="dark"] .lx-sheet { box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .75); }
@keyframes lx-rise { from { opacity: 0; transform: translateY(10px); } }
.lx-sheet .sx-eyebrow { margin-bottom: 8px; }
.lx-title { font-size: 30px; }
.lx-sub { margin: 8px 0 24px; font-size: 15px; line-height: 1.5; color: var(--sx-muted); }
.lx-sub b { font-weight: 600; color: var(--sx-ink); overflow-wrap: anywhere; }

/* errors: the bad tone as a bar and glyph, the words in ink so they stay legible;
   good news (the reset link is on its way) the same way in the good tone */
.lx-alert { --tone: var(--sx-bad); display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 11px 14px 11px 15px; border-radius: 12px; font-size: 14px; line-height: 1.45; color: var(--sx-ink); background: color-mix(in srgb, var(--tone) 9%, var(--sx-sheet)); box-shadow: inset 3px 0 0 var(--tone), inset 0 0 0 1px color-mix(in srgb, var(--tone) 28%, transparent); }
.lx-alert.ok { --tone: var(--sx-good); }
.lx-alert .bi { flex: none; color: var(--tone); font-size: 16px; line-height: 1.3; }

/* fields: label above, a glyph inside, the focus ring in the accent */
.lx-field { margin-bottom: 18px; }
.lx-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lx-link { font: 500 12.5px var(--sx-mono) !important; color: var(--sx-accent); text-decoration: none; }
.lx-link:hover { color: var(--sx-ink); text-decoration: underline; }
.lx-input { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 6px 0 14px; border: 1px solid var(--sx-line); border-radius: 12px; background: var(--sx-paper); transition: border-color .15s, box-shadow .15s, background-color .15s; }
.lx-input > .bi { flex: none; font-size: 16px; color: var(--sx-muted); transition: color .15s; }
.lx-input input { flex: 1; min-width: 0; height: 100%; padding: 0 8px 0 0; border: 0; background: transparent; color: var(--sx-ink); font-size: 15.5px; }
.lx-input input::placeholder { color: var(--sx-muted); opacity: 1; }
/* autofill paints the box's own colour, so a saved login doesn't sit in a slab */
.lx-input input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--sx-paper) inset; -webkit-text-fill-color: var(--sx-ink); caret-color: var(--sx-ink); }
.lx-input:focus-within input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--sx-sheet) inset; }
/* studio's ring (as .form-control:focus); the clear outline is what forced colours shows */
.lx-input:focus-within, .lx-code:focus { background: var(--sx-sheet); border-color: color-mix(in srgb, var(--sx-accent) 60%, var(--sx-line)); outline: 2px solid transparent; outline-offset: 2px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--sx-accent) 18%, transparent); }
.lx-input:focus-within > .bi { color: var(--sx-accent); }
/* the box's ring is the focus mark, so the input inside needs no outline of its own */
.lx-input input:focus, .lx-input input:focus-visible { outline: 0; }
.lx-peek { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--sx-muted); font-size: 16px; cursor: pointer; }
.lx-peek:hover { color: var(--sx-ink); background: var(--sx-paper); }
.lx-peek:focus-visible { outline-offset: -2px; }

.lx-check { display: flex; align-items: center; gap: 10px; margin: 2px 0 22px; font-size: 14px; color: var(--sx-muted); cursor: pointer; }
.lx-check input { flex: none; width: 17px; height: 17px; margin: 0; accent-color: var(--sx-accent); cursor: pointer; }

/* the two-factor code: six big mono digits */
.lx-code { display: block; width: 100%; height: 64px; padding: 0 0 0 .5em; border: 1px solid var(--sx-line); border-radius: 14px; background: var(--sx-paper); color: var(--sx-ink); text-align: center; font: 600 28px var(--sx-mono) !important; letter-spacing: .5em; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.lx-code::placeholder { color: var(--sx-muted); opacity: .7; }

/* password done, code next (or email, inbox, password, sign in): studio's
   metro line, kept across even on a phone (login_steps()) */
.lx-steps { margin: 0 0 24px; }
.lx-steps li { padding: 0 2px; }
.lx-steps .dot { background: var(--lane); box-shadow: inset 0 0 0 3px var(--sx-sheet); }
.lx-steps .is-next .dot, .lx-steps .is-todo .dot { box-shadow: none; }

/* the submit button: studio's primary, full width, with a loading state;
   .lx-btn is the same size for a link that moves on (back to sign in) */
.lx-submit, .lx-btn { width: 100%; height: 50px; border-radius: 13px; font-size: 15.5px; }
.lx-submit .lx-spin, .lx-submit .lx-busy { display: none; }
.lx-submit.is-loading .lx-go { display: none; }
.lx-submit.is-loading .lx-spin, .lx-submit.is-loading .lx-busy { display: inline-block; }
.lx-submit.is-loading:disabled { opacity: .85; }
.lx-go { display: inline-flex; align-items: center; gap: 8px; }
.lx-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: lx-spin .7s linear infinite; }
@keyframes lx-spin { to { transform: rotate(360deg); } }

/* Microsoft 365 (behind $o365Enabled), then the way in with email */
.lx-o365 { width: 100%; height: 48px; }
.lx-o365 svg { width: 18px; height: 18px; flex: none; }
.lx-or { display: flex; align-items: center; gap: 12px; margin: 18px 0; font: 600 11px var(--sx-mono) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--sx-muted); }
.lx-or::before, .lx-or::after { content: ""; flex: 1; height: 1px; background: var(--sx-line); }

.lx-back { display: flex; justify-content: center; margin: 0; }
.lx-back .sx-back { margin: 18px 0 0; }
.lx-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 22px 0 0; padding-top: 16px; border-top: 1px dashed var(--sx-line); font-size: 13.5px; color: var(--sx-muted); text-align: center; }
.lx-note .bi { color: var(--sx-accent); }

/* ---- motion ---- */
@media (prefers-reduced-motion: reduce) {
    .lx-sheet, .lx-spin { animation: none; }
    .lx-input, .lx-input > .bi, .lx-code { transition: none; }
}

/* ---- short windows beside the form (a 1366x768 laptop, an iPad on its side): tighten the band so the map fits ---- */
@media (min-width: 992px) and (max-height: 768px) {
    .lx-hero { gap: 16px; padding-top: 24px; padding-bottom: 24px; }
    .lx-hero .sx-kicker { margin-bottom: 14px; }
    .lx-hero .sx-intro { margin: 12px 0 16px; }
    .lx-map { padding: 16px 18px 10px; }
    .lx-map .sx-map-portals { gap: 6px; }
    .lx-map figcaption { margin-top: 10px; }
}

/* ---- portrait tablets and narrow windows: the band across the top, the lanes
   beside its words (landscape tablets keep the form beside the band) ---- */
@media (max-width: 1199.98px) and (orientation: portrait), (max-width: 991.98px) {
    .lx-page { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .lx-hero { gap: 22px; padding: 28px 40px 44px; }
    .lx-hero-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 0 40px; max-width: none; }
    .lx-hero .sx-intro { margin-bottom: 0; }
    .lx-hero .sx-stripe { left: 0; top: auto; width: auto; height: 6px; flex-direction: row; }
    /* just the portals, without the Hub's card and its lines */
    .lx-map { padding: 14px; }
    .lx-map .sx-map-body { display: block; }
    .lx-map .sx-map-brand { display: none; }
    .lx-map .sx-map-portals { margin: 0; padding: 0; }
    .lx-map .sx-map-portals::before, .lx-map .sx-map-portals li::before, .lx-map .sx-map-portals li::after { display: none; }
    .lx-map figcaption { margin-top: 12px; }
    .lx-map figcaption i { display: none; }
    .lx-side { padding: 36px 24px 56px; }
}

/* ---- phone: a compact band above the form ---- */
@media (max-width: 767.98px) {
    .lx-hero { gap: 18px; padding: 22px 16px 30px; }
    .lx-logo, .lx-logo img { height: 28px; min-height: 28px; }
    .lx-hero-body { display: block; }
    .lx-hero .sx-kicker { margin-bottom: 14px; font-size: 12px !important; }
    .lx-hero h1 { font-size: clamp(28px, 8.4vw, 36px); }
    .lx-hero .sx-intro { font-size: 15.5px; margin: 12px 0 0; }
    .lx-map { display: none; }
    .lx-side { place-items: start center; padding: 20px 16px 40px; }
    .lx-sheet { padding: 26px 20px 22px; border-radius: 20px; }
    .lx-title { font-size: 26px; }
    /* studio stands a metro line on end on a phone; this one stays across */
    .lx-steps.sx-stops { grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 0; }
    .lx-steps.sx-stops::before { left: calc(50% / var(--n, 2)); right: calc(50% / var(--n, 2)); top: 9px; bottom: auto; width: auto; height: 4px; }
    .lx-steps.sx-stops li { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .lx-steps.sx-stops li > :not(.dot) { grid-column: 1; }
    .lx-steps.sx-stops .dot { grid-row: auto; }
}
@media (max-width: 575.98px) {
    .lx-hero .sx-intro { display: none; }
}
