/*
  Login page — hero-style split layout.
  Brandbook references: Section 5.1 (full-height flow, no boxed wrapper),
  Section 2 (logomark/wordmark), Section 3 (typography), Section 4 (color).
*/

.login-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ---------- Hero / brand panel ---------- */

.login-hero {
  position: relative;
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-6);
  background: var(--surface);
  /* Seam between the two panels: a hairline border with a faint amber bloom
     bleeding into the form panel, so the split reads as one designed system
     rather than two stitched-together templates (brandbook Section 4.3 —
     accent reserved for actionable/connective moments like this seam). */
  border-right: 1px solid var(--border);
  box-shadow: 24px 0 48px -32px rgba(232, 163, 61, 0.35);
  overflow: hidden;
}

.login-hero__waveform {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.55;
}

/* Scrim behind the wordmark/tagline only: at this opacity, waveform bars
   and the light body text land close enough in luminance that bars
   crossing through letterforms (esp. "gets"/"approved.") fail a strict
   contrast check. A soft radial fade keeps the waveform visible everywhere
   except directly behind the type, rather than dimming the whole panel or
   the whole canvas. Sized/positioned to roughly match .login-hero__content's
   max-width, not the full hero panel. */
.login-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.login-hero__scrim::before {
  content: "";
  display: block;
  width: min(480px, 90%);
  height: 70%;
  background: radial-gradient(
    ellipse at center,
    rgba(20, 23, 26, 0.55) 0%,
    rgba(20, 23, 26, 0.35) 40%,
    transparent 70%
  );
}

.login-hero__content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  text-align: center;
  max-width: 420px;
}

/* Primary lockup: badge + wordmark, per Section 2 */
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: transparent;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 4px;
}

.brand-mark span {
  display: block;
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
}

/* short - tall - medium, asymmetric per Section 2 */
.brand-mark span:nth-child(1) { height: 40%; }
.brand-mark span:nth-child(2) { height: 100%; }
.brand-mark span:nth-child(3) { height: 65%; }

.brand-wordmark {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: var(--type-wordmark);
  letter-spacing: -0.015em;
  color: var(--text);
}

.login-hero__tagline {
  font-family: var(--font-brand);
  font-weight: 600;
  font-size: var(--type-hero);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0;
}

/* ---------- Form panel ---------- */

.login-form-panel {
  position: relative;
  flex: 1 1 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  background: var(--bg);
  overflow: hidden;
}

/* No waveform texture on this panel, deliberately: a form needs guaranteed
   legibility, and organic bar texture behind small UI text (labels, inputs,
   links) fights the one job this panel has. The tie-in to the hero panel
   comes from the amber seam glow on .login-hero's border instead — this
   side stays flat --bg, full stop. (Previously had a masked waveform bleed
   + a scrim to clear it from behind the form; removed both rather than
   keep patching contrast around texture that shouldn't compete with a
   form in the first place.) */

.login-form {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.login-form__header {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.login-form__title {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: var(--type-h1);
  color: var(--text);
  margin: 0;
}

.login-form__subtitle {
  font-family: var(--font-ui);
  font-size: var(--type-meta);
  color: var(--text-muted);
  margin: 0;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field label {
  font-family: var(--font-ui);
  font-size: var(--type-label);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.field input {
  font-family: var(--font-ui);
  font-size: var(--type-body);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  outline: none;
  transition: border-color 0.15s ease;
}

.field input::placeholder {
  color: var(--text-muted);
}

.field input:focus {
  border-color: var(--accent);
}

/* Chrome/Safari paint autofilled fields with their own white/yellow
   background via an internal UA style that a plain `background` property
   cannot override — this is almost certainly why input fields read as
   near-white in the browser despite `background: var(--surface)` above.
   The box-shadow-inset trick is the standard way to force the field back
   to a themed color; -webkit-text-fill-color keeps the text legible too. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  box-shadow: 0 0 0 1000px var(--surface) inset;
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  transition: background-color 5000s ease-in-out 0s;
}

.login-form__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--type-meta);
}

/* --text-secondary (#8B9096) at 12px reads as low-contrast/hard-to-scan
   next to the dark surfaces here — bumped to full --text for these two
   at-a-glance actions while keeping them visually quieter than the primary
   button via size/weight rather than color alone. */
.login-form__remember {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
}

.login-form__remember input[type="checkbox"] {
  accent-color: var(--accent);
}

.login-form__forgot {
  color: var(--text);
  text-decoration: none;
  opacity: 0.85;
}

.login-form__forgot:hover {
  opacity: 1;
  color: var(--accent);
}

.btn-primary {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: var(--type-body);
  color: var(--accent-ink);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  transition: filter 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.login-form__footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  /* Past the brandbook's largest spacing token (--space-6, 32px) on purpose
     — this footer needs to read as its own zone, clearly separated from
     the primary "Sign in" action above it, not just the next form row. */
  margin-top: calc(var(--space-6) + var(--space-3));
  font-size: var(--type-meta);
  color: var(--text-muted);
  text-align: center;
}

.login-form__footer a {
  color: var(--text-secondary);
  text-decoration: none;
}

.login-form__footer a:hover {
  color: var(--text);
}

/* "Request access" — signups are gated (prestige/high-ticket positioning
   per brandbook Section 1), so this is a meaningful conversion point and
   needs real visual weight, not a bare link (punch-list item 2). Styled as
   a quiet secondary button: outlined in accent, not filled — keeps the
   hierarchy clear that "Sign in" (.btn-primary) is still the primary action
   on this screen, while "Request access" reads as deliberately present
   rather than an afterthought link. */
.btn-secondary {
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: var(--type-body);
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn-secondary:hover {
  background: var(--accent-dim);
}

.btn-secondary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Responsive: stack on narrow viewports ---------- */

@media (max-width: 860px) {
  .login-shell {
    flex-direction: column;
  }

  .login-hero {
    flex: 0 0 auto;
    min-height: 280px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 24px 48px -32px rgba(232, 163, 61, 0.35);
    padding: var(--space-6) var(--space-4);
  }

  .login-hero__tagline {
    font-size: 26px;
  }

  .login-form-panel {
    flex: 1 1 auto;
    padding: var(--space-5) var(--space-4);
  }
}
