/* Beta Sigma Design System -- <bs-login> (P3).
   docs/frontend/FROZEN_MIGRATION_PLAN.md §8.3.1. Reproduces the owner-
   APROVADO Child 2 Login visual outcome (bs-pilot-r9-05daa63) exactly --
   values copied from assets/mm_pilot.css's own .bs-pilot__login/__card/
   __brand*/__field/__btn*/__lang*/__footer rules (a design reference, not a
   file linked here). Only the composing technology changes: real
   assets/ds/bs-input.js and assets/ds/bs-button.js (both unmodified)
   compose inside this component's own light DOM.

   Every ordinary selector is scoped beneath the bs-login custom-element
   tag. No new --bs-* token is declared. */

bs-login {
  display: block;
  min-height: 100vh;
}

bs-login .bs-login__canvas {
  position: relative;
  /* §8.4.7 -- z-index:0 turns this rule's own existing `position: relative`
     into a real stacking context, containing the additive
     <bs-particle-background> child's negative z-index here (see
     bs-particle-background.css) rather than the document root -- the
     same technique already used for bs-home.css's own .bs-home__canvas. */
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--bs-space-7);
  min-height: 100vh;
  padding: var(--bs-space-9) var(--bs-space-6) var(--bs-space-11);
  background: var(--bs-color-canvas);
}

/* ---- Brand lockup ---- */

bs-login .bs-login__brand {
  display: flex;
  align-items: center;
  gap: var(--bs-space-3);
}

bs-login .bs-login__brand-mark {
  display: block;
  width: auto;
  height: 56px;
  flex: 0 0 auto;
}

bs-login .bs-login__brand-word {
  display: flex;
  flex-direction: column;
  line-height: 0.92;
}

bs-login .bs-login__brand-word span {
  display: block;
  font-family: var(--bs-font-display);
  letter-spacing: 0.02em;
}

bs-login .bs-login__brand-beta {
  font-weight: 800;
  font-size: 26px;
  color: var(--bs-color-accent-text);
}

bs-login .bs-login__brand-sigma {
  font-weight: 800;
  font-size: 26px;
  color: var(--bs-color-text-primary);
}

bs-login .bs-login__brand-analytics {
  margin-top: 4px;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bs-color-text-muted);
}

/* ---- Card ---- */

bs-login .bs-login__card {
  width: 100%;
  max-width: 460px;
  padding: var(--bs-space-6);
  background: var(--bs-color-surface);
  border: 1px solid var(--bs-color-border);
  border-radius: var(--bs-radius-lg);
  box-shadow: 0 10px 30px var(--bs-color-shadow);
}

bs-login .bs-login__display {
  font-family: var(--bs-font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  font-size: clamp(22px, 3.4vw, 28px);
  line-height: 1.02;
  text-wrap: balance;
  color: var(--bs-color-text-primary);
  text-align: center;
  margin: 0 0 var(--bs-space-4);
}

bs-login form {
  display: flex;
  flex-direction: column;
}

bs-login bs-input {
  margin-bottom: var(--bs-space-3);
}

bs-login bs-button {
  width: 100%;
}

/* ---- Message region ---- */

bs-login .bs-login__message {
  min-height: 1.25em;
  margin-top: var(--bs-space-2);
  font-size: 13px;
  text-align: center;
  color: var(--bs-hot-500);
}

/* ---- Subscribe (real anchor, styled to match the DS secondary-button
   language -- not <bs-button>, which never renders an <a>) ---- */

bs-login .bs-login__subscribe {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 36px;
  margin-top: var(--bs-space-3);
  padding: 0 var(--bs-space-4);
  border: 1px solid var(--bs-color-border-strong);
  border-radius: var(--bs-radius-sm);
  background: transparent;
  color: var(--bs-color-text-primary);
  font-family: var(--bs-font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--bs-motion-fast) var(--bs-ease-standard),
    color var(--bs-motion-fast) var(--bs-ease-standard);
}

bs-login .bs-login__forgot {
  display: block;
  margin-top: var(--bs-space-3);
  text-align: center;
  color: var(--bs-color-text-secondary);
  font-family: var(--bs-font-display);
  font-size: 13px;
  text-decoration: underline;
}

bs-login .bs-login__forgot[hidden] {
  display: none;
}

bs-login .bs-login__forgot:hover {
  color: var(--bs-color-accent-text);
}

bs-login .bs-login__forgot:focus-visible,
bs-login .bs-login__subscribe:focus-visible {
  outline: 2px solid var(--bs-color-accent);
  outline-offset: 2px;
}

bs-login .bs-login__subscribe:hover {
  border-color: var(--bs-color-accent);
  color: var(--bs-color-accent-text);
}

bs-login .bs-login__subscribe:focus-visible,
bs-login .bs-login__lang-option:focus-visible {
  outline: 2px solid var(--bs-color-accent);
  outline-offset: 2px;
  border-radius: var(--bs-radius-xs);
}

/* ---- Language selector ---- */

bs-login .bs-login__lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bs-space-2);
  margin-bottom: var(--bs-space-4);
}

bs-login .bs-login__lang-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--bs-space-1);
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity var(--bs-motion-fast) var(--bs-ease-standard);
}

bs-login .bs-login__lang-option.is-active {
  opacity: 1;
}

bs-login .bs-login__lang-label {
  font-size: 10px;
  color: var(--bs-color-text-secondary);
}

bs-login .bs-login__lang-flag {
  display: block;
  width: 26px;
  height: 18px;
}

/* ---- Footer ---- */

bs-login .bs-login__footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--bs-space-3);
  padding: var(--bs-space-3) var(--bs-space-4);
  padding-bottom: max(var(--bs-space-3), env(safe-area-inset-bottom));
}

bs-login .bs-login__powered {
  font-size: 12px;
  text-align: center;
  color: var(--bs-color-text-muted);
}

/* ---- Responsive (mechanically reproduced from the approved reference's
   own single @media (max-width: 768px) block) ---- */

@media (max-width: 768px) {
  bs-login .bs-login__canvas {
    padding: var(--bs-space-8) var(--bs-space-5) var(--bs-space-11);
  }

  bs-login .bs-login__brand-mark {
    height: 44px;
  }

  bs-login .bs-login__brand-beta,
  bs-login .bs-login__brand-sigma {
    font-size: 22px;
  }
}
