:root {
  --auth-brand: var(--ats-primary, #0e9f6e);
  --auth-brand-rgb: var(--ats-primary-rgb, 14, 159, 110);
  --auth-brand-strong: color-mix(in srgb, var(--auth-brand) 82%, #000000);
  --auth-brand-soft: rgba(var(--auth-brand-rgb), 0.12);
  --auth-brand-faint: rgba(var(--auth-brand-rgb), 0.08);
  --auth-action: var(--gc-blue, var(--bs-primary, var(--auth-brand)));
  --auth-action-rgb: var(--bs-primary-rgb, var(--auth-brand-rgb));
  --auth-bg: #f8fbf8;
  --auth-bg-soft: #f2f7f3;
  --auth-surface: #ffffff;
  --auth-surface-soft: #f5faf6;
  --auth-text: #111827;
  --auth-muted: #526174;
  --auth-line: #dbe6df;
  --auth-line-strong: #c8d8cf;
  --auth-shadow: 0 24px 52px rgba(15, 23, 42, 0.08);
  --auth-shadow-soft: 0 14px 32px rgba(15, 23, 42, 0.05);
  --auth-focus-ring: 0 0 0 0.2rem rgba(var(--auth-brand-rgb), 0.22);
}

body {
  margin: 0;
}

.auth-login {
  --auth-card-radius: clamp(1rem, 2vw, 1.5rem);
  --auth-card-padding: clamp(1rem, 3vw, 2rem);
  --auth-field-radius: clamp(0.85rem, 1.4vw, 1rem);
  --auth-field-gap: clamp(0.75rem, 1.6vw, 1rem);
  color: var(--auth-text);
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: clip;
}

html[data-bs-theme="dark"] .auth-login,
html[data-theme="dark"] .auth-login {
  --auth-bg: #08121c;
  --auth-bg-soft: #0b1623;
  --auth-surface: #101b2a;
  --auth-surface-soft: #132234;
  --auth-text: #e8eef6;
  --auth-muted: #a8b8cb;
  --auth-line: #22384c;
  --auth-line-strong: #2c4760;
  --auth-brand-soft: rgba(var(--auth-brand-rgb), 0.18);
  --auth-brand-faint: rgba(var(--auth-brand-rgb), 0.12);
  --auth-shadow: 0 28px 60px rgba(2, 6, 23, 0.5);
  --auth-shadow-soft: 0 16px 36px rgba(2, 6, 23, 0.34);
}

.auth-login.saas-auth {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1rem, 3vw, 2rem) 0;
  background:
    radial-gradient(circle at top left, rgba(var(--auth-brand-rgb), 0.1), transparent 22rem),
    linear-gradient(180deg, var(--auth-bg) 0%, var(--auth-bg-soft) 100%);
  isolation: isolate;
}

.saas-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.saas-bg::before,
.saas-bg::after {
  position: absolute;
  content: "";
  filter: blur(64px);
  opacity: 0.7;
  transform: translateZ(0);
}

.saas-bg::before {
  width: min(76vw, 52rem);
  height: min(58vw, 34rem);
  top: -12rem;
  left: -16rem;
  background:
    radial-gradient(ellipse at 24% 22%, rgba(var(--auth-action-rgb), 0.3), transparent 58%),
    radial-gradient(ellipse at 78% 58%, rgba(var(--auth-brand-rgb), 0.22), transparent 62%);
}

.saas-bg::after {
  width: min(82vw, 58rem);
  height: min(56vw, 36rem);
  right: -18rem;
  bottom: -14rem;
  background:
    radial-gradient(ellipse at 34% 42%, rgba(var(--auth-brand-rgb), 0.24), transparent 60%),
    radial-gradient(ellipse at 76% 66%, rgba(var(--auth-action-rgb), 0.18), transparent 64%);
}

.saas-bg .blob {
  display: none;
}

.saas-bg .grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--auth-line) 44%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--auth-line) 44%, transparent) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.46), transparent 72%);
  opacity: 0.2;
}

