/* ============================================================
   LOGIN SCREEN LAYOUT (split view)
   Two-column flex layout: branding content (.login-split-left) and
   the login card (.login-split-right) as siblings in
   .login-split-shell, centered as one unit with a fixed flex `gap`.
   Scoped entirely to the split login pages (Client + Admin Login) —
   safe to edit without affecting the rest of the site.
   ============================================================ */

/* Prevent the outer page scrollbar on login pages. Needed because
   site.css sets <html> overflow-x explicitly, which stops the browser
   from propagating body's overflow to the viewport — so <html> needs
   its own overflow:hidden too, not just body. Reset back to scrollable
   below 720px, where the layout stacks and can run taller than the
   viewport. Scoped to this stylesheet only. */
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  /* Prevent Chrome's pull-to-refresh / rubber-band overscroll glow at
     the top of the page on mobile, now that scrolling is enabled
     below 720px (see the mobile override below) - without this, an
     overscroll drag at the very top triggers the browser's native
     refresh gesture, which shows as a colored loading pill above the
     page content. */
  overscroll-behavior-y: contain;
}

/* Token overrides scoped to split pages */
.login-split-page {
  --gold: #A6832E;
  --gold-bg: #F7EFDC;
  --gold-border: #EBDDB3;
  --feat-green-bg: var(--success-bg);
  --feat-green-icon: var(--success);
  --feat-blue-bg: var(--brand-50);
  --feat-blue-icon: var(--brand-700);
}

.login-split-gold { color: var(--gold); }

/* ---------- Full-screen backdrop ---------- */
.login-split-page {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  overflow: hidden;
  background:
    radial-gradient(1100px circle at 20% -10%, var(--brand-50), transparent 62%),
    linear-gradient(180deg, #F8FBFC 0%, #EEF4F7 100%);
}

/* ---------- Shell: a two-item flex row (branding content + login
   card) centered as one unit via justify-content:center, with a fixed
   `gap` between them. Keeping both as normal flex siblings (instead of
   one absolutely-positioned) is what keeps the outer left/right
   margins equal at any viewport width. ---------- */
.login-split-shell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 22px);
  padding: 0 clamp(48px, 6vw, 104px);
}

/* ---------- Branding content (left column) ---------- */
.login-split-left {
  flex: 1 1 auto;
  max-width: 820px; /* caps width on large screens */
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px 0;
}

.login-split-row {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2vw, 34px);
  max-width: 100%;
}

.login-split-text {
  flex: 1 1 340px; /* grows to fill .login-split-left, bounded by its max-width */
  min-width: 0;
}

.login-split-illu-wrap {
  flex: 0 0 clamp(300px, 26vw, 420px);
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-right: clamp(-22px, -1.2vw, -8px);
}

.login-split-logo {
  max-width: 168px;
  max-height: 62px;
  width: auto;
  height: auto;
  object-fit: contain;
  margin-bottom: 18px;
}

.login-split-heading {
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 10px;
}

.login-split-subheading {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--gray-500);
  margin: 0 0 20px;
  max-width: 420px;
}

.login-split-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 0;
}

.login-split-feature {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.login-split-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: var(--r-lg);
}

.login-split-feature-icon.gold  { background: var(--gold-bg);      color: var(--gold); }
.login-split-feature-icon.green { background: var(--feat-green-bg); color: var(--feat-green-icon); }
.login-split-feature-icon.blue  { background: var(--feat-blue-bg);  color: var(--feat-blue-icon); }

.login-split-feature-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0 0 2px;
}

.login-split-feature-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--gray-500);
  margin: 0;
}

/* Illustration */
.login-split-illustration {
  position: relative;
  z-index: 1;
  max-width: clamp(320px, 26vw, 430px);
  width: 100%;
  display: block;
  filter: drop-shadow(0 28px 42px rgba(18, 78, 95, 0.14));
  animation: login-split-float 6s ease-in-out infinite;
}

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

/* ---------- The login card — now a normal flex item in the shell
   row (see .login-split-shell above) instead of being absolutely
   positioned. It's vertically centered by the shell's
   align-items:center, and its distance from the branding content is
   the shell's `gap`, not a separately-computed offset. ---------- */
