/*
 * login.css — S02 designed login page.
 * Ported from docs/mockups/02-login.html. Every selector is nested under
 * .edify-auth (AC8 — page-scoped, not global; R4) and consumes ONLY
 * var(--token) from edify-tokens.css (AC7 — zero raw hex/rgb()/hsl()).
 * Translucent white/black overlays on the dark brand panel use
 * color-mix(in srgb, …) against existing tokens (same idiom as the
 * .edify-navitem hover/active states in edify-base.css) instead of rgba().
 * Physical left/right positioning is replaced with logical properties
 * (inset-inline-*, margin-inline-*, border-*-*-radius) so the layout
 * mirrors correctly under dir="rtl" (R8) — the two-column grid itself
 * flips column order automatically under RTL because it is a CSS Grid.
 */

.edify-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
  background: var(--bg);
  color: var(--text);
}

/* ── Form side ─────────────────────────────────────────────────────────── */

.edify-auth .side-form {
  display: flex;
  flex-direction: column;
  padding: 36px 48px;
  position: relative;
}

.edify-auth .form-top {
  display: flex;
  align-items: center;
  gap: 11px;
  /* FIX #1 (Gate D): reserve room clear of the absolutely-positioned .theme-mini
     toggle (38px wide, inset-inline-end: 48px) so "Request a demo" isn't truncated
     under it. */
  padding-inline-end: 46px;
}

.edify-auth .brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.edify-auth .logo {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  box-shadow: var(--sh-sm);
  flex: none;
}

.edify-auth .brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.edify-auth .brand-name .d { color: var(--primary); }

.edify-auth .form-top .help {
  margin-inline-start: auto;
  font-size: 13.5px;
  color: var(--text-muted);
}

.edify-auth .form-top .help a { font-weight: 600; color: var(--primary); }

/* ── Form body ─────────────────────────────────────────────────────────── */

.edify-auth .form-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 0;
}

.edify-auth .welcome-ey {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.02em;
}

.edify-auth .form-body h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 10px 0 8px;
  color: var(--text);
}

.edify-auth .form-body .lede {
  color: var(--text-soft);
  font-size: 15px;
  margin-bottom: 14px;
}

/* ── Tenant chip ───────────────────────────────────────────────────────── */

.edify-auth .tenant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 24px;
}

.edify-auth .tenant .ic {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand-gradient);
  display: grid;
  place-items: center;
  color: var(--n-0);
  flex: none;
  font-weight: 700;
  font-size: 13px;
}

.edify-auth .tenant .who { font-size: 13px; line-height: 1.3; }
.edify-auth .tenant .who b { font-weight: 600; display: block; font-size: 13.5px; color: var(--text); }
.edify-auth .tenant .who span { color: var(--text-muted); font-family: var(--font-mono); font-size: 11.5px; }
.edify-auth .tenant .switch { margin-inline-start: auto; font-size: 12.5px; font-weight: 600; color: var(--primary); }

/* ── FIX #3: ABP IAlertManager alerts (login failure/lockout/etc.) ──────── */

.edify-auth .form-body .edify-alert { margin-bottom: 16px; }

/* ── Validation summary (re-skinned ABP alert) ────────────────────────── */

.edify-auth .login-alert.validation-summary-valid { display: none; }

.edify-auth .login-alert:not(.validation-summary-valid) {
  display: block;
  margin-bottom: 16px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.5;
  background: var(--danger-bg);
  color: var(--danger-fg);
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent);
}

.edify-auth .login-alert ul { margin: 0; padding-inline-start: 18px; }

/* ── Fields ────────────────────────────────────────────────────────────── */

.edify-auth .field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.edify-auth .field-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.edify-auth .input-wrap { position: relative; display: flex; align-items: center; }

.edify-auth .input {
  width: 100%;
  height: 46px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 0 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}

.edify-auth .input.has-icon { padding-inline-start: 42px; }
.edify-auth .input::placeholder { color: var(--text-muted); }
.edify-auth .input:focus { border-color: var(--primary); box-shadow: var(--ring-field); outline: 2px solid transparent; }

.edify-auth .input-wrap .lead {
  position: absolute;
  inset-inline-start: 13px;
  color: var(--text-muted);
  display: flex;
  pointer-events: none;
}
.edify-auth .input-wrap .lead svg { width: 18px; height: 18px; }

.edify-auth .input-wrap .eye {
  position: absolute;
  inset-inline-end: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 7px;
  display: grid;
  place-items: center;
}
.edify-auth .input-wrap .eye:hover { background: var(--surface-sunken); color: var(--text); }

.edify-auth .field-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 22px; }

.edify-auth .check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-soft);
  user-select: none;
}
.edify-auth .check input { position: absolute; opacity: 0; width: 0; height: 0; }
.edify-auth .check .box {
  width: 19px;
  height: 19px;
  border: 1.5px solid var(--border-strong);
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--surface);
  transition: all 120ms var(--ease);
}
.edify-auth .check .box svg { width: 13px; height: 13px; color: var(--n-0); opacity: 0; transform: scale(.6); transition: all 120ms var(--ease); }
/* Note: ASP.NET Core's checkbox tag helper injects a hidden fallback <input>
   immediately after the visible checkbox, so the .box is a general — not
   adjacent — sibling of the checked input (mirrors edify-base.css's
   .edify-mud-inputs input:checked ~ .mud-switch-track idiom). */
