/* Auth pages (Phase 1): full-screen card, controls, forms. Tokens only. */

.auth-page {
  position: relative;
  min-height: 100vh; min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--space-6);
  background:
    radial-gradient(1200px 600px at 100% -10%, var(--color-primary-soft), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, var(--color-success-soft), transparent 55%),
    var(--color-bg);
}

/* Theme + language used to render as two separate floating chips with a gap
   between them — read as disconnected clutter over the gradient background.
   Merged into one pill (single border/shadow, thin divider between segments)
   so it reads as one deliberate control, not two stray buttons. */
.auth-controls {
  position: fixed;
  /* Clear the notch/status bar (env inset) and always paint above the card —
     on the near-fullscreen mobile card they were slipping under both. */
  top: max(var(--space-4), calc(var(--safe-area-top) + var(--space-3)));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  align-items: stretch;
  height: 44px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden; /* clips both children to the pill's rounded ends */
}
.auth-icon-btn,
.auth-lang {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 var(--space-4);
  border: 0;
  background: transparent;
  color: var(--color-fg-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  letter-spacing: 0.02em;
  transition: background var(--dur-fast) var(--ease-in-out), color var(--dur-fast) var(--ease-in-out);
}
.auth-lang { border-left: 1px solid var(--color-border); }
.auth-icon-btn:hover,
.auth-lang:hover { background: var(--color-surface-hover); color: var(--color-fg); }
.auth-icon-btn .icon { width: 18px; height: 18px; }

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: var(--space-8);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  animation: auth-in var(--dur-slow) var(--ease-out) both;
}
/* Gradient-ring accent on the app's own chrome only — never applied to a
   customer's white-label logo/name below, which must render exactly as
   configured in Налаштування → Компанія. */
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: var(--brand-gradient);
  opacity: 0.35;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes auth-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.auth-brand {
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--color-border);
}
.auth-brand__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.auth-logo {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--font-extrabold);
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
}
.auth-brand__name { font-weight: var(--font-bold); font-size: var(--text-lg); }
/* Default HRlume wordmark — wrapped in a white chip so the logo's own dark
   navy text stays legible on a dark-theme auth card (a no-op in light theme,
   where the card is already white). Not applied to customer logos below,
   which should sit on the app's own surface as designed. */
.auth-brand-full { height: 32px; width: auto; object-fit: contain; background: #fff; border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: var(--radius-md); }
.auth-powered {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
  opacity: 0.55;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}
.auth-powered img { width: 16px; height: 16px; object-fit: contain; border-radius: 4px; }

.auth-loading { display: grid; place-items: center; min-height: 180px; }

.auth-badge {
  display: inline-block;
  margin-bottom: var(--space-3);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: var(--color-primary-soft);
  color: var(--color-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}

.auth-title { font-size: var(--text-2xl); margin-bottom: var(--space-1); }
.auth-subtitle { color: var(--color-fg-muted); font-size: var(--text-sm); margin-bottom: var(--space-6); }

.auth-form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth-field { display: flex; flex-direction: column; gap: var(--space-1); }
.auth-field__label { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--color-on-surface); }
.auth-input {
  width: 100%;
  height: 48px;
  padding: 0 var(--space-4);
  font: inherit;
  /* 16px, not 14 — smaller triggers iOS Safari's focus auto-zoom on mobile. */
  font-size: var(--text-base);
  color: var(--color-fg);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-fast) var(--ease-in-out), box-shadow var(--dur-fast) var(--ease-in-out);
}
/* Password field with a show/hide toggle: input reserves room on the right so
   the eye button never overlaps the typed value. */
