:root {
  --auth-primary: #0f79f3;
  --auth-primary-dark: #0b5ed7;
  --auth-secondary: #764ba2;
  --auth-muted: #8b9bb0;
  --auth-bg: linear-gradient(135deg, #edf2ff 0%, #f7f9fe 45%, #eef5ff 100%);
  --auth-card-shadow: 0 25px 65px rgba(15, 121, 243, 0.12);
}

.auth-body {
  min-height: 100vh;
  margin: 0;
  background: var(--auth-bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  color: #1f2a37;
}

.auth-bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  z-index: 0;
}

.auth-bg-shape-one {
  width: 320px;
  height: 320px;
  background: rgba(15, 121, 243, 0.35);
  top: -80px;
  right: -120px;
}

.auth-bg-shape-two {
  width: 260px;
  height: 260px;
  background: rgba(118, 75, 162, 0.35);
  bottom: -100px;
  left: -80px;
}

.auth-main {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1rem;
}

@media (min-height: 700px) {
  .auth-main {
    align-items: center;
  }
}

.auth-wrapper {
  width: 100%;
  max-width: 960px;
}

.auth-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--auth-card-shadow);
  border: 1px solid rgba(15, 121, 243, 0.08);
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
}

.auth-card--split .auth-card__side {
  flex: 1 1 45%;
  background: linear-gradient(135deg, rgba(15, 121, 243, 0.95), rgba(118, 75, 162, 0.95));
  color: #fff;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: relative;
}

.auth-card__side::after {
  content: '';
  position: absolute;
  inset: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 24px;
  pointer-events: none;
}

.auth-card__side h3 {
  font-size: 1.75rem;
  font-weight: 600;
}

.auth-card__side p {
  color: rgba(255, 255, 255, 0.82);
}

.auth-card__form {
  flex: 1 1 55%;
  padding: 3rem 2.75rem;
}

.auth-card__form.wide {
  flex: 1 1 100%;
  padding: 3rem;
}

.auth-form-floating .form-control,
.auth-form-floating .form-select {
  height: auto;
  min-height: 52px;
  border-radius: 14px;
  border: 1.5px solid #dde6f5;
  padding: 1.15rem 1rem 0.45rem;
  font-size: 1rem;
  background-color: #fff;
}

.auth-form-floating label {
  color: #7a889f;
}

.auth-form-floating .form-control:focus,
.auth-form-floating .form-select:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 0.2rem rgba(15, 121, 243, 0.15);
}

.auth-form-floating .is-invalid {
  border-color: #f1416c;
}

.auth-form-floating .invalid-feedback {
  font-size: 0.85rem;
}

.auth-password-field {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: #97a4ba;
  padding: 0.25rem;
  cursor: pointer;
}

.auth-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.95rem;
}

.btn-auth {
  background: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
  border: none;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  color: #fff;
  width: 100%;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.btn-auth.loading {
  opacity: 0.75;
  cursor: not-allowed;
}

.auth-links {
  text-align: center;
  margin-top: 2rem;
}

.auth-links a {
  color: var(--auth-primary);
  font-weight: 600;
  text-decoration: none;
}

.auth-alert {
  border-radius: 16px;
  border: 1px solid rgba(15, 121, 243, 0.1);
}

.auth-card__form .required-indicator {
  color: #f1416c;
}

.ip-details code {
  word-break: break-all;
}

.auth-card--wide {
  max-width: 1040px;
  margin: 0 auto;
}

@media (max-width: 991.98px) {
  .auth-card--split .auth-card__side {
    display: none;
  }

  .auth-card__form,
  .auth-card__form.wide {
    padding: 2.5rem;
  }
}

@media (max-width: 575.98px) {
  .auth-card__form,
  .auth-card__form.wide {
    padding: 2rem 1.5rem;
  }

  .auth-main {
    padding: 1.5rem 1rem;
  }
}

/* Desktop-only overrides to prevent dark theme from affecting auth forms */
@media (min-width: 992px) {
  /* Ensure auth body always has light background on desktop */
  html[data-theme="dark"] .auth-body,
  html[data-bs-theme="dark"] .auth-body,
  [data-theme="dark"] .auth-body,
  [data-bs-theme="dark"] .auth-body {
    background: var(--auth-bg) !important;
    color: #1f2a37 !important;
  }

  /* Ensure auth card always has white background on desktop */
  html[data-theme="dark"] .auth-card,
  html[data-bs-theme="dark"] .auth-card,
  [data-theme="dark"] .auth-card,
  [data-bs-theme="dark"] .auth-card {
    background: #fff !important;
  }

  /* Ensure form inputs have proper styling on desktop */
  html[data-theme="dark"] .auth-form-floating .form-control,
  html[data-bs-theme="dark"] .auth-form-floating .form-control,
  [data-theme="dark"] .auth-form-floating .form-control,
  [data-bs-theme="dark"] .auth-form-floating .form-control {
    background-color: #fff !important;
    color: #212529 !important;
    border-color: #dde6f5 !important;
  }

  /* Ensure labels are readable on desktop */
  html[data-theme="dark"] .auth-form-floating label,
  html[data-bs-theme="dark"] .auth-form-floating label,
  [data-theme="dark"] .auth-form-floating label,
  [data-bs-theme="dark"] .auth-form-floating label {
    color: #7a889f !important;
  }

  /* Ensure muted text is readable on desktop */
  html[data-theme="dark"] .auth-card__form .text-muted,
  html[data-bs-theme="dark"] .auth-card__form .text-muted,
  [data-theme="dark"] .auth-card__form .text-muted,
  [data-bs-theme="dark"] .auth-card__form .text-muted {
    color: #6c757d !important;
  }

  /* Ensure form text and links have proper contrast on desktop */
  html[data-theme="dark"] .auth-card__form,
  html[data-bs-theme="dark"] .auth-card__form,
  [data-theme="dark"] .auth-card__form,
  [data-bs-theme="dark"] .auth-card__form {
    color: #212529 !important;
  }

  html[data-theme="dark"] .auth-card__form a,
  html[data-bs-theme="dark"] .auth-card__form a,
  [data-theme="dark"] .auth-card__form a,
  [data-bs-theme="dark"] .auth-card__form a {
    color: var(--auth-primary) !important;
  }

  /* Ensure headings are readable on desktop */
  html[data-theme="dark"] .auth-card__form h2,
  html[data-theme="dark"] .auth-card__form h3,
  html[data-theme="dark"] .auth-card__form h4,
  html[data-bs-theme="dark"] .auth-card__form h2,
  html[data-bs-theme="dark"] .auth-card__form h3,
  html[data-bs-theme="dark"] .auth-card__form h4,
  [data-theme="dark"] .auth-card__form h2,
  [data-theme="dark"] .auth-card__form h3,
  [data-theme="dark"] .auth-card__form h4,
  [data-bs-theme="dark"] .auth-card__form h2,
  [data-bs-theme="dark"] .auth-card__form h3,
  [data-bs-theme="dark"] .auth-card__form h4 {
    color: #212529 !important;
  }

  /* Ensure form check labels are readable on desktop */
  html[data-theme="dark"] .auth-card__form .form-check-label,
  html[data-bs-theme="dark"] .auth-card__form .form-check-label,
  [data-theme="dark"] .auth-card__form .form-check-label,
  [data-bs-theme="dark"] .auth-card__form .form-check-label {
    color: #212529 !important;
  }
}