.login-split-right {
  flex: 0 0 420px;
  width: 420px;
  max-height: calc(100% - 24px);
  overflow-y: auto;
  padding: 30px 36px;
  background: var(--white);
  border-radius: 24px;
  /* First two shadows: the card's normal drop shadow. The rest: soft
     color-glow blooms tucked just past the corners — colors echo the
     illustration's own palette (blue badge, gold coin, teal drop,
     purple wifi badge) so the card reads as part of the same scene
     instead of a flat box dropped on top of it. box-shadow never
     contributes to an element's scrollable overflow (unlike an
     absolutely-positioned pseudo-element would), so this can't trigger
     a scrollbar on the card's own overflow-y:auto. */
  box-shadow:
    0 25px 70px -15px rgba(16, 24, 40, 0.25),
    0 8px 24px -8px rgba(16, 24, 40, 0.12),
    -50px -40px 70px -20px rgba(95, 178, 240, 0.30),
    60px -30px 80px -20px rgba(166, 131, 46, 0.24),
    50px 70px 100px -20px rgba(34, 166, 153, 0.28),
    -60px 80px 80px -20px rgba(108, 86, 214, 0.18);
}

.login-split-right .login-card {
  width: 100%;
  max-width: none;
  /* Neutralize site.css's generic .login-card look (its own bg/border/
     shadow/padding) — .login-split-right is already the visible card
     now, so the inner element should just be a plain content wrapper,
     not a second nested card. */
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  text-align: left;
  overflow: visible;
  animation: login-split-card-in var(--slow) var(--ease);
}

/* Compact vertical rhythm inside the floating card only — the goal is
   for the whole form to fit without its own internal scrollbar, so
   these trim site.css's more generous default spacing just here. */
.login-split-right .login-field { margin-bottom: 10px; }
.login-split-right .login-remember { margin: 2px 0 10px; }
.login-split-right .login-or { margin: 10px 0; }
.login-split-right .login-divider { margin: 16px 0 10px; }
.login-split-right .login-footnote + .login-footnote { margin-top: 4px !important; }

@keyframes login-split-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Copyright line under the shell, shared by both portals */
.login-split-footer {
  margin: 0;
  font-size: 0.78rem;
  color: var(--gray-500);
  text-align: center;
}

/* ---------- Portal tab toggle ---------- */
.login-portal-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--gray-100);
  border-radius: var(--r-full);
  margin-bottom: 18px;
}

.login-portal-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--r-full);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gray-500);
  text-decoration: none;
  transition:
    background var(--base) var(--ease),
    color var(--fast) var(--ease),
    box-shadow var(--base) var(--ease),
    transform var(--fast) var(--ease);
}

.login-portal-tab svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity var(--fast) var(--ease);
}

.login-portal-tab:hover {
  color: var(--gray-800);
  background: var(--white);
  transform: translateY(-1px);
}

.login-portal-tab:hover svg { opacity: 1; }

.login-portal-tab.active {
  color: var(--white);
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  box-shadow: 0 6px 16px -6px rgba(18, 78, 95, 0.55), 0 1px 3px rgba(0,0,0,0.08);
  cursor: default;
}

.login-portal-tab.active svg { opacity: 1; }
.login-portal-tab.active:hover { transform: none; }

/* ---------- Card text ---------- */
.login-split-card-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  text-align: left;
}

.login-split-card-subtitle {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin: 0 0 14px;
  text-align: left;
}

.login-confirmation {
  text-align: center;
}

.login-confirmation .login-split-card-title,
.login-confirmation .login-split-card-subtitle {
  text-align: center;
}

.login-confirmation .login-split-card-subtitle {
  margin-bottom: 10px;
}

.login-confirmation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: var(--r-full);
  color: var(--brand-700);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
}

.login-confirmation-note {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: 0.78rem;
  line-height: 1.45;
}

/* ---------- Icon-in-input fields ---------- */
.login-field-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.login-field-row label { margin-bottom: 0; }

.login-forgot-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-700);
  cursor: pointer;
  text-decoration: none;
}

.login-forgot-link:hover { text-decoration: underline; }

.login-forgot-note {
  display: none;
  margin: -8px 0 14px;
  font-size: 0.76rem;
  color: var(--gray-500);
}

.login-forgot-note.is-visible { display: block; }

/* Google sign-in inline error note — was reusing .login-forgot-note
   (built for a small note tucked right under the password label, with
   a negative top margin to sit close to that row) which looked cramped
   /overlapped right under the full-width Google button here. Its own
   class with normal spacing + a subtle bordered banner reads as an
   actual inline alert instead of stray gray text jammed against the
   button above it. */
.login-google-note {
  display: none;
  margin: 10px 0 4px;
  padding: 9px 12px;
  border-radius: var(--r-md, 8px);
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--gray-600, #4b5563);
  text-align: center;
}

.login-input-icon-field { position: relative; }

.login-input-icon-field input { padding-left: 42px; }

.login-input-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  display: inline-flex;
  color: var(--gray-400);
  pointer-events: none;
}

