/*
 * Auth redesign: sign in / sign up / forgot password.
 * Vuexy cover layout (authentication-wrapper authentication-cover) with a brand panel on the left
 * and the form on the right. Loaded after core.css, demo.css and page-auth.css.
 */

/* ---------------------------------------------------------------------------
 * Variables
 * ------------------------------------------------------------------------- */
.auth-page {
  /* BLASTseq violet palette, derived from --bs-primary #8A42FF. */
  --auth-brand-900: #301759;
  --auth-brand-700: #5a2ba6;
  --auth-brand-600: #6e35cc; /* primary hover / active */
  --auth-brand-500: #8a42ff; /* = --bs-primary */
  --auth-brand-300: #c4a0ff; /* disabled primary button */
  --auth-brand-200: #dcc6ff;
  --auth-brand-100: #ede3ff; /* matches the app's #ECE1FF */
  --auth-brand-50: #f6f0ff;
  --auth-brand-rgb: 138, 66, 255;
  --auth-focus-ring: 0 0 0 0.2rem rgba(var(--auth-brand-rgb), 0.25);

  /* Brand panel. Fixed colours so it looks the same in light and dark themes.
     160deg runs top -> bottom, so the darkest stop sits behind the small text at the bottom. */
  --auth-brand-gradient: linear-gradient(160deg, var(--auth-brand-500) 0%, var(--auth-brand-700) 55%, var(--auth-brand-900) 100%);
  --auth-brand-text: #fff;
  --auth-brand-text-muted: rgba(255, 255, 255, 0.78);
  --auth-brand-chip-bg: rgba(255, 255, 255, 0.14);

  /* Form panel */
  --auth-form-max-width: 400px;
  --auth-control-height: 2.5rem; /* 40px */
  --auth-radius: 0.5rem; /* 8px */
  --auth-title-size: 1.375rem; /* 22px */

  /* Vuexy tokens that core.css still derives from its stock (blue-violet) primary, re-pointed at the brand
     violet on auth pages only. (Global fix in core.css is a follow-up.) */
  --bs-primary-rgb: var(--auth-brand-rgb);
  --bs-primary-bg-subtle: var(--auth-brand-100);
  --bs-primary-border-subtle: var(--auth-brand-200);
  --bs-primary-text-emphasis: #452180;
  --bs-link-color: var(--auth-brand-500);
  --bs-link-color-rgb: var(--auth-brand-rgb);
  --bs-link-hover-color: var(--auth-brand-600);
  --bs-link-hover-color-rgb: 110, 53, 204;
  --bs-custom-link-color: var(--auth-brand-500);
}

[data-bs-theme="dark"] .auth-page {
  --bs-primary-bg-subtle: rgba(var(--auth-brand-rgb), 0.16);
  --bs-primary-border-subtle: rgba(var(--auth-brand-rgb), 0.4);
  --bs-primary-text-emphasis: var(--auth-brand-200);
}

/* ---------------------------------------------------------------------------
 * Layout
 * ------------------------------------------------------------------------- */
.auth-page .authentication-wrapper.auth-split .authentication-inner {
  /* page-auth.css fixes the cover inner to 100vh below xl; let it grow with content instead. */
  block-size: auto;
  min-block-size: 100vh;
}

.auth-brand-panel {
  position: sticky;
  inset-block-start: 0;
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
  max-block-size: 100vh;
  padding: 2.5rem 2.5rem 3rem;
  background: var(--auth-brand-gradient);
  color: var(--auth-brand-text);
}

.auth-form-panel {
  display: flex;
  flex-direction: column;
  min-block-size: 100vh;
  background-color: var(--bs-paper-bg);
}

.auth-form-container {
  inline-size: 100%;
  max-inline-size: var(--auth-form-max-width);
  margin: auto;
  padding: 3rem 1.5rem;
}

/* ---------------------------------------------------------------------------
 * Brand panel content
 * ------------------------------------------------------------------------- */
.auth-brand-link {
  display: inline-block;
  align-self: flex-start;
}

/* Swap point: replace logo.png with a white logo file later and drop the filter. */
.auth-brand-logo {
  display: block;
  inline-size: 100%;
  max-inline-size: 220px;
  block-size: auto;
  filter: brightness(0) invert(1);
}

.auth-brand-headline {
  margin-block: 3rem 0;
  max-inline-size: 18ch;
  color: var(--auth-brand-text);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.35;
}

