.auth-page {
  position: relative;
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 24px 72px;
  overflow: hidden;
}

.auth-page-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 60% at 15% 20%, rgba(61, 106, 158, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 55% at 85% 75%, rgba(80, 136, 191, 0.16), transparent 50%),
    radial-gradient(circle at 50% 110%, rgba(26, 45, 74, 0.45), transparent 45%);
}

.auth-page-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(91, 141, 217, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 141, 217, 0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 20%, transparent 75%);
}

.auth-page-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  animation: auth-page-enter 0.45s ease both;
}

.auth-page-shell--login {
  width: min(100%, 680px);
}

@keyframes auth-page-enter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-page-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-page-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #e8eaed;
}

.site-logo--auth {
  height: 44px;
  width: auto;
  max-width: 180px;
}

.auth-page-brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, #2a4a6e 0%, #5088bf 100%);
  border: 1px solid rgba(107, 159, 212, 0.45);
  box-shadow: 0 8px 24px rgba(61, 106, 158, 0.35);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.auth-page-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.auth-page-brand-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.auth-page-brand-tag {
  font-size: 0.78rem;
  color: #8a939e;
  letter-spacing: 0.02em;
}

.auth-page-card {
  width: 100%;
  background: linear-gradient(180deg, rgba(22, 27, 40, 0.96) 0%, rgba(16, 19, 28, 0.98) 100%);
  border: 1px solid rgba(91, 141, 217, 0.32);
  border-radius: 18px;
  padding: 36px 40px 32px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 0 48px rgba(61, 106, 158, 0.12);
  backdrop-filter: blur(8px);
}

.auth-page-card-header {
  margin-bottom: 26px;
}

.auth-page-title {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 3vw, 2.1rem);
  color: #fff;
  letter-spacing: -0.02em;
}

.auth-page-subtitle {
  margin: 0;
  color: #9aa3b2;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 52ch;
}

.auth-page-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-page-form-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .auth-page-form-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.auth-page-form label {
  font-size: 0.88rem;
  color: #b8c0cc;
  margin-bottom: 4px;
  display: block;
  font-weight: 600;
}

.auth-page-form input[type="text"],
.auth-page-form input[type="email"],
.auth-page-form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: rgba(8, 10, 18, 0.85);
  border: 1px solid rgba(68, 68, 85, 0.9);
  border-radius: 10px;
  color: #e8eaed;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.auth-page-form input:focus {
  outline: none;
  border-color: #6b9fd4;
  background: rgba(10, 12, 22, 0.95);
  box-shadow: 0 0 0 3px rgba(91, 141, 217, 0.18);
}

.auth-page-form input.invalid {
  border-color: #c44;
}

.auth-page-mc-field {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 12px;
  background: rgba(16, 22, 34, 0.75);
  border: 1px solid rgba(91, 141, 217, 0.22);
}

.auth-page-mc-avatar {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #0d0d1a;
  border: 1px solid rgba(91, 141, 217, 0.25);
  object-fit: cover;
  image-rendering: pixelated;
}

.auth-page-mc-field .auth-page-form {
  gap: 0;
}

.auth-page-mc-field label {
  margin-bottom: 6px;
}

.auth-page-mc-field input {
  background: rgba(8, 10, 18, 0.7);
}

