:root {
  --bg: #020617;
  --panel: #0f172a;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #8b5cf6;
  --accent-soft: rgba(99, 102, 241, 0.15);
  --line: rgba(255, 255, 255, 0.1);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(99, 102, 241, 0.18), transparent),
    linear-gradient(135deg, #0f172a 0%, #020617 85%);
  color: var(--text);
}

.container {
  width: 100%;
  max-width: 460px;
}

.form-box {
  width: 100%;
  padding: 2.2rem;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.7);
  position: relative;
  animation: fade-up 0.55s ease;
}

.form-box h1 {
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  line-height: 1.1;
  margin-bottom: 1.2rem;
}

.input-group {
  margin-bottom: 1rem;
}

.input-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.input-group input {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.input-group input::placeholder {
  color: #94a3b8;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.22);
}

.input-group.password .input-row {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
}

.input-group.password .input-row input {
  flex: 1;
}

.password-toggle {
  width: 44px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}

.password-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

.password-toggle:focus {
  outline: 2px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
}

.cf-turnstile {
  display: flex;
  justify-content: center;
  margin: 1rem 0 0.2rem;
}

.btn {
  width: 100%;
  margin-top: 0.8rem;
  padding: 0.85rem;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: white;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn:hover::before {
  transform: translateX(100%);
}

.or-divider {
  margin: 1.5rem 0;
  position: relative;
  text-align: center;
}

.or-divider span {
  background: rgba(15, 23, 42, 0.75);
  padding: 0 0.6rem;
  color: var(--muted);
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
}

.or-divider::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.oauth-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.btn-oauth {
  width: 100%;
  padding: 0.78rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-oauth:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.btn-oauth img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.btn-oauth .oauth-label,
.btn-oauth span[data-translate] {
  text-align: left;
  flex: 1;
}

.btn-oauth.google,
.btn-google {
  background: #ffffff;
  color: #000;
}

.btn-oauth.github,
.btn-github {
  background: #405575;
  color: #dde5ec;
}

.btn-oauth.github img,
.btn-github img {
  filter: invert(1);
}

.btn-oauth.discord,
.btn-discord {
  background: #4752c4;
  color: white;
}

.btn-oauth.discord:hover,
.btn-discord:hover {
  background: #4752c4;
}

.btn-oauth.discord img,
.btn-discord img {
  transform: translateY(1px);
}

.discord-join-option {
  margin-top: 0.9rem;
  padding: 0.7rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.discord-join-option label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #cbd5e1;
  font-size: 0.9rem;
  cursor: pointer;
}

.discord-join-option input[type="checkbox"] {
  accent-color: #5865f2;
  width: 16px;
  height: 16px;
}

.redirect-text {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.redirect-text a {
  color: #a5b4fc;
  text-decoration: none;
  font-weight: 600;
}

.redirect-text a:hover {
  text-decoration: underline;
}

.escape {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  font-size: 1.15rem;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, background 0.2s ease;
  z-index: 1000;
}

.escape:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.07);
}

.splash {
  position: absolute;
  top: -25px;
  right: -25px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1.15rem;
  transform: rotate(13deg);
  box-shadow: 0 8px 20px rgba(2, 6, 23, 0.45);
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

@media (max-width: 500px) {
  body {
    padding: 1rem;
  }

  .form-box {
    padding: 1.5rem;
    border-radius: var(--radius-md);
  }

  .input-group.password .input-row {
    display: block;
  }

  .input-group.password .input-row input {
    margin-bottom: 0.55rem;
  }

  .password-toggle {
    width: 100%;
    min-height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .splash {
    transform: none;
  }
}