.auth-input--password { padding-right: var(--space-12); }
.auth-input-wrap { position: relative; display: flex; }
.auth-pw-toggle {
  position: absolute; top: 0; right: 0; height: 48px; width: 48px;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--color-fg-subtle);
  border-radius: var(--radius-lg); cursor: pointer;
}
.auth-pw-toggle:hover { color: var(--color-fg); }
.auth-pw-toggle .icon { width: 20px; height: 20px; }
.auth-input::placeholder { color: var(--color-fg-subtle); }
.auth-input:focus {
  outline: none;
  border-color: var(--color-ring);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.auth-field__err { min-height: 1em; font-size: var(--text-xs); color: var(--color-danger); }
.auth-pw-hint { margin: calc(-1 * var(--space-2)) 0 0; font-size: var(--text-xs); color: var(--color-fg-muted); }

/* min-height reserves the line so an error/success message doesn't shift the
   layout when it appears — but that reserved box, being empty text content,
   was still selectable/clickable (a plain click-drag over it shows a text
   selection highlight with nothing in it). Purely informational, never
   interactive, so it shouldn't respond to the mouse at all. */
.auth-form-error { min-height: 1em; font-size: var(--text-sm); color: var(--color-danger); pointer-events: none; user-select: none; }
.auth-form-ok { min-height: 1em; font-size: var(--text-sm); color: var(--color-success); pointer-events: none; user-select: none; }

/* "Remember me" — a plain flex child of .auth-form, spaced by that
   container's own gap like every other field/link in it (no extra
   card/border, no bespoke spacing override). */
.auth-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-fg-muted);
  cursor: pointer;
  user-select: none;
}
.auth-check input { width: 16px; height: 16px; accent-color: var(--color-primary); cursor: pointer; }

.auth-submit {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 48px;
  margin-top: var(--space-1);
  font-size: var(--text-base);
  box-shadow: var(--shadow-sm);
  transition: background var(--dur-fast) var(--ease-in-out), box-shadow var(--dur-fast) var(--ease-in-out), transform var(--dur-fast) var(--ease-out);
}
.auth-submit:is(a) { text-decoration: none; }
.auth-submit:hover:not(:disabled) { box-shadow: var(--shadow-md); }
/* Same gradient-ring sheen as .auth-card, layered on the fill this button
   already has (.btn--primary) — no cursor-follow motion, just a static
   gloss (that "cheap" mouse-tracking effect was tried and rejected). */
.auth-submit::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(180deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,.1) 30%,
    rgba(255,255,255,0) 50%, rgba(255,255,255,0) 65%, rgba(255,255,255,.2) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.auth-submit[data-loading='1'] { position: relative; color: transparent; pointer-events: none; }
.auth-submit[data-loading='1']::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: var(--radius-full);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  animation: app-spin 0.7s linear infinite;
}
.auth-link {
  align-self: center;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-primary);
}
.auth-link:hover { text-decoration: underline; }

/* Minimal authenticated shell (placeholder until Phase 3). */
.app-topbar {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.app-topbar__brand { display: flex; align-items: center; gap: var(--space-3); font-weight: var(--font-bold); }
.app-topbar__actions { display: flex; align-items: center; gap: var(--space-3); }
.app-topbar__user { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--color-fg-muted); }
.app-placeholder { display: grid; place-items: center; gap: var(--space-2); min-height: calc(100vh - var(--header-height)); min-height: calc(100dvh - var(--header-height)); text-align: center; padding: var(--space-8); }
.app-placeholder h1 { font-size: var(--text-3xl); }
.app-placeholder p { color: var(--color-fg-muted); }

@media (max-width: 480px) {
  /* Mobile-first login: the card fills the width (calc(100% - 32px)) and reads
     as a near-fullscreen sheet rather than a shrunk desktop card. */
  .auth-page { padding: var(--space-4); }
  .auth-card { max-width: none; padding: var(--space-8); border-radius: var(--radius-2xl); }
  .app-topbar__user { display: none; }
}

/* SSO (Phase 57) — divider + provider button under the password form.
   Tokens only; the button reuses .btn/.auth-submit sizing so it lines up
   with the primary submit above it. */
.auth-divider { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; color: var(--color-fg-muted); font-size: var(--text-sm); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }
.auth-sso-btn { display: flex; align-items: center; justify-content: center; gap: var(--space-2); text-decoration: none; }
.auth-sso-btn .icon { width: 18px; height: 18px; }

/* Premium authentication shell — an editorial product composition rather
   than a small utility card floating in an empty viewport. The left panel is
   intentionally product-specific and abstract (not a stock illustration),
   while the right side remains focused on the company and the task at hand. */
