/* ++++++++++++++++++++++++++++++++  Auth (Login / Signup)  ++++++++++++++++++++++++++++++++ */
/* Modern, self-contained styling for the public auth pages.                                  */
/* Reuses the central project color variables defined in base/css/base.css so the look stays  */
/* consistent with the rest of the application (primary blue #0f7bd4, dark text, light bg).    */

/* --- Page frame -------------------------------------------------------------------------- */
/* auth.css is only linked from the public auth templates, so targeting the body by its id   */
/* (set in base.html) safely scopes the page background to login / signup only.              */
body#main_body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(15, 123, 212, 0.10), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(12, 95, 163, 0.10), transparent 55%),
    var(--background-color);
}

/* Hide the global app loader logo on the auth screens (no authenticated content here). */
.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 9rem);
  padding: 2rem 1rem 3rem;
}

/* --- Card -------------------------------------------------------------------------------- */
.auth-card {
  width: 100%;
  max-width: 980px;
  display: flex;
  background: var(--background-white);
  border-radius: 20px;
  overflow: hidden;
  box-shadow:
    0 24px 60px rgba(15, 123, 212, 0.14),
    0 6px 18px rgba(0, 0, 0, 0.06);
}

/* --- Brand panel (left) ------------------------------------------------------------------ */
.auth-brand {
  flex: 0 0 44%;
  position: relative;
  padding: 3.25rem 2.75rem;
  color: var(--color-white);
  background:
    linear-gradient(160deg, var(--primary-project-color) 0%, var(--primary-project-color-dark) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand::after {
  /* subtle decorative glow */
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.auth-brand__logo {
  width: 150px;
  max-width: 60%;
  margin-bottom: 2rem;
}

.auth-brand__title {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.auth-brand__subtitle {
  font-size: 1rem;
  font-weight: 300;
  opacity: 0.92;
  margin-bottom: 2rem;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 0;
}

.auth-features li {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 400;
  margin-bottom: 0.9rem;
}

.auth-features li i {
  width: 1.9rem;
  height: 1.9rem;
  margin-right: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.85rem;
}

/* --- Form panel (right) ------------------------------------------------------------------ */
.auth-form {
  flex: 1;
  padding: 3.25rem 3rem;
}

.auth-form__title {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.35rem;
}

.auth-form__lead {
  font-size: 0.95rem;
  color: var(--text-color-light);
  margin-bottom: 2rem;
}

/* --- Fields ------------------------------------------------------------------------------ */
.auth-field {
  text-align: left;
  margin-bottom: 1.2rem;
}

.auth-field > label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-color-light);
  margin-bottom: 0.4rem;
}

/* Override MDB material input styling with a clean, fully bordered control. */
.auth-card .form-control,
.auth-card .custom-select {
  display: block;
  width: 100%;
  height: auto;
  padding: 0.7rem 0.95rem;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-color);
  background-color: var(--background-white);
  border: 1px solid var(--border-color-medium);
  border-radius: 11px;
  box-shadow: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  margin: 0;
}

.auth-card .form-control:focus,
.auth-card .custom-select:focus {
  border-color: var(--primary-project-color);
  box-shadow: 0 0 0 3px rgba(15, 123, 212, 0.16);
  outline: none;
}

.auth-card .form-control::placeholder {
  color: var(--text-color-lighter);
}

/* Field validation errors */
.auth-field .invalid-feedback {
  display: block;
  font-size: 0.8rem;
  color: var(--color-red);
  margin-top: 0.35rem;
}

/* --- Submit button ----------------------------------------------------------------------- */
.auth-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 0.8rem 1rem;
  margin-top: 0.4rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--color-white);
  border: none;
  border-radius: 11px;
  cursor: pointer;
  background: linear-gradient(160deg, var(--primary-project-color) 0%, var(--primary-project-color-dark) 100%);
  box-shadow: 0 8px 20px rgba(15, 123, 212, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(15, 123, 212, 0.34);
  filter: brightness(1.03);
  color: var(--color-white);
  text-decoration: none;
}

.auth-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(15, 123, 212, 0.26);
}

/* --- Links / helper text ------------------------------------------------------------------ */
.auth-links {
  margin-top: 1.5rem;
  text-align: center;
}

.auth-links a {
  color: var(--link-color);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
}

.auth-links a:hover {
  color: var(--primary-project-color-dark);
  text-decoration: underline;
}

.auth-divider {
  height: 1px;
  background: var(--border-color-light);
  margin: 1.4rem 0 1.1rem;
}

/* --- Legal consent (signup) --------------------------------------------------------------- */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-color-light);
  margin: 0.4rem 0 1.4rem;
}

/* Force native checkbox rendering: MDB Pro hides raw checkboxes (opacity:0 / off-screen)   */
/* to swap in material checkboxes via a label ::before, which would make this one invisible. */
.auth-consent input[type="checkbox"] {
  position: static;
  opacity: 1;
  pointer-events: auto;
  -webkit-appearance: checkbox;
  -moz-appearance: checkbox;
  appearance: checkbox;
  margin: 0.2rem 0 0 0;
  width: 1.05rem;
  height: 1.05rem;
  min-width: 1.05rem;
  flex: 0 0 auto;
  accent-color: var(--primary-project-color);
}

.auth-consent a {
  color: var(--link-color);
  font-weight: 500;
}

/* --- Alerts ------------------------------------------------------------------------------- */
.auth-alert {
  text-align: left;
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 11px;
  margin-bottom: 1.25rem;
}

.auth-alert--error {
  color: #842029;
  background: #f8d7da;
  border: 1px solid #f1aeb5;
}

.auth-alert--info {
  color: #084298;
  background: #cfe2ff;
  border: 1px solid #9ec5fe;
}

/* --- Footer ------------------------------------------------------------------------------- */
.auth-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.85rem;
  color: var(--text-color-light);
}

.auth-footer a {
  color: var(--link-color);
  text-decoration: none;
}

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

/* --- Responsive --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .auth-card {
    max-width: 460px;
    flex-direction: column;
  }

  .auth-brand {
    flex: none;
    padding: 2.25rem 2rem;
    text-align: center;
    align-items: center;
  }

  .auth-brand::after {
    display: none;
  }

  .auth-features {
    display: none;
  }

  .auth-form {
    padding: 2.5rem 1.85rem;
  }
}