html[data-bs-theme="dark"] .saas-bg::before,
html[data-bs-theme="dark"] .saas-bg::after,
html[data-theme="dark"] .saas-bg::before,
html[data-theme="dark"] .saas-bg::after {
  opacity: 0.46;
}

.auth-login .container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: calc(100vw - 24px);
  padding-inline: 0;
}

.auth-login .saas-auth-row {
  --bs-gutter-x: 0;
  --bs-gutter-y: clamp(0.65rem, 2vh, 0.95rem);
  margin-top: 0;
  margin-bottom: 0;
}

.auth-login .auth-login-col {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
}

.saas-brand-card,
.saas-form-card {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-card-radius);
  background: color-mix(in srgb, var(--auth-surface) 92%, transparent);
  color: var(--auth-text);
  box-shadow: var(--auth-shadow-soft);
  backdrop-filter: blur(16px);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.saas-brand-card {
  height: 100%;
  padding: clamp(1.35rem, 2vw, 2rem);
  background:
    radial-gradient(circle at top right, rgba(var(--auth-brand-rgb), 0.12), transparent 18rem),
    color-mix(in srgb, var(--auth-surface) 88%, var(--auth-bg-soft));
}

.saas-form-card {
  position: relative;
  height: 100%;
  padding: var(--auth-card-padding);
}

.brand-top {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.4vw, 1rem);
  margin-bottom: clamp(1.25rem, 2.2vw, 1.75rem);
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(3rem, 5vw, 3.5rem);
  height: clamp(3rem, 5vw, 3.5rem);
  border: 1px solid color-mix(in srgb, var(--auth-brand) 20%, var(--auth-line));
  border-radius: clamp(0.9rem, 1.4vw, 1rem);
  background: color-mix(in srgb, var(--auth-surface) 52%, var(--auth-brand-soft));
  color: var(--auth-brand);
  box-shadow: var(--auth-shadow-soft);
}

.brand-mark i {
  font-size: clamp(1.35rem, 2.4vw, 1.6rem);
}

.brand-title-wrap {
  min-width: 0;
}