.auth-page {
  isolation: isolate;
  padding: clamp(24px, 4vw, 64px);
  background:
    radial-gradient(900px 620px at 5% 0%, color-mix(in srgb, var(--color-primary) 12%, transparent), transparent 66%),
    radial-gradient(760px 540px at 100% 100%, color-mix(in srgb, var(--color-accent) 8%, transparent), transparent 68%),
    var(--color-bg);
}
.auth-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .38;
  background-image:
    linear-gradient(color-mix(in srgb, var(--color-border) 40%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--color-border) 40%, transparent) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, black 22%, black 78%, transparent);
}
.auth-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, .92fr);
  width: min(1120px, 100%);
  min-height: min(680px, calc(100vh - 96px)); min-height: min(680px, calc(100dvh - 96px));
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 32px;
  background: var(--color-surface);
  box-shadow: 0 36px 90px color-mix(in srgb, var(--color-fg) 16%, transparent), var(--shadow-lg);
  animation: auth-in 520ms var(--ease-out) both;
}
.auth-showcase {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: clamp(38px, 4vw, 58px);
  color: var(--color-on-primary);
  background:
    radial-gradient(440px 380px at 90% 8%, color-mix(in srgb, var(--color-auth-showcase-glow) 58%, transparent), transparent 72%),
    linear-gradient(150deg, var(--color-auth-showcase-start), var(--color-auth-showcase-end) 82%);
}
.auth-showcase::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, color-mix(in srgb, var(--color-on-primary) 5%, transparent), transparent 42%);
}
.auth-showcase__halo {
  position: absolute;
  top: -160px;
  right: -170px;
  width: 430px;
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--color-on-primary) 12%, transparent);
  border-radius: var(--radius-full);
  box-shadow:
    0 0 0 62px color-mix(in srgb, var(--color-on-primary) 3%, transparent),
    0 0 0 124px color-mix(in srgb, var(--color-on-primary) 2%, transparent);
}
.auth-showcase__brand,
.auth-showcase__copy,
.auth-showcase__scene,
.auth-showcase__secure { position: relative; z-index: 1; }
.auth-showcase__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  letter-spacing: -.02em;
}
.auth-showcase__brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--color-on-primary) 18%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-on-primary) 10%, transparent);
  backdrop-filter: blur(12px);
}
.auth-showcase__brand-mark img { width: 23px; height: 23px; object-fit: contain; }
.auth-showcase__copy { margin-top: clamp(56px, 8vh, 86px); }
.auth-showcase__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: color-mix(in srgb, var(--color-on-primary) 70%, transparent);
  font-size: 11px;
  font-weight: var(--font-bold);
  letter-spacing: .16em;
}
.auth-showcase__eyebrow span { width: 28px; height: 1px; background: var(--color-accent); }
.auth-showcase__copy h2 {
  max-width: 510px;
  margin: 0;
  color: var(--color-on-primary);
  font-size: clamp(34px, 3.1vw, 48px);
  line-height: 1.08;
  letter-spacing: -.045em;
}
.auth-showcase__copy p {
  max-width: 460px;
  margin: 22px 0 0;
  color: color-mix(in srgb, var(--color-on-primary) 68%, transparent);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}