.auth-brand-points {
  display: grid;
  gap: 1.5rem;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.auth-brand-point {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
}

.auth-brand-point-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  inline-size: 2.25rem;
  block-size: 2.25rem;
  border-radius: 50%;
  background: var(--auth-brand-chip-bg);
  color: var(--auth-brand-text);
}

.auth-brand-point-title {
  margin: 0 0 0.125rem;
  color: var(--auth-brand-text);
  font-size: 0.9375rem;
  font-weight: 600;
}

.auth-brand-point-text {
  margin: 0;
  color: var(--auth-brand-text-muted);
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Logo above the form when the brand panel is hidden (< lg). */
.auth-mobile-brand {
  display: inline-block;
  margin-block-end: 2rem;
}

.auth-mobile-brand img {
  display: block;
  inline-size: 100%;
  max-inline-size: 190px;
  block-size: auto;
}

/* ---------------------------------------------------------------------------
 * Form panel content
 * ------------------------------------------------------------------------- */
.auth-title {
  margin-block-end: 1.5rem;
  font-size: var(--auth-title-size);
  font-weight: 600;
  line-height: 1.3;
}

.auth-form {
  --bs-border-radius: var(--auth-radius);
}

.auth-form .form-control {
  min-block-size: var(--auth-control-height);
}

.auth-form .input-group-merge .input-group-text {
  min-block-size: var(--auth-control-height);
}

.auth-page .auth-btn {
  --bs-btn-border-radius: var(--auth-radius);
  min-block-size: var(--auth-control-height);
  font-weight: 500;
}

/* ---------------------------------------------------------------------------
 * Brand palette on Vuexy components (auth pages only)
 * ------------------------------------------------------------------------- */

/* Primary button: flat (no Vuexy shadow), brand-600 on hover/active, brand-300 when disabled. */
.auth-page .btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--auth-brand-500);
  --bs-btn-border-color: var(--auth-brand-500);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--auth-brand-600);
  --bs-btn-hover-border-color: var(--auth-brand-600);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--auth-brand-600);
  --bs-btn-active-border-color: var(--auth-brand-600);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--auth-brand-300);
  --bs-btn-disabled-border-color: var(--auth-brand-300);
  --bs-btn-disabled-opacity: 1;
  --bs-btn-box-shadow: none;
  --bs-btn-active-shadow: none;
  --bs-btn-focus-box-shadow: var(--auth-focus-ring);
  box-shadow: none;
}

[data-bs-theme="dark"] .auth-page .btn-primary {
  --bs-btn-disabled-bg: rgba(var(--auth-brand-rgb), 0.35);
  --bs-btn-disabled-border-color: transparent;
}

/* Outline primary (Sandbox): brand-500 border/text, brand-50 tint on hover. */
.auth-page .btn-outline-primary {
  --bs-btn-color: var(--auth-brand-500);
  --bs-btn-border-color: var(--auth-brand-500);
  --bs-btn-hover-color: var(--auth-brand-500);
  --bs-btn-hover-bg: var(--auth-brand-50);
  --bs-btn-hover-border-color: var(--auth-brand-500);
  --bs-btn-active-color: var(--auth-brand-600);
  --bs-btn-active-bg: var(--auth-brand-50);
  --bs-btn-active-border-color: var(--auth-brand-600);
  --bs-btn-box-shadow: none;
  --bs-btn-active-shadow: none;
  --bs-btn-focus-box-shadow: var(--auth-focus-ring);
  box-shadow: none;
}

[data-bs-theme="dark"] .auth-page .btn-outline-primary {
  --bs-btn-hover-bg: rgba(var(--auth-brand-rgb), 0.12);
  --bs-btn-active-bg: rgba(var(--auth-brand-rgb), 0.12);
}

/* One focus ring for buttons, inputs and checkboxes. */
.auth-page .btn:focus-visible {
  outline: 0;
  box-shadow: var(--auth-focus-ring);
}

.auth-page .form-control:focus,
.auth-page .form-check-input:focus {
  border-color: var(--auth-brand-500);
  box-shadow: var(--auth-focus-ring);
}

/* Merged input groups (password + toggle): ring on the group, not on the inner input. */
.auth-page .input-group-merge .form-control:focus {
  box-shadow: none;
}

