/* =============================================================================
   BUAMS AI new-ui — AUTH LAYOUT
   Spec: /frontend_design.md §H.1

   Split panel: brand/trust on the left, form on the right.

     ≥lg    two columns, both full height, independently scrollable
     md–lg  one column; brand panel becomes a compact horizontal header
     <md    one column; header reduces to the logo lockup, card goes flush
   ============================================================================= */

.bui-auth {
  display: flex;
  min-height: 100vh;
  /* Dynamic viewport unit: mobile browser chrome must not clip the submit
     button off the bottom of a 100vh column. */
  min-height: 100dvh;
  background: var(--bui-canvas);
}

/* ── Skip link (spec §I.9) ────────────────────────────────────────────────── */
.bui-skip-link {
  position: absolute;
  top: var(--bui-space-2);
  left: var(--bui-space-2);
  z-index: var(--bui-z-skiplink);
  padding: var(--bui-space-2) var(--bui-space-4);
  background: var(--bui-primary-700);
  border-radius: var(--bui-radius-md);
  color: #fff;
  font-size: var(--bui-text-sm);
  font-weight: var(--bui-fw-semibold);
  transform: translateY(-200%);
  transition: transform var(--bui-transition);
}

.bui-skip-link:focus {
  transform: translateY(0);
  color: #fff;
  text-decoration: none;
}

/* ── Brand panel ──────────────────────────────────────────────────────────── */
.bui-auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 0 0 var(--bui-auth-brand-w);
  max-width: var(--bui-auth-brand-max);
  padding: var(--bui-space-16) var(--bui-space-12);
  overflow: hidden;
  background: linear-gradient(
    160deg,
    var(--bui-primary-900) 0%,
    var(--bui-primary-700) 55%,
    var(--bui-primary-600) 100%
  );
  color: #fff;
}

/* The one decorative flourish in the system: a soft radial bloom. Subtle
   enough that it reads as depth rather than ornament (Philosophy: restraint). */
.bui-auth-brand::after {
  content: '';
  position: absolute;
  right: -18%;
  bottom: -22%;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, .10) 0%,
    rgba(255, 255, 255, 0) 70%
  );
  pointer-events: none;
}

.bui-auth-brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  max-width: 460px;
}

.bui-auth-brand-headline {
  margin-top: var(--bui-space-12);
  font-size: var(--bui-text-display);
  line-height: var(--bui-lh-tight);
  font-weight: var(--bui-fw-heavy);
  letter-spacing: -.02em;
  color: #fff;
}

.bui-auth-brand-sub {
  margin-top: var(--bui-space-4);
  font-size: var(--bui-text-body);
  line-height: var(--bui-lh-normal);
  color: rgba(255, 255, 255, .78);
}

/* ── Feature list ─────────────────────────────────────────────────────────── */
.bui-auth-features {
  margin-top: var(--bui-space-10);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--bui-space-5);
}

.bui-auth-feature {
  display: flex;
  align-items: flex-start;
  gap: var(--bui-space-3);
}

.bui-auth-feature-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--bui-radius-md);
  color: #fff;
  font-size: 1.05rem;
}

.bui-auth-feature-title {
  font-size: var(--bui-text-sm);
  font-weight: var(--bui-fw-bold);
  color: #fff;
}

.bui-auth-feature-sub {
  margin-top: 2px;
  font-size: var(--bui-text-xs);
  line-height: var(--bui-lh-snug);
  color: rgba(255, 255, 255, .68);
}

/* ── Trust strip ──────────────────────────────────────────────────────────
   Capability statements, not certification claims. Any badge asserting a
   certification must be approved by legal before it ships (spec §A). */
.bui-auth-trust {
  margin-top: auto;
  padding-top: var(--bui-space-10);
}

.bui-auth-trust-label {
  font-size: var(--bui-text-overline);
  font-weight: var(--bui-fw-heavy);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .52);
}

.bui-auth-trust-items {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bui-space-2) var(--bui-space-4);
  margin-top: var(--bui-space-3);
  list-style: none;
}

.bui-auth-trust-item {
  display: flex;
  align-items: center;
  gap: var(--bui-space-1);
  font-size: var(--bui-text-xs);
  font-weight: var(--bui-fw-medium);
  color: rgba(255, 255, 255, .82);
}

.bui-auth-trust-item .bi {
  color: rgba(255, 255, 255, .62);
  font-size: .95rem;
}

/* ── Form panel ───────────────────────────────────────────────────────────── */
.bui-auth-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  padding: var(--bui-space-12) var(--bui-space-6);
  overflow-y: auto;
}

.bui-auth-panel {
  width: 100%;
  max-width: var(--bui-auth-form-max);
}

/* Mobile-only brand header — the brand panel's stand-in below lg */
.bui-auth-mobile-header {
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--bui-space-6) var(--bui-space-4) 0;
}

/* ── Auth card ────────────────────────────────────────────────────────────── */
.bui-auth-card {
  background: var(--bui-surface);
  border: 1px solid var(--bui-line);
  border-radius: var(--bui-radius-xl);
  box-shadow: var(--bui-shadow-md);
  padding: var(--bui-space-10);
}

.bui-auth-card-head {
  margin-bottom: var(--bui-space-8);
}

.bui-auth-eyebrow {
  display: block;
  margin-bottom: var(--bui-space-2);
  font-size: var(--bui-text-overline);
  font-weight: var(--bui-fw-heavy);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bui-primary-700);
}

.bui-auth-title {
  font-size: var(--bui-text-h1);
  line-height: var(--bui-lh-tight);
  font-weight: var(--bui-fw-heavy);
  letter-spacing: -.01em;
  color: var(--bui-ink-900);
}