.brand-title {
  min-width: 0;
  color: var(--auth-text);
  font-size: clamp(1rem, 0.7vw + 0.9rem, 1.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.brand-title .ats-brand-text {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.brand-subtitle {
  margin-top: 0.25rem;
  color: var(--auth-muted);
  font-size: clamp(0.8rem, 0.2vw + 0.74rem, 0.88rem);
  font-weight: 700;
}

.brand-body {
  display: grid;
  gap: clamp(0.85rem, 1.4vw, 1.15rem);
}

.brand-headline {
  margin: 0;
  color: var(--auth-text);
  font-size: clamp(1.35rem, 1vw + 1rem, 2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}

.brand-copy {
  margin: 0;
  color: var(--auth-muted);
  font-size: clamp(0.875rem, 0.28vw + 0.8rem, 0.98rem);
  line-height: 1.66;
}

.brand-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.1rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  gap: 0.45rem;
  padding: 0.48rem 0.72rem;
  border: 1px solid color-mix(in srgb, var(--auth-brand) 18%, var(--auth-line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--auth-surface) 58%, var(--auth-brand-faint));
  color: var(--auth-text);
  font-size: clamp(0.78rem, 0.2vw + 0.72rem, 0.86rem);
  font-weight: 700;
  line-height: 1.2;
}

.pill i {
  color: var(--auth-brand);
}

.brand-footer {
  margin-top: clamp(1.35rem, 2.2vw, 1.75rem);
  color: var(--auth-muted);
  font-size: clamp(0.78rem, 0.2vw + 0.72rem, 0.86rem);
}

.mobile-brand,
.mobile-brand-outside {
  margin-bottom: clamp(0.55rem, 2vh, 0.85rem);
}

.mobile-brand .brand-title {
  font-size: clamp(1rem, 4.8vw, 1.25rem);
}

.mobile-brand .brand-subtitle {
  font-size: clamp(0.78rem, 3.6vw, 0.9rem);
}

.mobile-brand-outside {
  display: flex;
  justify-content: center;
}

.mobile-brand-logo {
  display: block;
  width: auto;
  max-width: min(62vw, 240px);
  max-height: clamp(2.35rem, 12vw, 2.875rem);
  object-fit: contain;
  margin-inline: auto;
}

.form-header {
  display: grid;
  gap: 0.4rem;
  margin-bottom: clamp(0.9rem, 2vw, 1.25rem);
  padding-right: 3rem;
}

.auth-page--register .form-header,
.auth-page--password-confirm .form-header,
.auth-page--verify .form-header {
  padding-right: 0;
}

.form-title {
  margin: 0;
  color: var(--auth-text);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}

.form-subtitle {
  color: var(--auth-muted);
  font-size: clamp(0.875rem, 1.2vw, 1rem);
  line-height: 1.55;
}

.saas-form {
  display: block;
}

.auth-login .saas-form > .mb-3,
.auth-login .saas-form > .mb-4 {
  margin-bottom: var(--auth-field-gap) !important;
}

.auth-login .form-label {
  margin-bottom: 0.45rem;
  color: var(--auth-text);
  font-size: clamp(0.82rem, 1vw, 0.95rem);
  font-weight: 700 !important;
  line-height: 1.35;
}

.input-icon {
  position: relative;
  min-width: 0;
}

.input-icon .left-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  z-index: 2;
  width: 1rem;
  color: var(--auth-muted);
  font-size: 1rem;
  line-height: 1;
  text-align: center;
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-login .form-control,
.auth-login .form-select {
  min-height: 44px;
  border-color: var(--auth-line);
  border-radius: var(--auth-field-radius);
  background-color: color-mix(in srgb, var(--auth-surface) 88%, var(--auth-bg-soft));
  color: var(--auth-text);
  font-size: clamp(0.88rem, 0.28vw + 0.82rem, 0.98rem);
  line-height: 1.45;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.auth-login .form-control::placeholder {
  color: color-mix(in srgb, var(--auth-muted) 82%, transparent);
  opacity: 1;
}

.saas-input {
  width: 100%;
  padding: 0.72rem 3.15rem 0.72rem 2.55rem;
}

.input-icon .saas-input.is-invalid {
  padding-right: 5.15rem;
  background-position: right 2.9rem center;
}

.auth-login .form-control:focus,
.auth-login .form-select:focus {
  border-color: color-mix(in srgb, var(--auth-brand) 62%, var(--auth-line));
  box-shadow: var(--auth-focus-ring);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.42rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 0.8rem;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  color: var(--auth-text);
  background: color-mix(in srgb, var(--auth-surface) 55%, var(--auth-brand-faint));
}

.password-toggle:focus-visible {
  outline: 0;
  box-shadow: var(--auth-focus-ring);
}

.auth-password-icon,
.auth-theme-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
}

.auth-password-icon svg,
.auth-theme-icon svg {
  width: 1rem;
  height: 1rem;
}

.auth-theme-toggle {
  position: absolute;
  top: clamp(0.75rem, 2vw, 1rem);
  right: clamp(0.75rem, 2vw, 1rem);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border-color: var(--auth-line);
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--auth-surface) 82%, var(--auth-bg-soft));
  color: var(--auth-muted);
}

.auth-theme-toggle:hover {
  border-color: color-mix(in srgb, var(--auth-brand) 24%, var(--auth-line));
  background: color-mix(in srgb, var(--auth-surface) 68%, var(--auth-brand-soft));
  color: var(--auth-text);
}

.auth-theme-toggle:focus-visible {
  box-shadow: var(--auth-focus-ring);
}

.auth-theme-icon-moon {
  display: none;
}

html[data-bs-theme="dark"] .auth-login .auth-theme-icon-sun,
html[data-theme="dark"] .auth-login .auth-theme-icon-sun {
  display: none;
}

html[data-bs-theme="dark"] .auth-login .auth-theme-icon-moon,
html[data-theme="dark"] .auth-login .auth-theme-icon-moon {
  display: inline-flex;
}

.auth-inline-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
  margin-bottom: clamp(0.95rem, 2vw, 1.35rem) !important;
}

