:root {
  --auth-bg-1: #07070a;
  --auth-bg-2: #0d0d12;
  --auth-card: rgba(13, 13, 18, 0.86);
  --auth-border: rgba(176, 0, 32, 0.28);
  --auth-shadow: rgba(0, 0, 0, 0.6);
  --auth-text: #f2f2f2;
  --auth-muted: #b9b9c0;
  --auth-accent: #b00020;
  --auth-accent-2: #7a0016;
}

.theme-blue {
  --auth-bg-1: #07070a;
  --auth-bg-2: #0d0d12;
  --auth-card: rgba(13, 13, 18, 0.86);
  --auth-border: rgba(176, 0, 32, 0.28);
  --auth-shadow: rgba(0, 0, 0, 0.6);
  --auth-text: #f2f2f2;
  --auth-muted: #b9b9c0;
  --auth-accent: #b00020;
  --auth-accent-2: #7a0016;
}

body {
  background:
    radial-gradient(1200px circle at 20% -10%, rgba(176, 0, 32, 0.14), transparent 60%),
    radial-gradient(900px circle at 80% 0%, rgba(176, 0, 32, 0.08), transparent 65%),
    linear-gradient(180deg, var(--auth-bg-1) 0%, var(--auth-bg-2) 100%);
  overflow-x: hidden;
  overflow-y: auto;
}

.page {
  padding: 0;
  min-height: 100vh;
}

.page-auth {
  padding-top: 110px;
}

.ambient-bg {
  background:
    radial-gradient(circle at 20% 20%, rgba(176, 0, 32, 0.14), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(176, 0, 32, 0.08), transparent 60%);
}

body.theme-blue .ambient-bg {
  background:
    radial-gradient(circle at 20% 20%, rgba(176, 0, 32, 0.14), transparent 55%),
    radial-gradient(circle at 80% 30%, rgba(176, 0, 32, 0.08), transparent 60%);
}

.bg-noise {
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02) 1px, transparent 1px, transparent 4px);
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}

.auth-page {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: 100vh;
  flex-direction: column;
  gap: 6px;
  padding-top: 24px;
}

.auth-wrap {
  width: 100%;
}

.auth-logo {
  width: min(200px, 56vw);
  display: flex;
  justify-content: center;
  transform: translateY(-88px);
}

.auth-logo-link {
  display: inline-flex;
}

.auth-logo img {
  width: 100%;
  height: auto;
  display: block;
}

.auth-card {
  width: min(460px, 92vw);
  background: var(--auth-card);
  border: 1px solid var(--auth-border);
  border-radius: 18px;
  padding: 28px 28px 24px;
  box-shadow: 0 20px 50px var(--auth-shadow);
  backdrop-filter: blur(4px);
  position: relative;
  z-index: 2;
  min-height: auto;
  aspect-ratio: auto;
  transform: translateY(-18px);
}

.auth-card--login {
  transform: translateY(-28px);
}

.auth-card--register {
  transform: translateY(-112px);
}

.auth-page--register[data-lang="ar"] .auth-logo {
  transform: translateY(-102px);
}

.auth-page--register[data-lang="ar"] .auth-card--register {
  transform: translateY(-132px);
}

.auth-card::before,
.auth-card::after {
  content: none;
}

body.theme-blue .auth-card {
  position: relative;
  isolation: isolate;
}

body.theme-blue .auth-card::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background:
    linear-gradient(transparent, transparent) padding-box,
    conic-gradient(
      from 0deg,
      rgba(176, 0, 32, 0.5),
      rgba(16, 16, 20, 0.45),
      rgba(176, 0, 32, 0.5)
    ) border-box;
  border: 2px solid transparent;
  z-index: -1;
  filter: blur(6px);
  opacity: 0.65;
  animation: spinGlow 8s linear infinite;
}

.auth-top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.lang-switch {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--auth-muted);
}

.lang-switch a {
  color: var(--auth-muted);
  text-decoration: none;
}