.auth-page .input-group:focus-within {
  border-radius: var(--auth-radius);
  box-shadow: 0 0 0 var(--bs-border-width) var(--auth-brand-500), var(--auth-focus-ring);
}

.auth-page .input-group:focus-within::before {
  box-shadow: none;
}

.auth-page .form-check-input:checked {
  border-color: var(--auth-brand-500);
  background-color: var(--auth-brand-500);
}

/* Links: brand-500, brand-600 on hover (legal footer overrides this below). */
.auth-page a:hover {
  --bs-custom-link-color: var(--auth-brand-600);
}

/* Referral banner on Vuexy's alert-primary, using the re-pointed subtle tokens. */
.auth-page .auth-referral.alert-primary {
  --bs-alert-color: var(--bs-primary-text-emphasis);
  --bs-alert-bg: var(--bs-primary-bg-subtle);
  --bs-alert-border-color: var(--bs-primary-border-subtle);
  --bs-alert-link-color: var(--bs-primary-text-emphasis);
  border: 1px solid var(--bs-primary-border-subtle);
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-block-end: 0.25rem;
}

.auth-label-row .form-label {
  margin-block-end: 0;
}

.auth-label-row a {
  font-size: 0.8125rem;
}

/* Password show/hide: a real button so it is keyboard reachable. */
.auth-password-toggle {
  border-color: var(--bs-border-color);
  background-color: transparent;
  color: var(--bs-secondary-color);
  cursor: pointer;
}

.auth-password-toggle:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 0.125rem rgba(var(--auth-brand-rgb), 0.45);
}

.auth-alert {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.875rem;
}

.auth-alert .icon-base {
  flex: 0 0 auto;
  margin-block-start: 0.125rem;
}

.auth-switch {
  margin-block: 1.5rem 0;
  text-align: center;
}

/* Social buttons (rendered only when GOOGLE_CLIENT_ID / APPLE_SIGNIN_ENABLED is set; styles live here instead of inline). */
/* Same primary border as the outlined "Log into the Sandbox" button (btn-outline-primary). */
.btn-auth-google {
  border: 1px solid var(--auth-brand-500);
  background-color: var(--bs-paper-bg);
  color: var(--bs-heading-color);
}

.btn-auth-google:hover,
.btn-auth-google:focus-visible,
.btn-auth-google:active {
  border-color: var(--auth-brand-500);
  background-color: var(--auth-brand-50);
  color: var(--bs-heading-color);
}

[data-bs-theme="dark"] .btn-auth-google:hover,
[data-bs-theme="dark"] .btn-auth-google:focus-visible,
[data-bs-theme="dark"] .btn-auth-google:active {
  background-color: rgba(var(--auth-brand-rgb), 0.12);
}

.btn-auth-apple,
.btn-auth-apple:hover,
.btn-auth-apple:focus-visible {
  border: 1px solid #000;
  background-color: #000;
  color: #fff;
}

/* Legal links footer at the bottom of the form panel (full panel width, so it stays on one line
   on desktop): muted, "·" separators, primary colour only on hover/focus. Wraps on narrow screens. */
.auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.25rem;
  align-items: center;
  justify-content: center;
  padding: 0 1rem 1.5rem;
  font-size: 0.8125rem;
  text-align: center;
}

.auth-legal-links a {
  color: var(--bs-secondary-color);
  text-decoration: none;
}

.auth-legal-links a:hover,
.auth-legal-links a:focus-visible {
  color: var(--auth-brand-500);
}

.auth-legal-separator {
  margin: 0 0.5rem;
  color: var(--bs-secondary-color);
}

/* ---------------------------------------------------------------------------
 * Signup: brand-panel vertical stepper (mirrors the form's current step)
 * ------------------------------------------------------------------------- */
.auth-steps {
  display: grid;
  gap: 1.75rem;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
}

.auth-step {
  position: relative;
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  color: var(--auth-brand-text-muted);
}

/* Thin connector between circles */
.auth-step:not(:last-child)::after {
  position: absolute;
  inset-block: 2.25rem -1.5rem;
  inset-inline-start: calc(1rem - 0.5px);
  inline-size: 1px;
  background: rgba(255, 255, 255, 0.3);
  content: "";
}