.auth-inline-meta .form-check {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
  padding-left: 1.65rem;
}

.auth-login .form-check-input {
  width: 1.05rem;
  height: 1.05rem;
  margin-top: 0;
  margin-left: -1.65rem;
  border-color: var(--auth-line-strong);
  background-color: color-mix(in srgb, var(--auth-surface) 88%, var(--auth-bg-soft));
}

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

.auth-login .form-check-input:focus {
  border-color: color-mix(in srgb, var(--auth-brand) 62%, var(--auth-line));
  box-shadow: var(--auth-focus-ring);
}

.auth-login .form-check-label {
  color: var(--auth-text);
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  line-height: 1.35;
}

.saas-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.25rem;
  color: var(--auth-brand-strong);
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  text-underline-offset: 0.18em;
}

.saas-link:hover,
.saas-link:focus-visible {
  color: var(--auth-brand);
  text-decoration: underline;
}

.auth-login .btn {
  min-height: 44px;
  border-radius: var(--auth-field-radius);
  font-size: clamp(0.84rem, 0.24vw + 0.78rem, 0.95rem);
  font-weight: 700;
  line-height: 1.2;
}

.auth-login .btn-primary {
  padding: 0.78rem 1.1rem;
  box-shadow: 0 14px 30px rgba(var(--auth-action-rgb), 0.18);
}

.auth-login .btn-primary:hover {
  box-shadow: 0 16px 34px rgba(var(--auth-action-rgb), 0.22);
}

.auth-login .btn-primary i {
  color: #ffffff !important;
}

.auth-login .btn-outline-secondary {
  --bs-btn-color: var(--auth-action);
  --bs-btn-border-color: color-mix(in srgb, var(--auth-action) 30%, var(--auth-line));
  --bs-btn-hover-color: var(--auth-text);
  --bs-btn-hover-bg: rgba(var(--auth-action-rgb), 0.12);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--auth-action) 42%, var(--auth-line));
  --bs-btn-active-color: var(--auth-text);
  --bs-btn-active-bg: rgba(var(--auth-action-rgb), 0.16);
  --bs-btn-active-border-color: color-mix(in srgb, var(--auth-action) 48%, var(--auth-line));
  --bs-btn-focus-shadow-rgb: var(--auth-action-rgb);
  background: rgba(var(--auth-action-rgb), 0.07);
}

.auth-login .btn:focus-visible {
  box-shadow: var(--auth-focus-ring);
}

.form-footnote {
  margin-top: clamp(0.8rem, 1.8vw, 1rem);
  text-align: center;
}

.auth-helper-text {
  color: var(--auth-muted);
  font-size: clamp(0.84rem, 0.24vw + 0.78rem, 0.92rem);
  line-height: 1.6;
}

.form-footnote small,
.auth-login .text-body-secondary {
  color: var(--auth-muted) !important;
  font-size: clamp(0.8rem, 1vw, 0.9rem);
  line-height: 1.45;
}

.auth-login .invalid-feedback {
  margin-top: 0.45rem;
  font-size: clamp(0.78rem, 0.8vw, 0.86rem);
  line-height: 1.45;
}

.saas-alert {
  margin-bottom: clamp(0.85rem, 1.8vw, 1rem);
  padding: 0.75rem 0.9rem;
  border-radius: var(--auth-field-radius);
  font-size: clamp(0.82rem, 1vw, 0.9rem);
  line-height: 1.45;
}

html[data-bs-theme="dark"] .auth-login .alert-success,
html[data-theme="dark"] .auth-login .alert-success {
  border-color: rgba(34, 197, 94, 0.34);
  background: rgba(34, 197, 94, 0.14);
  color: #d8fbe3;
}