.bui-auth-sub {
  margin-top: var(--bui-space-2);
  font-size: var(--bui-text-sm);
  line-height: var(--bui-lh-normal);
  color: var(--bui-ink-500);
}

/* ── Logo lockup ──────────────────────────────────────────────────────────── */
.bui-lockup {
  display: inline-flex;
  align-items: center;
  gap: var(--bui-space-3);
  text-decoration: none;
}

.bui-lockup:hover {
  text-decoration: none;
}

.bui-lockup-mark {
  flex-shrink: 0;
  width: auto;
  height: 44px;
  max-width: 200px;
  object-fit: contain;
}

.bui-lockup-word {
  font-size: var(--bui-text-h2);
  font-weight: var(--bui-fw-heavy);
  letter-spacing: -.01em;
  color: var(--bui-ink-900);
}

/* On the dark brand panel.
   NO colour filter: the BUAMS asset is a full-colour 3D illustration, and
   brightness/invert would flatten it to a white silhouette. It is a mid-green
   mascot on a dark-green panel, so a soft drop-shadow supplies the edge
   separation that contrast alone does not. */
.bui-auth-brand .bui-lockup-mark {
  height: 68px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .32));
}

.bui-auth-brand .bui-lockup-word {
  color: #fff;
}

/* A tenant's own logo must never be recoloured — it is their brand, not ours.
   Unlike the BUAMS asset its artwork is unknown and may be dark-on-transparent,
   so it gets a light plate to guarantee it reads on any background. */
.bui-lockup-mark.is-tenant-logo {
  filter: none;
  height: 48px;
  background: #fff;
  padding: var(--bui-space-2);
  border-radius: var(--bui-radius-md);
}

/* ── Card footer / cross-links ────────────────────────────────────────────── */
.bui-auth-alt {
  margin-top: var(--bui-space-6);
  text-align: center;
  font-size: var(--bui-text-sm);
  color: var(--bui-ink-500);
}

.bui-auth-foot {
  margin-top: var(--bui-space-6);
  text-align: center;
  font-size: var(--bui-text-xs);
  line-height: var(--bui-lh-snug);
  color: var(--bui-ink-500);
}

.bui-auth-foot a {
  color: var(--bui-ink-500);
  text-decoration: underline;
}

.bui-auth-foot a:hover {
  color: var(--bui-primary-700);
}

/* Divider with centred label */
.bui-auth-divider {
  display: flex;
  align-items: center;
  gap: var(--bui-space-3);
  margin: var(--bui-space-6) 0;
  font-size: var(--bui-text-xs);
  color: var(--bui-ink-500);
}

.bui-auth-divider::before,
.bui-auth-divider::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--bui-line);
}

/* =============================================================================
   RESPONSIVE (spec §H.1)
   ============================================================================= */

/* md–lg: brand panel becomes a compact horizontal header */
@media (max-width: 991.98px) {
  .bui-auth {
    flex-direction: column;
  }

  .bui-auth-brand {
    flex: 0 0 auto;
    max-width: none;
    padding: var(--bui-space-6) var(--bui-space-6);
  }

  .bui-auth-brand::after {
    display: none;
  }

  .bui-auth-brand-inner {
    max-width: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--bui-space-4);
  }

  /* Everything but the lockup and the one-line value prop is desktop-only */
  .bui-auth-features,
  .bui-auth-trust,
  .bui-auth-brand-sub {
    display: none;
  }

  .bui-auth-brand-headline {
    margin-top: 0;
    font-size: var(--bui-text-body);
    font-weight: var(--bui-fw-semibold);
    letter-spacing: 0;
    color: rgba(255, 255, 255, .82);
    text-align: right;
  }

  .bui-auth-main {
    padding: var(--bui-space-10) var(--bui-space-6);
    justify-content: flex-start;
  }

  .bui-auth-panel {
    max-width: 520px;
    margin: 0 auto;
  }
}

/* <md: header reduces to the logo; card goes flush to the gutters */
@media (max-width: 767.98px) {
  .bui-auth-brand-headline {
    display: none;
  }

  .bui-auth-brand-inner {
    justify-content: center;
  }

  .bui-auth-main {
    padding: var(--bui-space-8) var(--bui-space-4);
  }

  .bui-auth-card {
    padding: var(--bui-space-6);
    border-radius: var(--bui-radius-lg);
    box-shadow: var(--bui-shadow-sm);
  }
}

@media (max-width: 575.98px) {
  .bui-auth-brand {
    padding: var(--bui-space-5) var(--bui-space-4);
  }

  .bui-auth-brand .bui-lockup-mark {
    height: 40px;
  }

  .bui-auth-main {
    padding: var(--bui-space-6) var(--bui-space-3);
  }

  .bui-auth-card {
    padding: var(--bui-space-5) var(--bui-space-4);
  }

  .bui-auth-card-head {
    margin-bottom: var(--bui-space-6);
  }

  .bui-auth-title {
    font-size: var(--bui-text-h2);
  }
}

/* Short landscape phones: a fixed 100dvh column would put the submit button
   below the fold with no way to reach it. */
@media (max-height: 560px) and (min-width: 992px) {
  .bui-auth-brand,
  .bui-auth-main {
    padding-top: var(--bui-space-8);
    padding-bottom: var(--bui-space-8);
  }

  .bui-auth-brand-headline {
    margin-top: var(--bui-space-6);
  }

  .bui-auth-features {
    margin-top: var(--bui-space-6);
    gap: var(--bui-space-3);
  }

  .bui-auth-trust {
    padding-top: var(--bui-space-6);
  }
}