.auth-showcase__scene {
  width: min(470px, 94%);
  margin-top: auto;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--color-on-primary) 15%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--color-on-primary) 8%, transparent);
  box-shadow: 0 26px 70px color-mix(in srgb, var(--color-fg) 24%, transparent);
  backdrop-filter: blur(18px);
  transform: perspective(900px) rotateX(1.5deg) rotateY(-2deg);
}
.auth-showcase__scene-head {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 0 3px 10px;
  color: color-mix(in srgb, var(--color-on-primary) 76%, transparent);
  font-size: 10px;
  font-weight: var(--font-semibold);
  letter-spacing: .04em;
}
.auth-showcase__scene-head span { margin-right: auto; }
.auth-showcase__scene-head i { width: 5px; height: 5px; margin-left: 5px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--color-on-primary) 34%, transparent); }
.auth-showcase__scene-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.auth-showcase__module {
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  min-height: 68px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--color-on-primary) 9%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--color-on-primary) 9%, transparent);
}
.auth-showcase__module-icon {
  display: grid;
  place-items: center;
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--color-primary) 58%, var(--color-on-primary));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-primary) 20%, transparent);
}
.auth-showcase__module-icon .icon { width: 16px; height: 16px; color: var(--color-on-primary); }
.auth-showcase__module--2 .auth-showcase__module-icon { background: color-mix(in srgb, var(--color-accent) 72%, var(--color-on-primary)); }
.auth-showcase__module--3 .auth-showcase__module-icon { background: color-mix(in srgb, var(--color-warning) 68%, var(--color-on-primary)); }
.auth-showcase__module--4 .auth-showcase__module-icon { background: color-mix(in srgb, var(--color-info) 70%, var(--color-on-primary)); }
.auth-showcase__module strong { align-self: end; color: color-mix(in srgb, var(--color-on-primary) 88%, transparent); font-size: 11px; font-weight: var(--font-semibold); }
.auth-showcase__module-line { align-self: start; width: 68%; height: 4px; margin-top: 6px; border-radius: var(--radius-full); background: color-mix(in srgb, var(--color-on-primary) 16%, transparent); }
.auth-showcase__secure {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: color-mix(in srgb, var(--color-on-primary) 58%, transparent);
  font-size: 11px;
  font-weight: var(--font-medium);
}
.auth-showcase__secure .icon { width: 15px; height: 15px; }
.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: clamp(42px, 5vw, 66px);
  border: 0;
  border-radius: 0;
  background: var(--color-surface);
  box-shadow: none;
  animation: none;
}
.auth-card::before { display: none; }
.auth-brand { margin-bottom: 44px; padding-bottom: 24px; }
.auth-brand__row { gap: 14px; }
.auth-logo,
.brand-logo { width: 46px; height: 46px; border-radius: 14px; }
.auth-brand__name { font-size: var(--text-xl); letter-spacing: -.025em; }
.auth-brand-full { height: 38px; padding: 4px 8px; }
.auth-powered { margin-top: 12px; opacity: .62; }
.auth-title { margin-bottom: 8px; font-size: clamp(28px, 2.4vw, 34px); line-height: var(--leading-tight); letter-spacing: -.04em; }
.auth-subtitle { margin-bottom: 34px; font-size: var(--text-sm); line-height: var(--leading-relaxed); }
.auth-form { gap: 18px; }
.auth-field { gap: 8px; }
.auth-field__label { font-size: 13px; font-weight: var(--font-semibold); }
.auth-input-wrap { width: 100%; }
.auth-input {
  height: 54px;
  padding-inline: 16px;
  border-color: var(--color-border);
  border-radius: 14px;
  background: var(--color-surface-2);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--color-on-primary) 42%, transparent), var(--shadow-xs);
}
.auth-input--icon { padding-left: 48px; }
.auth-input--password { padding-right: 50px; }
.auth-input__icon {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 1;
  width: 18px;
  height: 18px;
  color: var(--color-fg-subtle);
  transform: translateY(-50%);
  pointer-events: none;
}
.auth-pw-toggle { width: 50px; height: 54px; }
.auth-input:focus { background: var(--color-surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 13%, transparent), var(--shadow-xs); }
.auth-field__err:empty,
.auth-form-error:empty,
.auth-form-ok:empty { min-height: 0; }
.auth-submit { height: 54px; margin-top: 6px; border-radius: 14px; font-weight: var(--font-semibold); box-shadow: 0 12px 24px color-mix(in srgb, var(--color-primary) 22%, transparent); }
.auth-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 30px color-mix(in srgb, var(--color-primary) 28%, transparent); }
.auth-link { margin-top: -2px; font-size: 13px; }
.auth-controls {
  top: max(22px, calc(var(--safe-area-top) + 16px));
  right: max(22px, calc(env(safe-area-inset-right, 0px) + 16px));
  height: 42px;
  border-color: color-mix(in srgb, var(--color-border) 82%, transparent);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}
.auth-icon-btn,
.auth-lang { min-width: 42px; }

@media (max-width: 920px) {
  .auth-page { padding: 72px 24px 32px; }
  .auth-shell { display: block; width: min(510px, 100%); min-height: 0; border-radius: 28px; }
  .auth-showcase { display: none; }
  .auth-card { min-height: 620px; padding: 54px; }
}