html[data-bs-theme="dark"] .auth-login .alert-danger,
html[data-theme="dark"] .auth-login .alert-danger {
  border-color: rgba(248, 113, 113, 0.36);
  background: rgba(248, 113, 113, 0.14);
  color: #ffe1e1;
}

.ats-brand-text.ats-brand-animated {
  --brand: var(--ats-brand-color, var(--auth-brand));
  color: transparent !important;
  background-image: linear-gradient(
    90deg,
    var(--brand) 0%,
    color-mix(in srgb, var(--brand) 66%, var(--auth-text)) 28%,
    var(--brand) 56%,
    color-mix(in srgb, var(--brand) 66%, var(--auth-text)) 82%,
    var(--brand) 100%
  );
  background-size: 220% 100%;
  background-position: 0% 50%;
  background-clip: text;
  -webkit-text-fill-color: transparent !important;
  -webkit-background-clip: text;
  animation: atsBrandSeamless 5s linear infinite;
}

@keyframes atsBrandSeamless {
  from {
    background-position: 0% 50%;
  }

  to {
    background-position: 220% 50%;
  }
}

@media (min-width: 768px) {
  .auth-login .container {
    max-width: min(calc(100vw - 48px), 68rem);
  }

  .auth-login .saas-auth-row {
    --bs-gutter-x: clamp(1rem, 2.4vw, 1.5rem);
    --bs-gutter-y: 1rem;
  }

  .auth-login .auth-login-col {
    max-width: none;
  }

  .auth-page--login .saas-auth-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(26rem, 28rem);
  }

  .auth-page--login .saas-auth-row > [class*="col-"] {
    width: auto;
    max-width: none;
    padding-inline: calc(var(--bs-gutter-x) * 0.5);
  }

  .saas-brand-card,
  .saas-form-card {
    box-shadow: var(--auth-shadow);
  }
}

@media (min-width: 1200px) {
  .auth-login .container {
    max-width: min(calc(100vw - 64px), 72rem);
  }
}

@media (max-width: 767.98px) {
  .auth-login.saas-auth {
    justify-content: center;
    padding-top: clamp(0.55rem, 2.2vh, 0.9rem);
    padding-bottom: clamp(0.55rem, 2.2vh, 0.9rem);
  }

  .auth-login .saas-auth-row > [class*="col-"] {
    padding-inline: 0;
  }

  .auth-login .saas-form-card {
    padding: clamp(1rem, 4vw, 1.2rem);
  }

  .auth-login .auth-theme-toggle-outside {
    position: fixed;
    top: calc(0.5rem + env(safe-area-inset-top));
    right: calc(0.5rem + env(safe-area-inset-right));
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    background: color-mix(in srgb, var(--auth-surface) 72%, transparent);
    backdrop-filter: blur(12px);
  }

  .auth-login .form-header {
    margin-bottom: clamp(0.75rem, 2.2vh, 0.95rem);
  }

  .auth-page--login .form-footnote {
    margin-top: 0.65rem;
  }
}

@media (max-width: 380px) {
  .auth-inline-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .auth-inline-meta .saas-link,
  .auth-inline-meta .form-check {
    min-height: 2rem;
  }

  .mobile-brand-logo {
    max-width: min(58vw, 210px);
  }
}

@media (max-width: 767.98px) and (max-height: 760px) {
  .auth-login.saas-auth {
    padding-top: clamp(0.35rem, 1.7vh, 0.6rem);
    padding-bottom: clamp(0.35rem, 1.7vh, 0.6rem);
  }

  .auth-login .saas-form-card {
    padding: clamp(0.95rem, 3.6vw, 1.08rem);
  }

  .mobile-brand,
  .mobile-brand-outside {
    margin-bottom: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ats-brand-text.ats-brand-animated {
    animation: none !important;
    background: none;
    color: var(--brand) !important;
    -webkit-text-fill-color: var(--brand) !important;
  }

  .saas-brand-card,
  .saas-form-card,
  .auth-login .form-control,
  .auth-login .form-select,
  .auth-login .btn {
    transition: none;
  }
}
