/* Auth pages: one deliberate, responsive visual system. */
body.auth-layout {
  background: #f2f5f3;
  color: #17251f;
}

body.auth-layout main {
  min-height: 0;
}

.auth-page {
  min-height: calc(100vh - 58px);
  padding: 3rem 1.25rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(25, 135, 84, 0.08), transparent 28%),
    #f2f5f3;
}

.auth-container {
  width: 100%;
  max-width: 1080px;
  min-height: calc(100vh - 58px - 6rem);
  margin: 0 auto;
}

.auth-layout-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 440px);
  gap: 4rem;
  align-items: center;
  width: 100%;
}

.auth-intro {
  max-width: 430px;
}

.auth-intro__eyebrow {
  margin: 0 0 0.75rem;
  color: #198754;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.auth-intro h1 {
  margin: 0 0 1rem;
  color: #14231b;
  font-size: clamp(2rem, 4vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.auth-intro p {
  max-width: 380px;
  margin: 0;
  color: #66736b;
  font-size: 0.98rem;
  line-height: 1.65;
}

.auth-column,
.auth-column-wide {
  width: 100%;
  max-width: none;
}

.auth-card {
  width: 100%;
  padding: 1.75rem !important;
  border: 1px solid #dce7df !important;
  border-radius: 16px !important;
  background: #ffffff !important;
  box-shadow: 0 18px 42px rgba(23, 56, 38, 0.1) !important;
}

.auth-card,
.auth-card:hover,
.auth-card:focus-within {
  transform: none !important;
  transition: none !important;
}

.auth-heading {
  margin-bottom: 1.35rem !important;
}

.auth-brand {
  display: inline-block;
  margin-bottom: 1rem;
  color: #198754 !important;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.auth-heading h1 {
  margin: 0 0 0.4rem;
  color: #17251f !important;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.auth-heading p {
  margin: 0;
  color: #6a786f !important;
  font-size: 0.86rem;
  line-height: 1.45;
}

.auth-field {
  margin-bottom: 1rem;
}

.auth-field .form-label {
  display: block;
  margin-bottom: 0.4rem;
  color: #405047 !important;
  font-size: 0.76rem;
  font-weight: 700;
}

.auth-field .optional {
  color: #89968e;
  font-weight: 400;
}

.auth-page .input-group {
  display: block;
}

.auth-page .form-control {
  display: block;
  width: 100%;
  min-height: 42px;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cddbd2 !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  color: #17251f !important;
  font-size: 0.86rem;
  line-height: 1.3;
}

.auth-page .form-control::placeholder {
  color: #a0aca5 !important;
}

.auth-page .form-control:focus {
  border-color: #198754 !important;
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.13) !important;
}

.auth-password-field {
  position: relative;
  width: 100%;
}

.auth-password-field .form-control {
  padding-right: 3rem !important;
}

.auth-page .auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  z-index: 2;
  display: inline-grid;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #64746a;
  cursor: pointer;
}

.auth-page .auth-password-toggle:hover,
.auth-page .auth-password-toggle:focus-visible {
  background: #edf7f0;
  color: #146c43;
}

.auth-page .auth-password-toggle:focus-visible {
  outline: 2px solid rgba(25, 135, 84, 0.45);
  outline-offset: 1px;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.2rem 0 1.2rem;
  padding-left: 0 !important;
}

.auth-check .form-check-input {
  position: relative;
  flex: 0 0 14px !important;
  width: 14px !important;
  min-width: 14px !important;
  max-width: 14px !important;
  height: 14px !important;
  min-height: 14px !important;
  max-height: 14px !important;
  margin: 0;
  padding: 0 !important;
  border: 1px solid #9bb5a4 !important;
  border-radius: 50% !important;
  aspect-ratio: 1;
  background-color: #ffffff !important;
  appearance: none;
}

.auth-check .form-check-input:checked {
  border-color: #198754 !important;
  background-color: #198754 !important;
  background-image: linear-gradient(45deg, transparent 45%, #fff 45%, #fff 58%, transparent 58%), linear-gradient(-45deg, transparent 54%, #fff 54%, #fff 64%, transparent 64%);
  background-position: 2px 6px, 6px 3px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 6px 6px;
}

.auth-check .form-check-input:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.16);
}

.auth-check .form-check-label {
  color: #68766e !important;
  font-size: 0.75rem;
  line-height: 1.45;
}

/* Signup-only compact controls. */
.auth-column-wide .auth-field {
  margin-bottom: 0.7rem;
}

.auth-column-wide .form-label {
  margin-bottom: 0.25rem;
  font-size: 0.72rem;
}

.auth-column-wide .form-control {
  min-height: 36px;
  padding: 0.42rem 0.62rem;
  font-size: 0.8rem;
}

.auth-column-wide .auth-check {
  align-items: center;
  gap: 0.5rem;
}