@media (max-width: 560px) {
  .auth-page { display: block; padding: 0; background: var(--color-surface); }
  .auth-page::before { display: none; }
  .auth-shell { width: 100%; min-height: 100vh; min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
  .auth-card { justify-content: flex-start; min-height: 100vh; min-height: 100dvh; padding: max(92px, calc(var(--safe-area-top) + 82px)) 24px max(32px, env(safe-area-inset-bottom, 0px)); border-radius: 0; }
  .auth-brand { margin-bottom: 38px; }
  .auth-title { font-size: 29px; }
  .auth-subtitle { margin-bottom: 30px; }
  .auth-input,
  .auth-pw-toggle { height: 52px; }
  .auth-submit { height: 52px; }
  .auth-controls { top: max(18px, calc(var(--safe-area-top) + 12px)); right: max(18px, calc(env(safe-area-inset-right, 0px) + 12px)); }
}

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

/* Lume Precision authentication — shared visual language with the public
   product surface: quiet grid, precise typography and paper-like layers. */
.auth-page {
  padding: clamp(20px, 3vh, 36px) clamp(24px, 4vw, 64px);
  background:
    radial-gradient(720px 520px at 22% 18%, color-mix(in srgb, #c3c0ff 28%, transparent), transparent 68%),
    radial-gradient(620px 440px at 90% 86%, color-mix(in srgb, var(--color-primary) 9%, transparent), transparent 72%),
    color-mix(in srgb, var(--color-bg) 88%, #fcf8fa);
}
.auth-page::before {
  opacity: .48;
  background-image:
    linear-gradient(color-mix(in srgb, var(--color-border) 44%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--color-border) 44%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 18%, transparent 76%);
}
.auth-shell {
  grid-template-columns: minmax(0, 1.12fr) minmax(440px, .88fr);
  width: min(1280px, 100%);
  min-height: min(760px, calc(100vh - 64px)); min-height: min(760px, calc(100dvh - 64px));
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-color: color-mix(in srgb, #667085 32%, transparent);
  border-radius: 24px;
  background: var(--color-surface);
  box-shadow: 0 30px 90px color-mix(in srgb, #070b18 24%, transparent);
  backdrop-filter: none;
}
.auth-showcase {
  align-items: stretch;
  padding: clamp(42px, 4vw, 58px);
  color: #e9ecf5;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(620px 420px at 92% 4%, rgba(98,92,246,.28), transparent 70%),
    linear-gradient(155deg, #11162a 0%, #0b1020 64%, #090e1b 100%);
}
.auth-showcase::after {
  opacity:.7;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px) 0 0/100% 52px,
    linear-gradient(90deg,rgba(255,255,255,.025) 1px,transparent 1px) 0 0/52px 100%;
}
.auth-showcase__halo {
  top: -250px;
  right: 50%;
  width: 520px;
  border-color: color-mix(in srgb, var(--color-primary) 10%, transparent);
  box-shadow:
    0 0 0 64px color-mix(in srgb, var(--color-primary) 2.8%, transparent),
    0 0 0 128px color-mix(in srgb, var(--color-primary) 1.8%, transparent);
  transform: translateX(50%);
}
.auth-showcase__brand {
  flex-direction: row;
  justify-content:flex-start;
  gap: 12px;
  color: #f6f7fb;
  font-family: 'Sora', var(--font-sans);
  font-size: 25px;
  font-weight: 700;
}
.auth-showcase__brand-mark {
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.auth-showcase__brand-mark img { width: 50px; height: 50px; }
.auth-showcase__brand--company .auth-showcase__brand-mark {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-border) 76%, transparent);
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--color-fg) 8%, transparent);
}
.auth-showcase__brand--company .auth-showcase__brand-mark img {
  width: 42px;
  height: 42px;
  padding: 3px;
  object-fit: contain;
  border-radius: 14px;
}
.auth-showcase__brand--company > span:last-child {
  max-width: min(440px, 80%);
  overflow-wrap: anywhere;
  text-align: left;
}
.auth-showcase__chips {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
.auth-showcase__chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-full);
  color: #aeb6ca;
  background: rgba(255,255,255,.045);
  font-size: 10px;
  font-weight: var(--font-bold);
  letter-spacing: .055em;
  text-transform: uppercase;
}
.auth-showcase__chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--color-fg-subtle); }
.auth-showcase__chip--1 {
  color: #4b41e1;
  border-color: color-mix(in srgb, #4b41e1 22%, var(--color-border));
  background: color-mix(in srgb, #eef2ff 78%, var(--color-surface));
}
.auth-showcase__chip--1 i { background: #4b41e1; }
.auth-showcase__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-top: clamp(44px,6vh,70px);
  text-align: left;
}
.auth-showcase__eyebrow { display: none; }
.auth-showcase__copy h2 {
  max-width: 680px;
  color: #f7f8fc;
  font-family: 'Sora', var(--font-sans);
  font-size: clamp(40px, 4vw, 58px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.auth-showcase__copy h2 em { display: block; color: #9d98ff; font-style: normal; }
.auth-showcase__copy p {
  max-width: 570px;
  margin-top: 18px;
  color: #98a2b8;
  font-size: 16px;
  line-height: 1.65;
}
.auth-showcase__scene {
  width: 100%;
  margin-top: auto;
  padding: 14px;
  border-color: rgba(255,255,255,.11);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  backdrop-filter: none;
  transform: none;
}
.auth-showcase__scene-head { color: #9ea8bd; }
.auth-showcase__scene-status { display:inline-flex; align-items:center; gap:7px; color:#8ee7c7; }
.auth-showcase__scene-status i { width:6px; height:6px; margin:0; border-radius:50%; background:#55d9a9; box-shadow:0 0 0 4px rgba(85,217,169,.1); }
.auth-showcase__scene-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.auth-showcase__module {
  grid-template-columns: 36px minmax(0, 1fr) 7px;
  grid-template-rows:1fr;
  align-items:center;
  min-height: 70px;
  padding: 12px;
  border-color: rgba(255,255,255,.08);
  background: rgba(8,13,28,.44);
  box-shadow: none;
}
.auth-showcase__module-icon {
  grid-row:auto;
  width: 36px;
  height: 36px;
  border-radius:10px;
  background: rgba(98,92,246,.14);
  box-shadow: inset 0 0 0 1px rgba(157,152,255,.2);
}
.auth-showcase__module-icon .icon { width: 18px; height: 18px; color:#aaa6ff; }
.auth-showcase__module--2 .auth-showcase__module-icon { background: rgba(16,185,129,.1); box-shadow:inset 0 0 0 1px rgba(127,224,190,.18); }
.auth-showcase__module--2 .auth-showcase__module-icon .icon { color:#7fe0be; }
.auth-showcase__module--3 .auth-showcase__module-icon { background: rgba(245,158,11,.1); box-shadow:inset 0 0 0 1px rgba(247,201,122,.18); }
.auth-showcase__module--3 .auth-showcase__module-icon .icon { color:#f7c97a; }
.auth-showcase__module--4 .auth-showcase__module-icon { background: rgba(59,130,246,.1); box-shadow:inset 0 0 0 1px rgba(142,197,255,.18); }
.auth-showcase__module--4 .auth-showcase__module-icon .icon { color:#8ec5ff; }
.auth-showcase__module-copy { display:grid; gap:4px; min-width:0; }
.auth-showcase__module strong { color: #edf0f7; font-size:12px; }
.auth-showcase__module small { overflow:hidden; color:#7f8aa0; font-size:10px; text-overflow:ellipsis; white-space:nowrap; }
.auth-showcase__module-ready { width:7px; height:7px; border-radius:50%; background:#55d9a9; box-shadow:0 0 0 4px rgba(85,217,169,.08); }
.auth-showcase__secure {
  align-self: flex-start;
  margin-top: 12px;
  color: #7f8aa0;
}
.auth-card {
  justify-content: center;
  align-self: stretch;
  padding: clamp(48px, 5vw, 68px);
  border: 0;
  border-left: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-surface);
  box-shadow: 0 16px 44px color-mix(in srgb, var(--color-fg) 8%, transparent);
}
.auth-card__overline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
  color: #4b41e1;
  font-size: 10px;
  font-weight: var(--font-bold);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.auth-card__overline span { width: 24px; height: 1px; background: #4b41e1; }
.auth-brand { margin-bottom: 34px; padding-bottom: 20px; }
.auth-brand-full { height: 36px; }
.auth-title {
  font-family: 'Sora', var(--font-sans);
  font-size: clamp(30px, 2.6vw, 38px);
  letter-spacing: -.035em;
}
.auth-input { border-radius: 10px; background: var(--color-surface); box-shadow: 0 1px 2px color-mix(in srgb, var(--color-fg) 4%, transparent); }
.auth-login-assurance { display:flex; align-items:center; gap:12px; margin:22px 0 24px; padding:12px 13px; border:1px solid color-mix(in srgb,#625cf6 18%,var(--color-border)); border-radius:11px; background:color-mix(in srgb,var(--color-primary-soft) 42%,var(--color-surface)); }
.auth-login-assurance__icon { display:grid; place-items:center; width:34px; height:34px; flex:0 0 34px; border-radius:9px; color:#625cf6; background:color-mix(in srgb,var(--color-primary-soft) 82%,var(--color-surface)); }
.auth-login-assurance__icon .icon { width:17px; height:17px; }
.auth-login-assurance > span:last-child { display:grid; gap:3px; min-width:0; }
.auth-login-assurance strong { color:var(--color-fg); font-size:12px; }
.auth-login-assurance small { color:var(--color-fg-muted); font-size:10px; line-height:1.4; }
.auth-submit {
  border-radius: 10px;
  background: #141b2c;
  box-shadow: 0 10px 24px color-mix(in srgb, #141b2c 18%, transparent);
}
.auth-submit:hover:not(:disabled) { background: #222b3f; box-shadow: 0 14px 28px color-mix(in srgb, #141b2c 22%, transparent); }

:root[data-theme='dark'] .auth-showcase__chip--1 {
  color: #c3c0ff;
  background: color-mix(in srgb, #4b41e1 18%, var(--color-surface));
}
:root[data-theme='dark'] .auth-showcase__copy h2 em,
:root[data-theme='dark'] .auth-card__overline { color: #a9a4ff; }
:root[data-theme='dark'] .auth-card__overline span { background: #a9a4ff; }
:root[data-theme='dark'] .auth-submit { color: #141b2c; background: #f3f0f1; }
:root[data-theme='dark'] .auth-submit:hover:not(:disabled) { background: #ffffff; }

/* Keep the complete sign-in flow visible on common 13-inch laptop heights.
   The spacious composition above remains for tall desktop screens. */
@media (min-width: 921px) and (max-height: 800px) {
  .auth-page { padding: 18px; }
  .auth-shell { min-height: calc(100vh - 36px); min-height: calc(100dvh - 36px); }
  .auth-showcase { padding: 28px 40px 24px; }
  .auth-showcase__brand-mark { width:42px; height:42px; }
  .auth-showcase__brand-mark img { width:40px; height:40px; }
  .auth-showcase__chips { margin-top:14px; }
  .auth-showcase__copy { margin-top:26px; }
  .auth-showcase__copy h2 { font-size:clamp(34px,3.5vw,46px); }
  .auth-showcase__copy p { margin-top:12px; font-size:13px; line-height:1.55; }
  .auth-showcase__scene { margin-top:22px; padding:10px; }
  .auth-showcase__scene-head { min-height:24px; padding-bottom:7px; }
  .auth-showcase__module { min-height:56px; padding:9px; }
  .auth-showcase__module-icon { width:32px; height:32px; }
  .auth-showcase__secure { margin-top:10px; }
  .auth-card { padding:22px 48px; }
  .auth-card__overline { margin-bottom:10px; }
  .auth-brand { margin-bottom:10px; padding-bottom:10px; }
  .auth-brand-full { height:30px; }
  .auth-title { font-size:28px; }
  .auth-subtitle { margin-bottom:0; }
  .auth-login-assurance { margin:10px 0 12px; padding:8px 10px; }
  .auth-login-assurance__icon { width:30px; height:30px; flex-basis:30px; }
  .auth-form { gap:9px; }
  .auth-input { min-height:48px; }
  .auth-submit { min-height:48px; }
  .auth-divider { margin:9px 0; }
}

@media (max-width: 920px) {
  .auth-page { padding: 72px 24px 32px; }
  .auth-shell { display: block; width: min(520px, 100%); min-height: 0; padding: 10px; border-radius: 26px; }
  .auth-showcase { display: none; }
  .auth-card { min-height: 620px; padding: 48px; border-radius: 19px; }
}

@media (max-width: 560px) {
  .auth-page { display: block; padding: 0; background: var(--color-surface); }
  .auth-page::before { display: none; }
  .auth-shell { width: 100%; min-height: 100vh; min-height: 100dvh; padding: 0; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; }
  .auth-card { min-height: 100vh; min-height: 100dvh; padding: max(92px, calc(var(--safe-area-top) + 82px)) 24px max(32px, env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 0; box-shadow: none; }
  .auth-card__overline { margin-bottom: 20px; }
}

/* Android IME fallback. Appending this after both mobile auth variants is
   intentional: their padding:0 shorthands otherwise remove the extra scroll
   runway. The document becomes keyboard-height taller, so MainActivity's
   native inset callback can scroll the password and every action below it
   into the unobscured half of the screen. */
@media (max-width: 560px) {
  html.android-keyboard-open .auth-page {
    min-height: calc(100vh + var(--android-keyboard-height)); min-height: calc(100dvh + var(--android-keyboard-height));
    padding-bottom: var(--android-keyboard-height);
  }
}