.edify-auth .check input:checked ~ .box { background: var(--primary); border-color: var(--primary); }
.edify-auth .check input:checked ~ .box svg { opacity: 1; transform: scale(1); }
.edify-auth .check input:focus-visible ~ .box { outline: 2px solid transparent; outline-offset: 1px; box-shadow: var(--ring); }
.edify-auth .forgot { font-size: 13.5px; font-weight: 600; color: var(--primary); }
/* FIX-3b Gate E B2(b): the suppressed (no self-service credential recovery, D-027) affordance —
   visually distinct from a live link so it does not read as a broken/clickable control. */
.edify-auth .forgot--disabled { color: var(--text-muted); cursor: default; }

/* ── Buttons (layered on the shared .edify-btn* primitives — R4) ────────── */

.edify-auth .btn-lg { width: 100%; height: 48px; font-size: 15.5px; }
.edify-auth .btn-lg svg { width: 18px; height: 18px; }

.edify-auth .btn-sso { font-size: 14.5px; }
.edify-auth .btn-sso svg { width: 18px; height: 18px; }

/* FIX-S35 (ed-7xho, QA defect EDF-QA-SIGNIN-FOCUS-INVISIBLE-20261010): the keyboard focus ring on the
   sign-in and SSO buttons. ROOT CAUSE (proven in a browser, computed style of the focused button): the
   global ring in edify-base.css is `:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring); }` (0,1,0),
   and `.edify-btn-primary { box-shadow: var(--sh-sm); }` (0,1,0) sits LATER in the same file, so on every
   primary button the button's own resting shadow wins the tie and the ring never paints. This rule is
   scoped to the page (0,3,0), so it wins on the sign-in page regardless of source order, and uses the
   one ring token, so the same declaration serves light and dark.
   CR-034: edify-base.css now carries one `!important` ring rule for every button class (.edify-btn, its
   filled variants and .btn), so this rule is redundant; it is kept on purpose and does no harm. */
.edify-auth .edify-btn:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring); }

/* ── Divider + SSO row ────────────────────────────────────────────────── */

.edify-auth .div {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
}
.edify-auth .div::before,
.edify-auth .div::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.edify-auth .sso-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Footer ────────────────────────────────────────────────────────────── */

.edify-auth .form-foot { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.edify-auth .signup { font-size: 14px; color: var(--text-soft); }
.edify-auth .signup a { font-weight: 600; color: var(--primary); }

.edify-auth .langs { margin-inline-start: auto; display: flex; gap: 6px; }
.edify-auth .langs a {
  padding: 5px 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.edify-auth .langs a.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft-border); }

.edify-auth .theme-mini {
  position: absolute;
  top: 36px;
  inset-inline-end: 48px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  display: grid;
  place-items: center;
  box-shadow: var(--sh-xs);
}

/* FIX-6a AC7 (ed-fc4a): .theme-mini had no :focus-visible rule at all — every other interactive
   control on this page gets the canonical ring token on keyboard focus, this button silently
   didn't. */
.edify-auth .theme-mini:focus-visible {
  outline: 2px solid transparent;
  box-shadow: var(--ring);
}

/* ── Brand side ───────────────────────────────────────────────────────── */

.edify-auth .side-brand {
  position: relative;
  overflow: hidden;
  background: var(--brand-deep);
  color: var(--n-0);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px;
}

.edify-auth .side-brand::before {
  content: "";
  position: absolute;
  top: -160px;
  inset-inline-end: -120px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--n-0) 14%, transparent), transparent 60%);
}
.edify-auth .side-brand::after {
  content: "";
  position: absolute;
  bottom: -180px;
  inset-inline-start: -100px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--aqua-400) 22%, transparent), transparent 62%);
}

.edify-auth .brand-rail {
  position: absolute;
  inset-inline-start: 0;
  top: 18%;
  bottom: 18%;
  width: 5px;
  border-start-end-radius: var(--r-full);
  border-end-end-radius: var(--r-full);
  background: linear-gradient(180deg, var(--n-0), color-mix(in srgb, var(--n-0) 20%, transparent));
}

.edify-auth .brand-mark {
  position: absolute;
  top: 48px;
  inset-inline-start: 56px;
  display: flex;
  align-items: center;
  gap: 11px;
  z-index: 2;
}
.edify-auth .brand-mark .logo { box-shadow: var(--sh-lg); }
.edify-auth .brand-mark .brand-name,
.edify-auth .brand-mark .brand-name .d { color: var(--n-0); }

.edify-auth .brand-inner { position: relative; z-index: 2; max-width: 440px; }

.edify-auth .brand-inner .eye {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  background: color-mix(in srgb, var(--n-0) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--n-0) 20%, transparent);
  border-radius: var(--r-full);
  font-size: 12.5px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}
.edify-auth .brand-inner .eye .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--n-0);
  display: inline-block;
}

