/* =====================================================================
   Auth Pages (Sign-in / Forgot / Reset / Change Password)
   Unified visual language matching the project installer.
   ===================================================================== */

:root {
  --auth-bg: linear-gradient(135deg, #eef2ff 0%, #f7f3ff 50%, #fff5f2 100%);
  --auth-hero: linear-gradient(135deg, #1f6f8b 0%, #5b3994 50%, #c2410c 100%);
  --auth-primary: #5b3994;
  --auth-accent: #1f6f8b;
  --auth-warm: #c2410c;
  --auth-text: #0f172a;
  --auth-muted: #64748b;
  --auth-border: #e2e8f0;
  --auth-shadow:
    0 25px 60px rgba(31, 38, 135, 0.12), 0 4px 12px rgba(31, 38, 135, 0.05);
}

body.auth-body {
  background: var(--auth-bg);
  min-height: 100vh;
  font-family: "Inter", "Open Sans", system-ui, sans-serif;
  color: var(--auth-text);
}

/* ---------- Shell ---------- */
.auth-shell {
  min-height: 100vh;
  padding: 2.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  width: 100%;
  max-width: 980px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: var(--auth-shadow);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
}

.auth-card.auth-card-compact {
  max-width: 460px;
  grid-template-columns: 1fr;
}

/* ---------- Brand / hero pane ---------- */
.auth-hero-pane {
  background: var(--auth-hero);
  color: #fff;
  padding: 2.5rem 2.25rem;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.auth-hero-pane::after {
  content: "";
  position: absolute;
  inset: -60px -60px auto auto;
  width: 280px;
  height: 280px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.18),
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.auth-hero-pane::before {
  content: "";
  position: absolute;
  inset: auto auto -80px -80px;
  width: 240px;
  height: 240px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1),
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  align-self: flex-start;
  color: #fff;
  position: relative;
  z-index: 1;
}

.auth-brand-mark i {
  font-size: 0.95rem;
  line-height: 1;
  color: #fff;
}

.auth-brand-logo {
  margin-top: 1.25rem;
  max-height: 72px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.5rem 0.85rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 1;
}

.auth-hero-title {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  position: relative;
  z-index: 1;
}

.auth-hero-tagline {
  opacity: 0.92;
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
  position: relative;
  z-index: 1;
}

.auth-feature-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  position: relative;
  z-index: 1;
}

.auth-feature-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  opacity: 1;
  color: #fff;
}

.auth-feature-list li i {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
  color: #fff;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.auth-hero-foot {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 1.5rem;
  position: relative;
  z-index: 1;
}

.auth-hero-foot a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

.auth-hero-foot i {
  color: #fff;
}

/* ---------- Form pane ---------- */
.auth-form-pane {
  padding: 2.5rem 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-form-pane .auth-mobile-brand {
  display: none;
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-form-pane .auth-mobile-brand img {
  max-height: 44px;
  width: auto;
}

.auth-form-head {
  margin-bottom: 1.5rem;
}

.auth-form-head .auth-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-primary));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  line-height: 1;
  margin-bottom: 0.85rem;
  box-shadow: 0 8px 18px rgba(91, 57, 148, 0.25);
}

.auth-form-head .auth-icon-circle i {
  color: #fff;
  line-height: 1;
}

.auth-form-head h1 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--auth-text);
  margin: 0;
  line-height: 1.2;
}

.auth-form-head p {
  margin: 0.35rem 0 0;
  color: var(--auth-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-form .form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.3rem;
}

.auth-form .form-label .auth-link {
  font-weight: 500;
  font-size: 0.78rem;
  color: var(--auth-accent);
  text-decoration: none;
}

.auth-form .form-label .auth-link:hover {
  color: var(--auth-primary);
  text-decoration: underline;
}

.auth-form .form-control {
  font-size: 0.92rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1.5px solid var(--auth-border);
  background: #fff;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.auth-form .form-control:focus {
  border-color: var(--auth-primary);
  box-shadow: 0 0 0 3px rgba(91, 57, 148, 0.12);
  outline: none;
}

.auth-form .form-control::placeholder {
  color: #94a3b8;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap .form-control {
  padding-right: 2.6rem;
}

.auth-input-wrap .auth-toggle-pass {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  color: var(--auth-muted);
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  border-radius: 6px;
}

.auth-input-wrap .auth-toggle-pass:hover {
  color: var(--auth-accent);
  background: rgba(31, 111, 139, 0.06);
}

.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-form .form-check-input {
  border-color: #cbd5e1;
}

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

.auth-form .form-check-label {
  font-size: 0.88rem;
  color: var(--auth-muted);
}

.auth-submit {
  width: 100%;
  background: linear-gradient(
    135deg,
    var(--auth-accent) 0%,
    var(--auth-primary) 100%
  );
  color: #fff;
  border: 0;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.auth-submit i {
  font-size: 1rem;
  line-height: 1;
  color: #fff;
}

.auth-submit .btn-text,
.auth-submit .btn-spinner {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.auth-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(91, 57, 148, 0.25);
  color: #fff;
}

.auth-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-divider {
  border: 0;
  border-top: 1px solid var(--auth-border);
  margin: 1.5rem 0 1.25rem;
}

.auth-foot-text {
  text-align: center;
  color: var(--auth-muted);
  font-size: 0.85rem;
  margin: 0;
}

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

.auth-foot-text a:hover {
  text-decoration: underline;
}

.auth-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--auth-accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.85rem;
}

.auth-back-link:hover {
  color: var(--auth-primary);
}

/* ---------- Alerts inside form ---------- */
.auth-alert {
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin: 0 0 1rem;
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.auth-alert.alert-success {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.auth-alert.alert-danger {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.auth-alert.alert-info {
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #7dd3fc;
}

/* ---------- Password requirements panel ---------- */
.auth-strength {
  background: #f8fafc;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}

.auth-strength h6 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--auth-text);
  margin: 0 0 0.55rem;
}

.auth-strength .password-requirement {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  margin-bottom: 0.3rem;
  color: #94a3b8;
}

.auth-strength .password-requirement:last-child {
  margin-bottom: 0;
}

.auth-strength .password-requirement.invalid {
  color: #94a3b8;
}

.auth-strength .password-requirement.invalid i::before {
  content: "\f623";
  /* bi-x-circle */
}

.auth-strength .password-requirement.valid {
  color: #15803d;
}

.auth-strength .password-requirement.valid i::before {
  content: "\f26a";
  /* bi-check-circle-fill */
}

.auth-strength .password-requirement i {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.auth-input-wrap .auth-toggle-pass i {
  font-size: 1rem;
  line-height: 1;
}

.auth-alert i {
  font-size: 1.05rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.auth-back-link i {
  font-size: 0.95rem;
  line-height: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .auth-card {
    grid-template-columns: 1fr;
    max-width: 460px;
    min-height: 0;
  }

  .auth-hero-pane {
    display: none;
  }

  .auth-form-pane .auth-mobile-brand {
    display: block;
  }
}

@media (max-width: 480px) {
  .auth-shell {
    padding: 1rem 0.5rem;
  }

  .auth-form-pane {
    padding: 1.75rem 1.4rem;
  }

  .auth-form-head h1 {
    font-size: 1.25rem;
  }
}

@keyframes auth-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.auth-submit .btn-spinner i {
  animation: auth-spin 1s linear infinite;
}