/* Upcoming step: 1px white/55% outline */
.auth-step-circle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  inline-size: 2rem;
  block-size: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: var(--auth-brand-text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.auth-step-circle .icon-base {
  display: none;
}

.auth-step-title {
  margin: 0.25rem 0 0.125rem;
  color: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
}

.auth-step-text {
  margin: 0;
  font-size: 0.8125rem;
}

.auth-step.is-current,
.auth-step.is-complete {
  color: var(--auth-brand-text);
}

/* Current step: white circle, brand-700 number */
.auth-step.is-current .auth-step-circle {
  border-color: #fff;
  background: #fff;
  color: var(--auth-brand-700);
}

/* Completed step: translucent white circle, white check */
.auth-step.is-complete .auth-step-circle {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.auth-step.is-complete .auth-step-circle .icon-base {
  display: inline-block;
}

.auth-step.is-complete .auth-step-circle .auth-step-number {
  display: none;
}

/* ---------------------------------------------------------------------------
 * Signup: one form, step panels driven by bs-stepper.js (vendor bs-stepper.css not loaded)
 * ------------------------------------------------------------------------- */
.auth-stepper .content {
  display: none;
}

.auth-stepper .content.active {
  display: block;
}

/* Compact horizontal stepper above the form (< lg). Built on bs-stepper's .step/.step-trigger hooks. */
.auth-stepper .bs-stepper-header {
  display: flex;
  align-items: center;
  margin-block-end: 1.75rem;
}

.auth-stepper .bs-stepper-header .step-trigger {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
  font-weight: 500;
  opacity: 1;
  pointer-events: none; /* navigation happens through Continue / Back */
}

.auth-stepper .bs-stepper-header .line {
  flex: 1 1 auto;
  block-size: 1px;
  margin-inline: 0.625rem;
  background-color: var(--bs-border-color);
}

.auth-stepper .bs-stepper-header .bs-stepper-circle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  inline-size: 1.5rem;
  block-size: 1.5rem;
  border: 1.5px solid var(--bs-border-color);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
}

.auth-stepper .bs-stepper-header .step.active .step-trigger,
.auth-stepper .bs-stepper-header .step.is-complete .step-trigger {
  color: var(--bs-heading-color);
}

.auth-stepper .bs-stepper-header .step.active .bs-stepper-circle {
  border-color: var(--auth-brand-500);
  background-color: var(--auth-brand-500);
  color: #fff;
}

.auth-stepper .bs-stepper-header .step.is-complete .bs-stepper-circle {
  border-color: var(--bs-primary-border-subtle);
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
}

/* "Step x of 3" pill */
.auth-step-counter {
  display: inline-block;
  margin-block: -0.75rem 1.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: 999px;
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-size: 0.75rem;
  font-weight: 500;
}

.auth-step-actions {
  display: flex;
  gap: 0.75rem;
  margin-block-start: 1.5rem;
}

.auth-step-actions .btn-primary {
  flex: 1 1 auto;
}

/* Helper text under a field (Bootstrap .form-text). Sits after .invalid-feedback, so an error
   message shows first and the hint stays underneath it. */
.auth-form .form-text {
  margin-block-start: 0.375rem;
  color: var(--bs-secondary-color);
  font-size: 0.8125rem;
}

.auth-referral {
  margin-block-end: 1.25rem;
}

/* Password strength meter + checklist (rules mirror _validate_change_password) */
.auth-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin-block-start: 0.625rem;
}

.auth-strength-bar {
  block-size: 0.25rem;
  border-radius: 999px;
  background-color: var(--bs-border-color);
}

/* Status colours are Vuexy's own variables: weak = danger, fair = warning, good/strong = success. */
.auth-strength[data-level="1"] .auth-strength-bar:nth-child(-n + 1) { background-color: var(--bs-danger); }
.auth-strength[data-level="2"] .auth-strength-bar:nth-child(-n + 2) { background-color: var(--bs-warning); }
.auth-strength[data-level="3"] .auth-strength-bar:nth-child(-n + 3) { background-color: var(--bs-success); }
.auth-strength[data-level="4"] .auth-strength-bar:nth-child(-n + 4) { background-color: var(--bs-success); }

.auth-strength-label {
  margin-block-start: 0.375rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
}

.auth-rules {
  display: grid;
  gap: 0.25rem;
  margin: 0.625rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
}

.auth-rule {
  display: flex;
  gap: 0.375rem;
  align-items: center;
  color: var(--bs-secondary-color);
}

.auth-rule .icon-base {
  font-size: 1rem;
}

