:root {
  --ut-green: #198754;
  --ut-green-dark: #146c43;
  --ut-green-deep: #0f5132;
  --ut-surface: #f4f7f5;
  --ut-nav-h: 56px; /* height of the sticky navbar in base.html */
}

/* ---------- Page shell ---------- */
.auth-page {
  min-height: calc(100vh - var(--ut-nav-h));
  min-height: calc(100dvh - var(--ut-nav-h));
  display: flex;
  flex-direction: column;
  background: var(--ut-surface);
}

/* ---------- Brand panel (compact header on mobile) ---------- */
.auth-brand {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
  padding: 2rem 1.25rem 5rem;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.14), transparent 45%),
    linear-gradient(160deg, var(--ut-green) 0%, var(--ut-green-dark) 55%, var(--ut-green-deep) 100%);
}

.auth-brand::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -120px;
  bottom: -140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
}

.glass-bg {
  display: inline-block;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 1.25rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-logo {
  display: block;
  max-width: 64px;
  height: auto;
}

.auth-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
}

.auth-tagline {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.auth-features {
  display: none;
  list-style: none;
  padding: 0;
  margin: 2.25rem auto 0;
  max-width: 330px;
  text-align: left;
}

.auth-features li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  opacity: 0.95;
}

.auth-features i {
  flex: 0 0 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 1.05rem;
}

/* ---------- Form panel ---------- */
.auth-panel {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0 1rem 2rem;
  margin-top: -3.25rem;
  position: relative;
  z-index: 2;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: #fff;
  padding: 1.75rem 1.25rem;
  box-shadow: 0 18px 40px rgba(15, 81, 50, 0.15);
}

.rounded-3xl {
  border-radius: 1.5rem !important;
}

.auth-card h2 {
  font-size: 1.5rem;
}

/* ---------- Form controls ---------- */
.form-control-xl {
  border-radius: 0.75rem !important;
  padding: 0.8rem 1rem;
  min-height: 50px;
  font-size: 1rem; /* 16px prevents iOS zoom-on-focus */
  border: 1px solid #dee2e6;
}

.form-control-xl:focus {
  box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
  border-color: var(--ut-green);
}

.btn-xl {
  border-radius: 0.75rem !important;
  padding: 0.8rem;
  min-height: 50px;
  font-size: 1rem;
}

.btn-google {
  border-radius: 0.75rem !important;
  padding: 0.7rem;
  min-height: 48px;
}

.password-field {
  position: relative;
}

.password-field .form-control-xl {
  padding-right: 3rem;
}

.password-field .form-control-xl.is-invalid {
  background-image: none;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #6c757d;
}

.toggle-password:hover {
  color: var(--ut-green);
}

.toggle-password:focus-visible {
  outline: 2px solid var(--ut-green);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
  color: #6c757d;
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e3e7e5;
}

/* ---------- Terms modal ---------- */
#termsModal .modal-content {
  border-radius: 1rem;
  overflow: hidden;
}

#termsModal .modal-title {
  font-size: 1.05rem;
}

/* ---------- Desktop: split layout ---------- */
@media (min-width: 992px) {
  .auth-page {
    flex-direction: row;
  }

  .auth-brand {
    flex: 0 0 44%;
    max-width: 44%;
    height: calc(100vh - var(--ut-nav-h));
    height: calc(100dvh - var(--ut-nav-h));
    position: sticky;
    top: var(--ut-nav-h);
    align-self: flex-start;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
  }

  .glass-bg {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
  }

  .auth-logo {
    max-width: 150px;
    filter: drop-shadow(0 10px 8px rgba(0, 0, 0, 0.2));
  }

  .auth-title {
    font-size: 2.75rem;
  }

  .auth-tagline {
    font-size: 1.05rem;
  }

  .auth-features {
    display: block;
  }

  .auth-panel {
    align-items: center;
    margin-top: 0;
    padding: 3rem 2rem;
  }

  .auth-card {
    padding: 2.5rem;
  }
}

@media (max-width: 575.98px) {
  .auth-card {
    border-radius: 1.25rem !important;
  }

  #termsModal .modal-content {
    border-radius: 0;
  }
}