.auth-page .site-main {
  display: block;
}

.auth-page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem) 1rem 3rem;
}

.auth-card-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 440px);
  gap: 1.5rem;
  align-items: stretch;
}

.auth-showcase,
.auth-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: color-mix(in srgb, var(--surface-strong) 86%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.auth-showcase::before,
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.42), transparent);
  pointer-events: none;
}

.auth-showcase {
  padding: clamp(1.4rem, 2vw, 2.2rem);
  min-height: 100%;
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(37, 99, 235, 0.14), transparent 42%),
    radial-gradient(90% 100% at 100% 100%, rgba(124, 58, 237, 0.12), transparent 45%),
    color-mix(in srgb, var(--surface-strong) 88%, transparent);
}

.auth-card {
  padding: clamp(1.25rem, 1.8vw, 2rem);
  align-self: center;
}

.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.auth-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.auth-showcase h1 {
  margin-top: 1rem;
  font-size: clamp(2rem, 1.4rem + 1.8vw, 3.3rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  color: var(--text);
}

.auth-showcase p {
  margin-top: 1rem;
  max-width: 62ch;
  font-size: 1.03rem;
  line-height: 1.8;
  color: var(--text-soft);
}

.auth-feature-list {
  display: grid;
  gap: 0.8rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.auth-feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 84%, transparent);
  color: var(--text-soft);
  box-shadow: var(--shadow-xs);
}

.auth-feature-list li strong {
  display: block;
  color: var(--text);
  font-size: 0.97rem;
  margin-bottom: 0.15rem;
}

.auth-feature-list-icon {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 0.95rem;
}

.auth-showcase-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.auth-card-head {
  text-align: center;
  margin-bottom: 1.4rem;
}

.auth-card-title {
  font-size: clamp(1.8rem, 1.4rem + 1vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text);
}

.auth-card-subtitle {
  margin-top: 0.75rem;
  font-size: 0.98rem;
  color: var(--text-soft);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.auth-field label {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
}

.auth-field input {
  min-height: 52px;
  border-radius: 16px;
}

.auth-field-help {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 800;
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.2);
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), filter var(--transition-fast);
}

.auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 42px rgba(37, 99, 235, 0.26);
  filter: saturate(1.05);
}

.auth-separator {
  position: relative;
  text-align: center;
  margin: 1.4rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.auth-separator span {
  position: relative;
  z-index: 1;
  padding: 0 0.8rem;
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
}

.auth-separator::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1px;
  background: var(--border);
}

.auth-social-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.auth-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 88%, transparent);
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.auth-social-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.auth-social-btn.github {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,245,249,0.92));
}

[data-theme="dark"] .auth-social-btn.github {
  background:
    linear-gradient(180deg, rgba(30,41,59,0.94), rgba(15,23,42,0.96));
}

.auth-links {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.2rem;
  text-align: center;
}

.auth-links p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.auth-links a {
  color: var(--primary);
  font-weight: 800;
}

.auth-links a:hover {
  color: var(--primary-strong);
}

.auth-messages {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.auth-alert {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.94rem;
}

.auth-alert-error {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.18);
  color: #991b1b;
}

.auth-alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.18);
  color: #065f46;
}

[data-theme="dark"] .auth-alert-error {
  color: #fecaca;
}

[data-theme="dark"] .auth-alert-success {
  color: #bbf7d0;
}

.auth-field-errors {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.35rem;
}

.auth-field-errors li {
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 600;
}

.auth-recaptcha {
  width: min(100%, 320px);
  margin: 0.25rem auto 0;
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  padding: 0.95rem;
  background: var(--surface-strong);
  box-shadow: var(--shadow-xs);
}

.auth-recaptcha-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.auth-recaptcha-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.auth-recaptcha-label {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

.auth-recaptcha-footer {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-recaptcha-footer strong {
  color: var(--text-soft);
}

.auth-modal {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.auth-modal .modal-content {
  margin: 0;
  width: min(100%, 420px);
  text-align: center;
}

.auth-modal .modal-content p {
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

.auth-modal-actions {
  display: flex;
  justify-content: center;
}

.auth-modal-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.1rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.18);
}

.auth-page .footer {
  margin-top: 2rem;
}

[data-theme="dark"] .auth-showcase,
[data-theme="dark"] .auth-card {
  background:
    radial-gradient(130% 140% at 0% 0%, rgba(96,165,250,0.08), transparent 42%),
    linear-gradient(180deg, rgba(15,23,42,0.88), rgba(15,23,42,0.74));
  border-color: rgba(148, 163, 184, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 18px 42px rgba(2, 6, 23, 0.3);
}

[data-theme="dark"] .auth-feature-list li,
[data-theme="dark"] .auth-chip {
  background: rgba(15, 23, 42, 0.66);
  border-color: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .auth-recaptcha {
  background: rgba(15, 23, 42, 0.76);
  border-color: rgba(148, 163, 184, 0.16);
}

[data-theme="dark"] .auth-recaptcha-footer {
  border-top-color: rgba(148, 163, 184, 0.16);
}

@media (max-width: 980px) {
  .auth-card-wrap {
    grid-template-columns: 1fr;
  }

  .auth-showcase {
    order: 2;
  }

  .auth-card {
    order: 1;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 640px) {
  .auth-page-shell {
    padding-inline: 0.8rem;
  }

  .auth-showcase,
  .auth-card {
    padding: 1rem;
    border-radius: 22px;
  }

  .auth-showcase h1 {
    font-size: 2rem;
  }

  .auth-submit,
  .auth-social-btn {
    min-height: 48px;
  }
}