.auth-rule.is-met {
  color: var(--bs-success);
}

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .auth-form-container {
    margin-block-start: 0;
    padding: 2rem 1rem;
  }
}

/* ---------------------------------------------------------------------------
 * Reduced motion
 * ------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .auth-page *,
  .auth-page *::before,
  .auth-page *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------------------------------------------------------------------------
 * Signup step 2: email verification code (OTP)
 * ------------------------------------------------------------------------- */
.auth-otp-title {
  margin-block-end: 0.375rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

.auth-otp-text {
  margin-block-end: 1.25rem;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.auth-otp-text strong {
  color: var(--bs-heading-color);
  word-break: break-all;
}

/* Six square boxes that shrink evenly down to 375px screens. */
.auth-otp {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 3rem));
  gap: 0.5rem;
  justify-content: start;
}

.auth-otp .form-control {
  block-size: 3rem;
  padding: 0;
  border-radius: var(--auth-radius);
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
  /* Bootstrap draws a validation icon inside .is-valid/.is-invalid fields; there's no room in a digit box. */
  background-image: none !important;
}

.auth-otp .form-control:focus {
  border-color: var(--auth-brand-500);
  box-shadow: var(--auth-focus-ring);
}

.auth-otp .form-control.is-invalid {
  border-color: var(--bs-danger);
}

.auth-otp .form-control.is-valid {
  border-color: var(--bs-success);
}

.auth-otp-resend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: baseline;
  margin-block: 1rem 0;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}

.auth-otp-resend .btn-link {
  font-size: inherit;
  font-weight: 500;
  text-decoration: none;
}

.auth-otp-resend .btn-link:disabled {
  color: var(--bs-secondary-color);
  opacity: 1;
}

/* "Email verified" under the email field when the user comes back to step 1. */
.auth-form .auth-email-verified {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  color: var(--bs-success);
}

.auth-form .auth-email-verified[hidden] {
  display: none;
}

/* Four steps don't fit with labels on small phones: show only the active step's label there. */
@media (max-width: 575.98px) {
  .auth-stepper .bs-stepper-header .step:not(.active) .bs-stepper-label {
    display: none;
  }

  .auth-stepper .bs-stepper-header .line {
    margin-inline: 0.375rem;
  }
}

/* ---------------------------------------------------------------------------
 * Signup: terms consent next to the checkbox
 * ------------------------------------------------------------------------- */
.auth-page .auth-consent {
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.875rem; /* 14px, slightly smaller so the consent fits in two lines */
  font-weight: 400;
  line-height: 1.5;
  color: var(--bs-body-color);
  letter-spacing: 0;
}

/* Links read as part of the sentence: same size and weight as the text, set apart only by colour. */
.auth-page .auth-consent a {
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
  color: var(--auth-brand-500);
  text-decoration: none;
}

