/* Auth pages (login / shared shell) */
.auth-page {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - var(--site-header-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 3rem;
  background:
    radial-gradient(ellipse 70% 55% at 50% -10%, rgba(80, 200, 120, 0.14), transparent 58%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(80, 200, 120, 0.05), transparent 55%),
    linear-gradient(180deg, #1a212a 0%, #2c323a 100%);
}

.auth-page-bg {
  position: absolute;
  top: 46%;
  left: 50%;
  width: min(68vw, 720px);
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.14;
  pointer-events: none;
  z-index: 0;
  animation: authWatermarkFloat 16s ease-in-out infinite;
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
}

.auth-shell--wide {
  width: min(480px, 100%);
}

.auth-panel {
  padding: 1.75rem 1.6rem 1.5rem;
  border-radius: 14px;
  border: 1px solid rgba(156, 170, 165, 0.16);
  background: rgba(26, 33, 42, 0.88);
  backdrop-filter: blur(8px);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  animation: authPanelIn 0.45s ease both;
}

.auth-brand {
  margin: 0 0 0.55rem;
  color: #50c878;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.auth-title {
  margin: 0 0 0.4rem;
  color: #fff;
  font-size: clamp(1.55rem, 3.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.auth-lead {
  margin: 0 0 1.35rem;
  color: #9caaa5;
  font-size: 0.92rem;
  line-height: 1.45;
}

.auth-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.auth-form legend {
  display: none;
}

.auth-form .form-group {
  margin-bottom: 0.95rem;
}

.auth-form label {
  display: block;
  margin-bottom: 0.35rem;
  color: #9caaa5;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.auth-form .asteriskField {
  color: #50c878;
  padding-left: 0.15rem;
}

.auth-form .form-control,
.auth-form .textinput,
.auth-form .passwordinput,
.auth-form .select,
.auth-form select {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  background-color: #2c323a;
  border: 1px solid rgba(156, 170, 165, 0.28);
  color: #fff;
  font-size: 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-form select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #9caaa5 50%),
    linear-gradient(135deg, #9caaa5 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.auth-form .form-control:focus,
.auth-form .textinput:focus,
.auth-form .passwordinput:focus,
.auth-form .select:focus,
.auth-form select:focus {
  background-color: #2c323a;
  border-color: #50c878;
  color: #fff;
  box-shadow: 0 0 0 0.14rem rgba(80, 200, 120, 0.18);
  outline: none;
}

.auth-form select:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, #50c878 50%),
    linear-gradient(135deg, #50c878 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.auth-form .form-control::placeholder {
  color: rgba(156, 170, 165, 0.55);
}

.auth-form .invalid-feedback,
.auth-form .errorlist {
  margin: 0.35rem 0 0;
  padding: 0;
  list-style: none;
  color: #e57373;
  font-size: 0.82rem;
}

.auth-form .alert-danger,
.auth-form .errorlist.nonfield {
  margin-bottom: 0.95rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(229, 115, 115, 0.35);
  background: rgba(229, 115, 115, 0.08);
  color: #e57373;
  font-size: 0.88rem;
}

.auth-actions {
  margin-top: 0.35rem;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  border: 1px solid #50c878;
  background: linear-gradient(180deg, rgba(80, 200, 120, 0.34) 0%, rgba(80, 200, 120, 0.18) 100%);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.auth-submit:hover,
.auth-submit:focus {
  background: linear-gradient(180deg, rgba(80, 200, 120, 0.46) 0%, rgba(80, 200, 120, 0.28) 100%);
  border-color: #6ad48c;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(80, 200, 120, 0.18);
  outline: none;
  text-decoration: none;
}

a.auth-submit {
  text-decoration: none;
}

.auth-panel--message .auth-lead {
  margin-bottom: 1.5rem;
}

.auth-footer {
  margin-top: 1.15rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(156, 170, 165, 0.12);
  text-align: center;
  color: #9caaa5;
  font-size: 0.88rem;
}

.auth-footer a {
  color: #50c878;
  font-weight: 600;
  text-decoration: none;
}

.auth-footer a:hover,
.auth-footer a:focus {
  color: #fff;
  text-decoration: underline;
}

.auth-aside {
  margin-top: 1rem;
  text-align: center;
  color: rgba(156, 170, 165, 0.75);
  font-size: 0.8rem;
  animation: authPanelIn 0.55s ease 0.08s both;
}

.auth-aside a {
  color: #9caaa5;
  text-decoration: none;
  border-bottom: 1px solid rgba(156, 170, 165, 0.28);
}

.auth-aside a:hover,
.auth-aside a:focus {
  color: #fff;
  border-bottom-color: rgba(80, 200, 120, 0.55);
}

@keyframes authPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes authWatermarkFloat {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, calc(-50% - 8px)) scale(1.02);
  }
}

@media (max-width: 480px) {
  .auth-page {
    padding: 1.5rem 0.85rem 2rem;
    align-items: flex-start;
  }

  .auth-panel {
    padding: 1.35rem 1.1rem 1.25rem;
  }
}