.lang-switch a.active {
  color: var(--auth-text);
  font-weight: 600;
}

.auth-head {
  margin-bottom: 18px;
}

.auth-title {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--auth-text);
}

.auth-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--auth-muted);
}

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

.field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--auth-text);
}

.field input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(176, 0, 32, 0.2);
  background: rgba(13, 13, 18, 0.7);
  padding: 12px 14px;
  color: var(--auth-text);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

[dir="rtl"] .field input {
  text-align: right;
}

[dir="ltr"] .field input {
  text-align: left;
}

.field input:focus {
  border-color: rgba(176, 0, 32, 0.6);
  box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.18);
}

.field input.is-error {
  border-color: rgba(176, 0, 32, 0.8);
  box-shadow: 0 0 0 3px rgba(176, 0, 32, 0.24);
}

.alert {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(176, 0, 32, 0.4);
  background: rgba(176, 0, 32, 0.08);
  color: var(--auth-text);
  font-size: 13px;
}

.alert.is-hidden {
  display: none;
}

.btn.primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--auth-accent), var(--auth-accent-2));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(176, 0, 32, 0.25);
}

.btn:focus-visible,
.btn.secondary:focus-visible,
.btn.discord:focus-visible {
  outline: 2px solid rgba(176, 0, 32, 0.7);
  outline-offset: 2px;
}

.btn.secondary {
  width: 100%;
  border-radius: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(176, 0, 32, 0.5);
  color: var(--auth-text);
  background: transparent;
  text-decoration: none;
  text-align: center;
}

.btn.discord {
  width: 100%;
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(176, 0, 32, 0.5);
  background: rgba(13, 13, 18, 0.9);
  color: var(--auth-text);
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 24px rgba(176, 0, 32, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.btn.discord:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(176, 0, 32, 0.28);
  border-color: rgba(176, 0, 32, 0.7);
}

.btn.discord .btn-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.divider {
  margin: 18px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--auth-muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.auth-actions {
  display: flex;
  margin-top: 12px;
}

.auth-social {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.social-link {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(176, 0, 32, 0.5);
  background: rgba(13, 13, 18, 0.7);
  color: var(--auth-text);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.social-link:hover {
  transform: scale(1.06);
  color: var(--auth-text);
  box-shadow: 0 0 18px rgba(176, 0, 32, 0.3);
}

.social-link:focus-visible {
  outline: 2px solid rgba(176, 0, 32, 0.6);
  outline-offset: 3px;
}

.social-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.social-link--discord {
  border-color: rgba(176, 0, 32, 0.5);
  background: rgba(176, 0, 32, 0.12);
  color: var(--auth-text);
}

.social-link--discord:hover {
  box-shadow: 0 0 18px rgba(176, 0, 32, 0.35);
}

.social-link--tiktok {
  border-color: rgba(176, 0, 32, 0.4);
  background: rgba(13, 13, 18, 0.8);
  color: var(--auth-text);
}

.social-link--tiktok:hover {
  box-shadow: 0 0 16px rgba(176, 0, 32, 0.3);
}

.social-link--instagram {
  border-color: rgba(176, 0, 32, 0.55);
  background: rgba(176, 0, 32, 0.16);
  color: var(--auth-text);
}

.social-link--instagram:hover {
  box-shadow: 0 0 16px rgba(176, 0, 32, 0.35);
}

.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(176, 0, 32, 0.7);
  pointer-events: none;
  z-index: 2;
}

.cursor-glow {
  position: fixed;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(176, 0, 32, 0.16), transparent 70%);
  pointer-events: none;
  z-index: 1;
}

[dir="rtl"] .auth-card {
  text-align: right;
}

[dir="ltr"] .auth-card {
  text-align: left;
}

[dir="rtl"] .auth-top {
  justify-content: flex-start;
}

[dir="ltr"] .auth-top {
  justify-content: flex-end;
}

@keyframes spinGlow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 600px) {
  .auth-card {
    padding: 24px 20px;
  }
}