.auth-page .auth-consent a:hover,
.auth-page .auth-consent a:focus-visible {
  color: var(--auth-brand-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Line the checkbox up with the first line of the text. */
.auth-page .form-check:has(.auth-consent) .form-check-input {
  margin-block-start: 0.2rem;
}

/* Signup: free-credits note under the email field */
.auth-page .auth-credit-note {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  margin: 0.625rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--auth-radius);
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-family: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8125rem; /* 13px */
  font-weight: 400;
  line-height: 1.5;
}

.auth-page .auth-credit-note .icon-base {
  flex: 0 0 auto;
  inline-size: 1rem;
  block-size: 1rem;
  margin-block-start: 0.125rem;
  color: var(--auth-brand-500);
}

.auth-page .auth-credit-note strong {
  font-weight: 600;
}

/* Signup: "use your work email" tip under the email field */
.auth-page .auth-email-hint {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0 0;
  color: var(--bs-secondary-color);
  font-size: 0.8125rem; /* 13px */
  line-height: 1.5;
}

.auth-page .auth-email-hint .icon-base {
  flex: 0 0 auto;
  inline-size: 1rem;
  block-size: 1rem;
  color: var(--auth-brand-500);
}

.auth-page .auth-email-hint-tag {
  display: inline-block;
  margin-inline-end: 0.25rem;
  padding: 0.0625rem 0.375rem;
  border-radius: 999px;
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-size: 0.6875rem; /* 11px */
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
 * Forgot password (templates/main/auth/forget_password.html): 3 steps on the same split layout.
 * ------------------------------------------------------------------------- */
.auth-title:has(+ .auth-subtitle) {
  margin-block-end: 0.5rem;
}

.auth-subtitle {
  margin-block-end: 1.5rem;
  color: var(--bs-secondary-color);
  font-size: 0.9375rem;
}

.auth-subtitle strong {
  color: var(--bs-heading-color);
  word-break: break-all;
}

/* The counter sits above the title here (signup puts it under the title). */
.auth-reset-counter.auth-step-counter {
  margin-block: 0 0.75rem;
}

/* Inline alerts are empty until the page script fills them. */
.auth-page .bds-auth-alert:not(.is-shown) {
  display: none;
}

.auth-back-link {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  font-weight: 500;
}

/* ---------------------------------------------------------------------------
 * Sign-in / sign-up / forgot-password brand panel: theme-violet gradient + intro text.
 * Soft glows in brand-300 (lilac), brand-500 (primary) and brand-600, over the
 * brand-500 -> brand-900 base. Gradient only, no texture.
 * ------------------------------------------------------------------------- */
.auth-brand-panel--signin,
.auth-brand-panel--signup,
.auth-brand-panel--reset {
  background:
    radial-gradient(70% 45% at 0% 0%, rgba(196, 160, 255, 0.55) 0%, transparent 70%),
    radial-gradient(60% 40% at 100% 22%, rgba(138, 66, 255, 0.7) 0%, transparent 70%),
    radial-gradient(55% 40% at 30% 55%, rgba(220, 198, 255, 0.16) 0%, transparent 70%),
    radial-gradient(75% 50% at 100% 95%, rgba(110, 53, 204, 0.75) 0%, transparent 70%),
    radial-gradient(70% 50% at 0% 100%, rgba(90, 43, 166, 0.85) 0%, transparent 70%),
    linear-gradient(165deg, var(--auth-brand-500) 0%, var(--auth-brand-600) 35%, var(--auth-brand-700) 68%, var(--auth-brand-900) 100%);
}

/* Sign-in intro: eyebrow label, headline, lead line. */
.auth-brand-panel--signin .auth-brand-intro,
.auth-brand-panel--signup .auth-brand-intro,
.auth-brand-panel--reset .auth-brand-intro { margin-block-start: 2.75rem; }

.auth-brand-eyebrow {
  display: inline-block;
  margin: 0;
  padding: 0.3rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: var(--auth-brand-text);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.auth-brand-panel--signin .auth-brand-headline,
.auth-brand-panel--signup .auth-brand-headline,
.auth-brand-panel--reset .auth-brand-headline {
  margin-block: 0.75rem 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

:is(.auth-brand-panel--signin, .auth-brand-panel--signup, .auth-brand-panel--reset) {
  background: linear-gradient(160deg, #3b1c75 0%, #1f0e3f 50%, #0a0416 100%);
}

/* Sign-in form side: reuse the left panel's deep purples (light theme). */
[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) {
  --auth-signin-deep: #3b1c75;
  --auth-signin-darker: #1f0e3f;
  --bs-link-color: var(--auth-signin-deep);
  --bs-link-color-rgb: 59, 28, 117;
  --bs-link-hover-color: var(--auth-signin-darker);
  --bs-custom-link-color: var(--auth-signin-deep);
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .auth-title {
  color: var(--auth-signin-darker);
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .auth-form-panel {
  background-image: linear-gradient(180deg, #fff 0%, #f6f0ff 100%);
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .btn-primary {
  --bs-btn-bg: var(--auth-signin-deep);
  --bs-btn-border-color: var(--auth-signin-deep);
  --bs-btn-hover-bg: var(--auth-signin-darker);
  --bs-btn-hover-border-color: var(--auth-signin-darker);
  --bs-btn-active-bg: var(--auth-signin-darker);
  --bs-btn-active-border-color: var(--auth-signin-darker);
  --bs-btn-disabled-bg: #8f78c2;
  --bs-btn-disabled-border-color: #8f78c2;
  background-image: linear-gradient(135deg, #3b1c75 0%, #1f0e3f 100%);
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .btn-primary:hover,
[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .btn-primary:active {
  background-image: linear-gradient(135deg, #1f0e3f 0%, #0a0416 100%);
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .btn-primary:disabled {
  background-image: none;
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .btn-outline-primary {
  --bs-btn-color: var(--auth-signin-deep);
  --bs-btn-border-color: var(--auth-signin-deep);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--auth-signin-deep);
  --bs-btn-hover-border-color: var(--auth-signin-deep);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--auth-signin-darker);
  --bs-btn-active-border-color: var(--auth-signin-darker);
}

/* Borders: deep purple on inputs, checkboxes, social buttons, dividers. */
[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .auth-form-panel {
  --bs-border-color: rgba(59, 28, 117, 0.45);
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .form-control,
[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .input-group-text,
[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .form-check-input:not(:checked),
[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .btn-auth-google,
[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .btn-auth-apple {
  border-color: rgba(59, 28, 117, 0.45);
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .form-control:focus,
[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .form-check-input:focus {
  border-color: var(--auth-signin-deep);
  box-shadow: 0 0 0 0.2rem rgba(59, 28, 117, 0.2);
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .input-group:focus-within {
  box-shadow: 0 0 0 var(--bs-border-width) var(--auth-signin-deep), 0 0 0 0.2rem rgba(59, 28, 117, 0.2);
}

[data-bs-theme="light"] .auth-page:has(.auth-brand-panel) .form-check-input:checked {
  border-color: var(--auth-signin-deep);
  background-color: var(--auth-signin-deep);
}

/* Sign-in panel accents: theme-purple tints on the dark gradient. */
:is(.auth-brand-panel--signin, .auth-brand-panel--signup, .auth-brand-panel--reset) .auth-brand-eyebrow {
  border-color: rgba(var(--auth-brand-rgb), 0.55);
  background: linear-gradient(90deg, rgba(var(--auth-brand-rgb), 0.35), rgba(var(--auth-brand-rgb), 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: var(--auth-brand-100);
}

:is(.auth-brand-panel--signin, .auth-brand-panel--signup, .auth-brand-panel--reset) .auth-brand-lead,
:is(.auth-brand-panel--signin, .auth-brand-panel--signup, .auth-brand-panel--reset) .auth-brand-point-text {
  color: rgba(220, 198, 255, 0.78); /* --auth-brand-200 */
}

:is(.auth-brand-panel--signin, .auth-brand-panel--signup, .auth-brand-panel--reset) .auth-brand-point-icon {
  border: 1px solid rgba(var(--auth-brand-rgb), 0.5);
  background: rgba(var(--auth-brand-rgb), 0.22);
  color: var(--auth-brand-200);
}

:is(.auth-brand-panel--signin, .auth-brand-panel--signup, .auth-brand-panel--reset) .auth-brand-point-title {
  color: #fff;
}

.auth-brand-panel--signin .auth-brand-headline,
.auth-brand-panel--signup .auth-brand-headline {
  max-inline-size: none;
  white-space: nowrap;
}

.auth-brand-panel--reset .auth-brand-headline {
  max-inline-size: 28ch;
  text-wrap: balance;
}

.auth-brand-lead {
  margin: 0.75rem 0 0;
  max-inline-size: 32ch;
  color: var(--auth-brand-text-muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* ---------------------------------------------------------------------------
 * Error pages (templates/errors/404.html): brand card with an inline DNA/magnifier SVG.
 * Colours come from the auth palette above, so light and dark both follow the theme.
 * ------------------------------------------------------------------------- */
.error-page {
  position: relative;
  min-block-size: 100vh;
  overflow-x: hidden;
  background-color: var(--bs-body-bg);
  /* Soft brand glow in two corners. */
  background-image:
    radial-gradient(60rem 30rem at 0% 0%, rgba(var(--auth-brand-rgb), 0.12), transparent 60%),
    radial-gradient(50rem 28rem at 100% 100%, rgba(var(--auth-brand-rgb), 0.1), transparent 60%);
}

[data-bs-theme="dark"] .error-page {
  background-image:
    radial-gradient(60rem 30rem at 0% 0%, rgba(var(--auth-brand-rgb), 0.2), transparent 60%),
    radial-gradient(50rem 28rem at 100% 100%, rgba(var(--auth-brand-rgb), 0.16), transparent 60%);
}

/* Faint A/T/G/C letters scattered behind the card. */
.error-backdrop {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.error-backdrop span {
  position: absolute;
  color: rgba(var(--auth-brand-rgb), 0.08);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 800;
  line-height: 1;
  user-select: none;
}

[data-bs-theme="dark"] .error-backdrop span {
  color: rgba(var(--auth-brand-rgb), 0.14);
}

.error-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-block-size: 100vh;
  padding: 2rem 1rem 0;
}

/* Auto margins above the logo and the footer keep the card centred and the footer at the bottom. */
.error-logo {
  margin-block-start: auto;
}

.error-logo img {
  display: block;
  inline-size: 170px;
  block-size: auto;
  margin-block-end: 1.75rem;
}

.error-card {
  inline-size: 100%;
  max-inline-size: 34rem;
  padding: 2.25rem 2rem 2rem;
  border: 1px solid var(--bs-primary-border-subtle);
  border-radius: 1.25rem;
  background-color: var(--bs-paper-bg, var(--bs-body-bg));
  box-shadow: 0 18px 48px rgba(var(--auth-brand-rgb), 0.14);
  text-align: center;
}

/* --- illustration --- */
.error-art {
  display: block;
  inline-size: 100%;
  max-inline-size: 20rem;
  block-size: auto;
  margin: 0 auto 1.25rem;
  overflow: visible;
}

.error-art-strand-a,
.error-art-strand-b {
  fill: none;
  stroke-linecap: round;
  stroke-width: 5;
}

.error-art-strand-a { stroke: var(--auth-brand-500); }
.error-art-strand-b { stroke: var(--auth-brand-200); }
[data-bs-theme="dark"] .error-art-strand-b { stroke: var(--auth-brand-700); }

.error-art-rungs line {
  stroke: var(--auth-brand-300);
  stroke-linecap: round;
  stroke-width: 3;
  opacity: 0.55;
}

.error-art-glass {
  fill: var(--bs-paper-bg, var(--bs-body-bg));
  fill-opacity: 0.92;
  stroke: var(--auth-brand-700);
  stroke-width: 7;
}

[data-bs-theme="dark"] .error-art-glass { stroke: var(--auth-brand-300); }

.error-art-handle {
  stroke: var(--auth-brand-700);
  stroke-linecap: round;
  stroke-width: 12;
}

[data-bs-theme="dark"] .error-art-handle { stroke: var(--auth-brand-300); }

.error-art-mark {
  fill: var(--auth-brand-500);
  font-family: inherit;
  font-size: 44px;
  font-weight: 800;
}

/* Gentle float on the lens (skipped for reduced motion). */
@media (prefers-reduced-motion: no-preference) {
  .error-art-lens {
    animation: error-lens 4s ease-in-out infinite;
    transform-origin: 250px 70px;
  }

  @keyframes error-lens {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-10px, -4px) rotate(-4deg); }
  }
}

/* --- text --- */
.error-eyebrow {
  display: inline-flex;
  gap: 0.375rem;
  align-items: center;
  margin: 0 0 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.error-code {
  margin: 0;
  color: var(--auth-brand-500);
  background-image: linear-gradient(135deg, var(--auth-brand-500) 0%, var(--auth-brand-700) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: clamp(3.75rem, 12vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

[data-bs-theme="dark"] .error-code {
  background-image: linear-gradient(135deg, var(--auth-brand-300) 0%, var(--auth-brand-500) 100%);
}

.error-title {
  margin: 0.5rem 0 0.5rem;
  color: var(--bs-heading-color);
  font-size: 1.5rem;
  font-weight: 600;
}

.error-text {
  max-inline-size: 26rem;
  margin: 0 auto 1.25rem;
  color: var(--bs-secondary-color);
}

.error-path {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  margin-block-end: 1.5rem;
  font-size: 0.8125rem;
}

.error-path-label {
  color: var(--bs-secondary-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.6875rem;
}

.error-path code {
  max-inline-size: min(20rem, 60vw);
  padding: 0.25rem 0.625rem;
  overflow: hidden;
  border: 1px dashed var(--bs-primary-border-subtle);
  border-radius: var(--auth-radius);
  background-color: var(--bs-primary-bg-subtle);
  color: var(--bs-primary-text-emphasis);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.error-actions .btn {
  min-inline-size: 14rem;
}

.error-legal {
  margin-block-start: auto;
  padding-block-start: 2rem;
}

@media (max-width: 575.98px) {
  .error-card {
    padding: 1.75rem 1.25rem 1.5rem;
  }

  .error-actions .btn {
    inline-size: 100%;
    min-inline-size: 0;
  }
}