.auth-column-wide .auth-check .form-check-input {
  flex: 0 0 14px !important;
  width: 14px !important;
  height: 14px !important;
  margin: 0;
}

.auth-column-wide .auth-check .form-check-label {
  line-height: 1.25;
}

.auth-link {
  color: #146c43 !important;
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus-visible {
  color: #0d5131 !important;
  text-decoration: underline;
}

.admin-auth-page .auth-layout-panel {
  gap: 3rem;
}

.admin-auth-card {
  max-width: 440px;
  margin: 0 auto;
}

.admin-auth-intro {
  max-width: 470px;
}

.admin-auth-intro h1 {
  font-size: clamp(2.1rem, 4vw, 3.1rem);
}

.auth-submit {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  min-width: 148px;
  min-height: 40px;
  margin: 0 auto 1rem !important;
  padding: 0.55rem 1.25rem !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #198754 !important;
  color: #ffffff !important;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.auth-submit:hover,
.auth-submit:focus-visible {
  background: #146c43 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(25, 135, 84, 0.2);
}

.auth-form.is-submitting .auth-submit {
  min-width: 148px;
  cursor: wait;
  opacity: 0.82;
}

.auth-submit__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

.auth-success-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 35, 24, 0.38);
}

.auth-success-modal__card {
  width: min(100%, 360px);
  padding: 1.75rem 1.5rem 1.5rem;
  border: 1px solid #dce7df;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 22px 54px rgba(15, 50, 30, 0.2);
  text-align: center;
}

.auth-success-modal__mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin: 0 auto 0.9rem;
  place-items: center;
  border-radius: 50%;
  background: #e5f4eb;
  color: #198754;
  font-size: 1.35rem;
  font-weight: 800;
}

.auth-success-modal__card h2 {
  margin: 0 0 0.45rem;
  color: #17251f;
  font-size: 1.25rem;
}

.auth-success-modal__card p {
  margin: 0 0 1.25rem;
  color: #68766e;
  font-size: 0.86rem;
}

.auth-lockout-page .auth-layout-panel {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
}

.auth-lockout-card {
  text-align: center;
}

.auth-lockout-card__mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  place-items: center;
  border: 1px solid #f0dfb2;
  border-radius: 50%;
  background: #fff6df;
  color: #956715;
  font-size: 1.2rem;
}

.auth-lockout-card__eyebrow {
  margin: 0 0 0.45rem;
  color: #78847c;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.auth-lockout-card h2 {
  margin: 0 0 0.5rem;
  color: #17251f;
  font-size: 1.2rem;
  font-weight: 700;
}

.auth-lockout-card__copy {
  margin: 0 auto 1.4rem;
  color: #68766e;
  font-size: 0.84rem;
  line-height: 1.55;
}

.auth-lockout-status {
  min-height: 1.2rem;
  margin: 0.65rem 0 0;
  color: #68766e;
  font-size: 0.76rem;
}

.auth-lockout-countdown {
  display: block;
  margin: 0 0 1.25rem;
  color: #146c43;
  font-size: clamp(2.75rem, 8vw, 4rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}

.auth-lockout-retry {
  display: inline-flex;
  min-width: 180px;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 8px;
  background: #198754;
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 700;
  transition: background-color 0.18s ease, opacity 0.18s ease;
}

.auth-lockout-retry:disabled {
  background: #8da99a;
  cursor: not-allowed;
}

.auth-lockout-retry:not(:disabled):hover,
.auth-lockout-retry:not(:disabled):focus-visible {
  background: #146c43;
}

.auth-lockout-home {
  display: inline-block;
  margin-top: 1rem;
  color: #68766e;
  font-size: 0.78rem;
  text-decoration: none;
}

.auth-lockout-home:hover,
.auth-lockout-home:focus-visible {
  color: #146c43;
  text-decoration: underline;
}

.auth-lockout-noscript {
  margin: 1rem 0 0;
  color: #68766e;
  font-size: 0.76rem;
}

.auth-lockout-noscript a {
  color: #146c43;
  font-weight: 700;
}

.auth-success-modal__close {
  min-width: 112px;
  min-height: 38px;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 7px;
  background: #198754;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-switch {
  margin: 0;
  color: #68766e !important;
  font-size: 0.76rem;
  line-height: 1.45;
}

@media (max-width: 820px) {
  .auth-page {
    padding: 2rem 1rem;
  }

  .auth-container {
    min-height: auto;
  }

  .auth-layout-panel {
    display: block;
    max-width: 440px;
    margin: 0 auto;
  }

  .auth-intro {
    display: none;
  }
}

@media (max-width: 576px) {
  .auth-page {
    min-height: calc(100vh - 58px);
    padding: 1rem 0.75rem 1.5rem;
  }

  .auth-card {
    padding: 1.25rem 1rem !important;
  }

  .auth-heading h1 {
    font-size: 1.3rem;
  }

  .auth-page .row > [class*="col-"] {
    width: 100%;
  }
}