.auth-page-submit {
  background: linear-gradient(135deg, #5088bf 0%, #3d6a9e 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  margin-top: 6px;
  box-shadow: 0 10px 28px rgba(61, 106, 158, 0.35);
}

.auth-page-submit:hover {
  filter: brightness(1.06);
  box-shadow: 0 12px 32px rgba(61, 106, 158, 0.45);
}

.auth-page-submit:active {
  transform: translateY(1px);
}

.auth-page-submit:disabled {
  background: #444;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

.auth-page-secondary {
  background: transparent;
  border: 1px solid #444;
  color: #bbb;
  box-shadow: none;
}

.auth-page-secondary:hover {
  background: #1a1f2e;
  border-color: #5b8dd9;
  color: #e0e0e0;
  box-shadow: none;
}

.auth-page-error,
.auth-page-success {
  font-size: 0.9rem;
  border-radius: 8px;
  padding: 10px 14px;
  display: none;
}

.auth-page-error {
  color: #ff8a8a;
  background: rgba(42, 16, 16, 0.85);
  border: 1px solid rgba(224, 90, 90, 0.25);
}

.auth-page-success {
  color: #7ee0a0;
  background: rgba(15, 42, 26, 0.85);
  border: 1px solid rgba(90, 205, 126, 0.25);
}

.auth-page-error.visible,
.auth-page-success.visible {
  display: block;
}

.auth-page-footer {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(42, 42, 58, 0.85);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: center;
  text-align: center;
}

.auth-page-footer a,
.auth-page-link-btn {
  color: #6b9fd4;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.auth-page-footer a:hover,
.auth-page-link-btn:hover {
  color: #9eb4cc;
  text-decoration: underline;
}

.auth-page-hint {
  margin: 4px 0 0;
  color: #777;
  font-size: 0.84rem;
  line-height: 1.45;
}

.auth-page-requirements {
  margin: 0 0 18px;
  padding: 14px 16px;
  background: rgba(16, 19, 28, 0.9);
  border: 1px solid rgba(42, 48, 56, 0.95);
  border-left: 3px solid #5088bf;
  border-radius: 10px;
  color: #9aa3b2;
  font-size: 0.88rem;
  line-height: 1.55;
}

.auth-page-requirements strong {
  color: #d5dbe3;
  font-weight: 600;
}

.auth-page-step {
  display: none;
}

.auth-page-step.active {
  display: block;
  animation: auth-step-in 0.3s ease both;
}

@keyframes auth-step-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-verify-panel {
  padding: 22px;
  border-radius: 14px;
  background: rgba(12, 16, 26, 0.85);
  border: 1px solid rgba(91, 141, 217, 0.22);
}

.auth-reset-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: #ffd700;
  background: linear-gradient(180deg, #151824 0%, #10131c 100%);
  border: 1px solid rgba(255, 215, 0, 0.22);
  border-radius: 12px;
  padding: 16px 18px;
  text-align: center;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.08);
  animation: auth-code-pulse 2.4s ease-in-out infinite;
}

@keyframes auth-code-pulse {
  0%, 100% { box-shadow: 0 0 24px rgba(255, 215, 0, 0.08); }
  50% { box-shadow: 0 0 32px rgba(255, 215, 0, 0.16); }
}

.auth-reset-waiting {
  color: #c5cdd6;
  font-size: 0.96rem;
  line-height: 1.55;
}

.auth-reset-timer {
  color: #8a939e;
  font-size: 0.88rem;
  margin-top: 10px;
}

.auth-reset-options {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.auth-reset-option {
  background: #10131c;
  border: 1px solid #2a2a3a;
  border-radius: 10px;
  padding: 14px 14px 12px;
}

.auth-reset-option-title {
  margin: 0 0 6px;
  font-size: 0.92rem;
  color: #e8eaed;
  font-weight: 700;
}

.auth-reset-option-text,
.auth-reset-option-note {
  margin: 0 0 8px;
  color: #9aa3b2;
  font-size: 0.88rem;
  line-height: 1.45;
}

.auth-reset-option-note {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: #777;
}

.auth-reset-option .auth-reset-code {
  margin-top: 4px;
  font-size: 1.15rem;
}

@media (min-width: 560px) {
  .auth-page-card:has(.auth-reset-options) {
    width: 100%;
  }

  .auth-reset-options {
    grid-template-columns: 1fr 1fr;
  }
}

.auth-success-panel {
  text-align: center;
  padding: 12px 0 6px;
}

.auth-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(90, 205, 126, 0.15);
  border: 2px solid rgba(90, 205, 126, 0.45);
  color: #5acd7e;
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 60px;
  box-shadow: 0 0 32px rgba(90, 205, 126, 0.15);
}

.auth-success-title {
  margin: 0 0 10px;
  font-size: 1.45rem;
  color: #fff;
}

.auth-success-text {
  margin: 0 0 18px;
  color: #9aa3b2;
  font-size: 1rem;
  line-height: 1.55;
}

.auth-success-countdown {
  margin: -8px 0 16px;
  color: #777;
  font-size: 0.88rem;
}

.auth-success-btn {
  display: inline-block;
  text-decoration: none;
  line-height: 1.2;
  padding: 13px 28px;
  width: auto;
  min-width: 160px;
}

@media (max-width: 639px) {
  .auth-page {
    padding: 40px 16px 56px;
  }

  .auth-page-card {
    padding: 28px 22px 24px;
  }

  .auth-page-mc-field {
    grid-template-columns: 48px 1fr;
    gap: 12px;
  }

  .auth-page-mc-avatar {
    width: 48px;
    height: 48px;
  }

  .auth-page-footer {
    flex-direction: column;
  }
}