.edify-auth .brand-inner h2 {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 22px 0 16px;
}
.edify-auth .brand-inner p {
  font-size: 16px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--n-0) 82%, transparent);
  max-width: 38ch;
}

/* ── Floating proof cards ─────────────────────────────────────────────── */

.edify-auth .proof { margin-top: 38px; display: flex; flex-direction: column; gap: 14px; max-width: 340px; }

.edify-auth .pcard {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  background: color-mix(in srgb, var(--n-0) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--n-0) 18%, transparent);
  border-radius: var(--r-lg);
  backdrop-filter: blur(8px);
  box-shadow: var(--sh-md);
  animation: login-proof-float 5s ease-in-out infinite;
}
.edify-auth .pcard:nth-child(2) { animation-delay: .8s; margin-inline-start: 36px; }
.edify-auth .pcard:nth-child(3) { animation-delay: 1.6s; }

@keyframes login-proof-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

.edify-auth .pcard .pic {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--n-0) 16%, transparent);
}
.edify-auth .pcard .pic svg { width: 19px; height: 19px; color: var(--n-0); }
.edify-auth .pcard .pt { font-weight: 600; font-size: 14px; }
.edify-auth .pcard .ps { font-size: 12px; color: color-mix(in srgb, var(--n-0) 72%, transparent); margin-top: 1px; }
.edify-auth .pcard .pe { margin-inline-start: auto; font-family: var(--font-mono); font-weight: 600; font-size: 14px; }

.edify-auth .pill-ok {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  background: color-mix(in srgb, var(--n-0) 16%, transparent);
  padding: 3px 8px;
  border-radius: var(--r-full);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .edify-auth { grid-template-columns: 1fr; }
  .edify-auth .side-brand { display: none; }
  .edify-auth .side-form { padding: 28px 24px; }
  .edify-auth .theme-mini { top: 24px; inset-inline-end: 24px; }
}

/* FIX-6a AC7 (ed-fc4a): small-viewport fixes at 414px (a common phone width — this project had
   only one @media breakpoint before this slice).
   1. .form-top's "New here? Request a demo" help text wrapped to 3 lines and crowded under the
      absolutely-positioned .theme-mini toggle — .form-top's padding-inline-end (Fix #1, above)
      reserves room for the toggle at DESKTOP width, but at 414px the help text itself needs more
      room than that reserve leaves. Wrapping it onto its own full-width line below the brand row
      removes the crowding instead of trying to squeeze it into the remaining inline space.
   2. .form-foot's "Trouble signing in? / Get help" + the language pills split awkwardly when the
      row ran out of inline space — same fix, allow the row to wrap with breathing room. */
@media (max-width: 414px) {
  .edify-auth .form-top {
    flex-wrap: wrap;
    row-gap: 8px;
    padding-inline-end: 0;
  }
  .edify-auth .form-top .help {
    margin-inline-start: 0;
    flex-basis: 100%;
  }
  .edify-auth .theme-mini {
    top: 20px;
    inset-inline-end: 20px;
  }
  .edify-auth .form-foot {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .edify-auth .langs {
    margin-inline-start: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .edify-auth .pcard { animation: none; }
}

/* ── FIX-6a AC6 (Tier 2): normalize ABP's OWN un-restyled inner markup ──────────────────
   The Tier-2 account-layout override (Themes/LeptonX/Layouts/Account/Default.cshtml) removes the
   stock LeptonX CHROME from every remaining Account page, but stock pages that were never given a
   Tier-1 rebuild still ship their OWN inner markup with plain Bootstrap classes
   ("<div class=account-module-form><p>...</p><a class="btn btn-primary" role=button>...", the
   shape decompiled from the package's compiled views). Left alone that residual markup would
   still read as stock Bootstrap even though the surrounding chrome is Edify's. These rules
   re-skin the handful of Bootstrap primitives ABP's Account module actually ships (btn/
   btn-primary, the .account-module-form wrapper, Bootstrap's .mt-4 spacer) using the SAME tokens
   as every other control on this page — not a new design, and scoped under .edify-auth like
   every other rule here (AC8).
   LIVE-PROVEN (Gate D round 5, Lead probe 2026-09-02): authenticated /Account/AddPasskey — a
   section-defining stock Tier-2 page — rendered 200 through the layout with these rules applied
   and zero LeptonX chrome markers. (The earlier citation of /Account/AccessDenied was stale —
   that page moved to Tier 1 in part 2; see the layout file's own doc comment.) */
.edify-auth .account-module-form { color: var(--text-soft); font-size: 15px; line-height: 1.6; }
.edify-auth .account-module-form p { margin: 0 0 8px; }
.edify-auth .account-module-form .mt-4 { margin-block-start: 16px; }

.edify-auth .account-module-form .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--r-md);
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: var(--sh-sm);
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.edify-auth .account-module-form .btn-primary { background: var(--primary); color: var(--n-0); }
.edify-auth .account-module-form .btn-primary:hover { background: var(--primary-hover); }
.edify-auth .account-module-form .btn:focus-visible { outline: 2px solid transparent; box-shadow: var(--ring); }
