:root {
  --LPrimary: #309255;
  --LInk: #1D2733;
  --LMuted: #6B7280;
  --LError: #b91c1c;
  --LCardBorder: #e5e7eb;
  --LFieldBorder: #d1d5db;
  --LFieldBorderFocus: #9ca3af;
  --LBackgroundMuted: #f9fafb;
}

.auth-wrap {
  max-width: 520px;
  margin: 6rem auto 4rem;
  padding: 0 1rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-title {
  font-size: 1.75rem;
  color: var(--LInk);
  margin: 0;
  font-weight: 700;
}

.auth-sub {
  color: var(--LMuted);
  margin: 0.25rem 0 0;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--LCardBorder);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px -24px rgba(17, 24, 39, 0.35);
}

.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  color: var(--LMuted);
  font-size: 0.9rem;
}

.auth-form .field {
  margin: 0.85rem 0;
}

.auth-form label {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--LInk);
  margin-bottom: 0.35rem;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"],
.auth-form input[type="checkbox"].auth-checkbox,
.auth-form input[type="password"].has-toggle {
  font: inherit;
}

.auth-form input[type="text"],
.auth-form input[type="password"],
.auth-form input[type="email"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--LFieldBorder);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background-color: #fff;
}

.auth-form input[type="text"]:focus,
.auth-form input[type="password"]:focus,
.auth-form input[type="email"]:focus {
  outline: none;
  border-color: var(--LFieldBorderFocus);
  box-shadow: 0 0 0 4px rgba(48, 146, 85, 0.08);
}

.auth-form input[aria-invalid="true"] {
  border-color: var(--LError);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.08);
}

.auth-actions {
  margin-top: 1.25rem;
}

.btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 0.85rem;
  border-radius: 10px;
  border: 0;
  background: var(--LPrimary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 20px -16px rgba(48, 146, 85, 0.45);
}

.btn-primary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-primary .spinner {
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  width: 16px;
  height: 16px;
  margin-right: 0.6rem;
  animation: auth-spin 0.8s linear infinite;
}

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

.meta-links {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-top: 0.75rem;
  gap: 0.75rem;
}

.meta-links a {
  color: var(--LPrimary);
  text-decoration: none;
  font-weight: 600;
}

.meta-links a:hover {
  text-decoration: underline;
}

.alert {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  margin: 0.35rem 0;
  font-size: 0.95rem;
}

.alert.error {
  background: #FEF2F2;
  color: #7f1d1d;
}

.alert.success {
  background: #E7F8EE;
  color: #166534;
}

.alert.info {
  background: #EFF6FF;
  color: #1d4ed8;
}

.field-error {
  margin-top: 0.4rem;
  color: var(--LError);
  font-size: 0.85rem;
}

.alert.field-error {
  padding: 0.55rem 0.6rem;
  background: #FEF2F2;
  color: var(--LError);
}

.text-muted,
.auth-footer small,
.auth-sub small {
  color: var(--LMuted);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 2.5rem;
}

.pw-toggle {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  transform: translateY(-50%);
  border: none;
  background: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--LMuted);
  padding: 0.25rem;
}

.pw-toggle:focus {
  outline: none;
  color: var(--LPrimary);
}

.caps-hint {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--LMuted);
  display: none;
}

.caps-hint.is-visible {
  display: block;
  color: #92400e;
}

@media (max-width: 640px) {
  .auth-wrap {
    margin-top: 3.5rem;
    padding: 0 1.25rem;
  }

  .auth-card {
    padding: 1.25rem;
  }

  .meta-links {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-primary {
    width: 100%;
  }
}