.login-input-icon-field.login-password-wrap input { padding-right: 44px; }

/* Softer, lighter field borders on the split login pages only — the
   default site.css border (--gray-200) reads too heavy/dark next to
   this card's whitespace, so tone it down and lean on the teal focus
   ring (already defined in site.css) to show state instead. */
.login-split-right .login-input-icon-field input {
  border-color: var(--gray-100);
  background: var(--white);
}

.login-split-right .login-input-icon-field input:hover {
  border-color: var(--gray-200);
}

/* Login + Home side by side, equal width, one line — overrides the
   full-width defaults on .login-submit/.login-home-btn only when both
   sit together inside .login-actions (main login form). Does not touch
   the standalone full-width Home link used on the "Welcome back"
   one-click sign-in state. */
.login-split-right .login-actions {
  align-items: stretch;
}

.login-split-right .login-actions .login-submit,
.login-split-right .login-actions .login-home-btn {
  flex: 1;
  width: auto;
  min-width: 0;
  margin-top: 0;
}

.login-split-right .login-actions.login-actions-single .login-submit {
  width: 100%;
}

/* ---------- Button loading state ---------- */
.login-submit.is-loading {
  color: transparent;
  pointer-events: none;
  position: relative;
}

.login-submit.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  animation: login-submit-spin 700ms linear infinite;
}

@keyframes login-submit-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Legal line (kept for any page still using the old
   in-card placement; the shared footer below is the primary one) ---------- */
.login-split-legal {
  margin: 18px 0 0;
  font-size: 0.76rem;
  color: var(--gray-400);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .login-split-shell { gap: 12px; padding: 0 3%; }
  .login-split-left { max-width: 620px; }
  .login-split-illu-wrap { flex-basis: 260px; margin-right: -12px; }
  .login-split-right { flex-basis: 380px; width: 380px; padding: 32px 32px; }
}

@media (max-width: 900px) {
  .login-split-heading { font-size: 1.5rem; }
  .login-split-feature-desc { display: none; }
  .login-split-row { gap: 12px; }
  .login-split-illu-wrap { flex-basis: 210px; }
  .login-split-illustration { max-width: 230px; }
}

@media (max-width: 720px) {
  /* Below this width the floating-card overlay stops working (not
     enough room beside the branding text), so drop back to a simple
     stacked layout: form card first, full-width, branding panel below.
     The stacked content now legitimately runs taller than one viewport
     (login card + full branding panel), so the global html/body
     overflow:hidden above — needed to suppress scrolling on the fixed
     desktop layout — must be lifted here, or the content below the
     fold becomes completely unreachable by touch-scroll (confirmed on
     real Android/Chrome: content existed in the DOM and was reachable
     via the browser's own Find-in-page scroll, but not by normal
     swipe, since there was no scroll container at all). */
  html,
  body {
    height: auto;
    overflow: visible;
  }
  .login-split-page {
    position: static;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: none;
  }
  .login-split-shell {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
    background:
      radial-gradient(1100px circle at 20% -10%, var(--brand-50), transparent 62%),
      linear-gradient(180deg, #F8FBFC 0%, #EEF4F7 100%);
  }
  .login-split-left {
    flex: none;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow-y: visible;
    order: 2;
    padding: 16px 24px 32px;
  }
  .login-split-right {
    flex: none;
    order: 1;
    width: 100%;
    max-height: none;
    overflow-y: visible;
    border-radius: 0;
    box-shadow: none;
    padding: 32px 24px 16px;
  }
  .login-split-illu-wrap { display: none; }

  /* Center the branding panel content on mobile instead of leaving it
     left-aligned like the desktop split layout - reads as an
     intentional "hero" section below the login form, matching how
     Stripe/Linear/Notion-style mobile auth screens present their
     supporting marketing panel. */
  .login-split-left { text-align: center; }
  .login-split-logo { margin: 0 auto 18px; }
  .login-split-subheading { margin-left: auto; margin-right: auto; }

  /* Feature list: switch from stacked icon+title/desc rows (built for
     the wide desktop column) to a compact horizontal icon-grid -
     icon on top, short label below. More scannable at phone width and
     avoids the cramped look of a long vertical list under the fold. */
  .login-split-features {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px 28px;
    margin-top: 24px;
  }
  .login-split-feature {
    flex: 0 1 96px;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }
  .login-split-feature-title {
    font-size: 0.8rem;
    line-height: 1.3;
  }
}

@media (max-width: 480px) {
  .login-split-right { padding: 24px 16px 12px; }
  .login-split-left  { padding: 16px 20px 28px; }
}
