/* Cerbero auth surfaces (login, MFA, SaaS activation/reset) on the SHARED CodyCloud design system.
   Uses the same tokens as the console (app-kit --bg/--fg/--accent/--border/--r/--font, dark-aware via
   html[data-theme="dark"]), so the login, MFA and console all read as one product. No bootstrap, no legacy
   login CSS. Cloudflare-like: a quiet branded panel beside a focused form card, collapsing to a single
   centered card on narrow screens. */

.as-auth {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.as-auth__shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

/* Left: quiet branded panel */
.as-auth__visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  background:
    radial-gradient(120% 90% at 18% 12%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 60%),
    radial-gradient(110% 80% at 85% 90%, color-mix(in srgb, var(--accent-2, var(--accent)) 18%, transparent), transparent 62%),
    var(--surface);
  border-right: 1px solid var(--border);
}

.as-auth__visual_brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.as-auth__visual_brand img {
  height: 30px;
  width: auto;
}

.as-auth__visual_copy {
  max-width: 420px;
}

.as-auth__eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--fg) 62%, var(--bg));
  margin-bottom: 14px;
}

.as-auth__visual_copy h1 {
  margin: 0 0 12px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.as-auth__visual_copy p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: color-mix(in srgb, var(--fg) 70%, var(--bg));
}

.as-auth__orbits {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
}
.as-auth__orbits span {
  position: absolute;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.as-auth__orbits span:nth-child(1) { width: 440px; height: 440px; right: -140px; top: 20%; }
.as-auth__orbits span:nth-child(2) { width: 260px; height: 260px; right: -40px; top: 44%; border-color: color-mix(in srgb, var(--accent) 18%, transparent); }

/* Right: focused form card */
.as-auth__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.as-auth__card {
  width: 100%;
  max-width: 400px;
}

.as-auth__card_logo {
  display: none; /* shown only when the branded panel is hidden (narrow) */
  height: 30px;
  margin-bottom: 28px;
}

.as-auth__title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.as-auth__subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  line-height: 1.55;
  color: color-mix(in srgb, var(--fg) 64%, var(--bg));
}

.as-auth__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.as-auth__field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.as-auth__field label {
  font-size: 13px;
  font-weight: 600;
  color: color-mix(in srgb, var(--fg) 82%, var(--bg));
}

.as-auth__input_wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.as-auth__input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm, 6px);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.as-auth__input::placeholder { color: color-mix(in srgb, var(--fg) 40%, var(--bg)); }
.as-auth__input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.as-auth__input--token {
  font-family: var(--mono, "Fira Code", monospace);
  letter-spacing: 0.2em;
}

.as-auth__reveal {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm, 6px);
  color: color-mix(in srgb, var(--fg) 55%, var(--bg));
  background: none;
  border: none;
  cursor: pointer;
}
.as-auth__reveal:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.as-auth__reveal .as-icon { width: 18px; height: 18px; }

.as-auth__lang {
  position: absolute;
  right: 6px;
  height: 30px;
  padding: 0 8px;
  font-size: 12px;
  font-family: var(--font);
  color: color-mix(in srgb, var(--fg) 62%, var(--bg));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm, 6px);
  cursor: pointer;
}

.as-auth__submit {
  margin-top: 4px;
  height: 44px;
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm, 6px);
  cursor: pointer;
  transition: filter 0.15s ease;
}
.as-auth__submit:hover { filter: brightness(1.08); }
.as-auth__submit:active { filter: brightness(0.95); }

.as-auth__alert {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--err-ink, #ff4d4f);
  background: color-mix(in srgb, var(--err-ink, #ff4d4f) 12%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--err-ink, #ff4d4f) 40%, var(--bg));
  border-radius: var(--r-sm, 6px);
}

.as-auth__mfa_info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px;
  margin-bottom: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r, 8px);
}
.as-auth__mfa_qr {
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: var(--r-sm, 6px);
  padding: 8px;
}
.as-auth__mfa_qr svg { width: 100%; height: 100%; }
.as-auth__mfa_secret {
  margin: 0;
  font-family: var(--mono, "Fira Code", monospace);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--fg);
  word-break: break-all;
  text-align: center;
}

/* Responsive: collapse the branded panel, center the card */
@media (max-width: 860px) {
  .as-auth__shell { grid-template-columns: 1fr; }
  .as-auth__visual { display: none; }
  .as-auth__card_logo { display: block; }
}
