:root {
  --bg: #0b1020;
  --bg-soft: #12182c;
  --bg-deep: #090d18;
  --card: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #f8f7ff;
  --muted: #c9c6d8;
  --accent: #ff4fc4;
  --accent-2: #8b5cff;
  --accent-3: #53b7ff;
  --accent-4: #ff8dd8;
  --accent-soft: rgba(255, 79, 196, 0.16);
  --accent-soft-2: rgba(139, 92, 255, 0.18);
  --success: #9fe3b4;
}

* {
  box-sizing: border-box;
}

html {
  background: #0a0f1d;
  color-scheme: dark;
  min-height: 100%;
  min-height: -webkit-fill-available;
}

body {
  margin: 0;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 79, 196, 0.18), transparent 24%),
    radial-gradient(circle at 86% 14%, rgba(83, 183, 255, 0.16), transparent 22%),
    radial-gradient(circle at 50% 82%, rgba(139, 92, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #0a0f1d 0%, #12182c 52%, #0d1322 100%);
  animation: page-fade-in 220ms ease both;
  transition: opacity 150ms ease;
}

body.page-fade-out {
  opacity: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: -50vh 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.04), transparent 20%),
    radial-gradient(circle at 80% 30%, rgba(255, 255, 255, 0.03), transparent 18%);
  z-index: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.landing-wrap {
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  display: grid;
  place-items: center;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 1;
}

.hero-card,
.auth-card {
  width: 100%;
  max-width: 760px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.auth-card {
  max-width: 480px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  color: #f9dcff;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--accent-4), var(--accent));
  box-shadow:
    0 0 14px rgba(255, 79, 196, 0.72),
    0 0 26px rgba(139, 92, 255, 0.28);
}

.lead {
  color: var(--muted);
  margin: 10px 0 20px;
}

.access-steps {
  margin: 0 0 18px 18px;
  padding: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.inline-link {
  color: #ffd3f4;
  text-decoration: underline;
  text-decoration-color: rgba(255, 79, 196, 0.65);
  text-underline-offset: 2px;
}

.inline-link:hover {
  color: #ffffff;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  padding: 11px 16px;
  cursor: pointer;
  box-shadow:
    0 14px 34px rgba(139, 92, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

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

.auth-switch {
  margin: 10px 0 4px;
  color: var(--muted);
  font-size: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.auth-switch .auth-link {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft-2));
  color: #ffd3f4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font: inherit;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.auth-switch .auth-link:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 10px 22px rgba(139, 92, 255, 0.26);
}

.auth-switch .auth-link:focus-visible {
  outline: 2px solid rgba(255, 79, 196, 0.8);
  outline-offset: 2px;
}

.password-checklist {
  margin: 4px 0 2px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.password-checklist[hidden] {
  display: none !important;
}

.password-checklist li {
  color: var(--muted);
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.password-checklist li::before {
  content: "\25CB";
  font-size: 0.82rem;
  color: var(--muted);
}

.password-checklist li.met {
  color: #9fe3b4;
}

.password-checklist li.met::before {
  content: "\25CF";
  color: #9fe3b4;
}

label {
  font-weight: 600;
}

input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(9, 13, 24, 0.82);
  color: var(--text);
}

#code {
  letter-spacing: 0.3em;
  font-weight: 700;
}

.status-text {
  min-height: 1.2em;
  color: var(--muted);
}

.test-access {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.alt-auth-divider {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

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

.alt-auth-divider span {
  padding: 0 10px;
}

.legal-footer {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100% - 40px));
  margin: 0 auto 20px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  justify-content: center;
}

.legal-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
}

.legal-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.legal-links a:hover {
  color: var(--text);
}

.global-logout-btn {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 120;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 14, 26, 0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.global-logout-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

@keyframes page-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none !important;
    transition: none !important;
  }
}
