:root {
  --bg-base: #000000;
  --bg-card: #0a0a0a;
  --bg-hover: #141414;
  --bg-raised: #111111;

  --border-color: #1f1f1f;
  --border-hover: #333333;

  --text-primary: #ffffff;
  --text-secondary: #888888;
  --text-muted: #555555;

  --accent: #ffffff;
  --accent-dim: rgba(255, 255, 255, 0.1);
  --accent-neon: #00ffaa;
  --accent-purple: #9a89ff;

  --danger: #ff0066;
  --danger-bg: rgba(255, 0, 102, 0.08);
  --danger-border: rgba(255, 0, 102, 0.25);

  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Ambient Backdrops */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(154, 137, 255, 0.08) 0%, transparent 70%);
  top: -150px;
  left: -100px;
}

.ambient-glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 255, 170, 0.04) 0%, transparent 70%);
  bottom: -200px;
  right: 20%;
}

.grid-backdrop {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 50%, black 40%, transparent 80%);
  pointer-events: none;
  z-index: 0;
}

/* Layout */
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(440px, 46%) 1fr;
  position: relative;
  z-index: 1;
}

/* Login Panel */
.login-panel {
  padding: clamp(36px, 7vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 560px;
  width: 100%;
  margin: auto;
  z-index: 2;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 48px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #111111;
  border: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: repeat(2, 8px);
  grid-template-rows: repeat(2, 8px);
  gap: 5px;
  place-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: rotate(-6deg);
  transition: var(--transition);
}

.brand-icon:hover {
  transform: rotate(0deg) scale(1.05);
  border-color: #444;
}

.brand-icon i {
  background: #ffffff;
  border-radius: 2px;
  display: block;
}

.brand-icon i:nth-child(2) {
  opacity: 0.6;
}
.brand-icon i:nth-child(3) {
  opacity: 0.6;
}
.brand-icon i:nth-child(4) {
  background: var(--accent-neon);
}

.brand-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.brand-dot {
  color: var(--accent-neon);
}

/* Kicker & Typography */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.pulse-beacon {
  width: 7px;
  height: 7px;
  background-color: var(--accent-neon);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-neon);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

h1 {
  font-size: clamp(32px, 3.5vw, 40px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
  color: #ffffff;
}

.intro {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 32px;
}

/* Inputs */
.input-field-group {
  margin-bottom: 20px;
}

.input-field-group label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 13px;
  pointer-events: none;
  font-weight: 500;
}

input {
  width: 100%;
  height: 46px;
  background: #080808;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 0 14px 0 38px;
  font-family: inherit;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

input:hover {
  border-color: var(--border-hover);
}

input:focus {
  border-color: var(--accent);
  background: #0e0e0e;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 0 16px rgba(255, 255, 255, 0.04);
}

input::placeholder {
  color: #444444;
}

.password-wrap input {
  padding-right: 76px;
}

.password-wrap button {
  position: absolute;
  right: 6px;
  height: 34px;
  padding: 0 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.password-wrap button:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: #1c1c1c;
}

/* Alert Error */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 16px;
  border-left: 4px solid transparent;
}

.alert-error {
  background: var(--danger-bg);
  border-left-color: var(--danger);
  border: 1px solid var(--danger-border);
  border-left-width: 4px;
  color: #ff99bb;
}

.alert-error[hidden] {
  display: none !important;
}

/* 3D Button */
.btn-3d {
  width: 100%;
  height: 48px;
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #000000;
  border: 1px solid #ffffff;
  border-radius: var(--radius);
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 0 #2a2a2a, 0 8px 24px rgba(255, 255, 255, 0.12);
  transform: translateY(0);
  transition: transform 0.1s, box-shadow 0.1s, background 0.2s;
}

.btn-3d:hover {
  background: #e6e6e6;
  box-shadow: 0 4px 0 #3a3a3a, 0 10px 28px rgba(255, 255, 255, 0.18);
}

.btn-3d:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 transparent;
  background: #cccccc;
}

.btn-3d:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.arrow-icon {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.btn-3d:hover .arrow-icon {
  transform: translateX(3px);
}

.spinner-small {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Security notice */
.security {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 36px;
  line-height: 1.5;
}

.lock-icon {
  font-size: 12px;
  opacity: 0.7;
}

/* Right Side - Cosmic Orbit Scene */
.aside-decoration {
  background: radial-gradient(ellipse at 50% 50%, #0d0d12 0%, #030305 60%, #000000 100%);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
  perspective: 1000px;
}

.space-scene {
  width: 360px;
  height: 360px;
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 32px;
  transform-style: preserve-3d;
}

.starfield {
  position: absolute;
  inset: -50px;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 100px 80px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 220px 140px, #00ffaa, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 300px 60px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 150px 280px, #9a89ff, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 280px 290px, #ffffff, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 320px 320px;
  opacity: 0.4;
  pointer-events: none;
}

.orbits {
  width: 320px;
  height: 320px;
  position: relative;
  display: grid;
  place-items: center;
}

.ring {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.ring-a {
  width: 170px;
  height: 170px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  animation: rotate-orbit 24s linear infinite;
}

.ring-b {
  width: 250px;
  height: 250px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(154, 137, 255, 0.05);
  animation: rotate-orbit-rev 36s linear infinite;
}

.ring-c {
  width: 320px;
  height: 320px;
  border: 1px dashed rgba(255, 255, 255, 0.06);
  animation: rotate-orbit 48s linear infinite;
}

@keyframes rotate-orbit {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes rotate-orbit-rev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.planet {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
}

.planet-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(154, 137, 255, 0.1) 40%, transparent 70%);
  filter: blur(12px);
  animation: planet-pulse 4s ease-in-out infinite alternate;
}

@keyframes planet-pulse {
  from { transform: scale(0.95); opacity: 0.6; }
  to { transform: scale(1.1); opacity: 1; }
}

.planet-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, #a495ff 35%, #34286d 75%, #100b26 100%);
  box-shadow:
    inset -8px -8px 20px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(164, 149, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.satellite {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.satellite-1 {
  width: 14px;
  height: 14px;
  background: #ffffff;
  box-shadow: 0 0 14px #ffffff, 0 0 24px var(--accent-neon);
  border: 1px solid rgba(255, 255, 255, 0.8);
  offset-path: path("M 160, 160 m -85, 0 a 85,85 0 1,0 170,0 a 85,85 0 1,0 -170,0");
  animation: orbit-satellite 9s linear infinite;
}

.satellite-2 {
  width: 10px;
  height: 10px;
  background: var(--accent-neon);
  box-shadow: 0 0 12px var(--accent-neon);
  offset-path: path("M 160, 160 m -125, 0 a 125,125 0 1,0 250,0 a 125,125 0 1,0 -250,0");
  animation: orbit-satellite 16s linear infinite reverse;
}

@keyframes orbit-satellite {
  0% { offset-distance: 0%; }
  100% { offset-distance: 100%; }
}

.aside-content {
  position: relative;
  z-index: 2;
  max-width: 380px;
}

.badge-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.aside-content h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: #ffffff;
}

.aside-content p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

/* Responsiveness */
@media (max-width: 960px) {
  .login-layout {
    grid-template-columns: 1fr;
  }
  .aside-decoration {
    display: none;
  }
  .login-panel {
    padding: 48px 24px;
  }
}

/* Discord-first login and expandable password fallback */
[hidden] { display: none !important; }
.discord-login-area { margin-top: 12px; }
.discord-signin { width:100%; min-height:54px; display:flex; align-items:center; justify-content:center; gap:13px; padding:14px 18px; border-radius:12px; background:#5865f2; color:#fff; font-size:15px; font-weight:700; text-decoration:none; border:1px solid #7480ff; box-shadow:0 8px 28px rgba(88,101,242,.24); transition:background .2s, transform .2s, box-shadow .2s; }
.discord-signin:hover { background:#6976ff; transform:translateY(-2px); box-shadow:0 12px 32px rgba(88,101,242,.32); }
.discord-signin:focus-visible,.login-switch:focus-visible,.back-button:focus-visible { outline:2px solid #a5adff; outline-offset:3px; }
.discord-signin span:last-child { margin-left:auto; }
.discord-signin svg { flex:0 0 auto; }
.approval-note { text-align:center; font-size:12px; color:var(--text-muted); line-height:1.5; margin-top:16px; }
.login-switch { display:block; background:none; border:0; color:#b2b2b2; margin:22px auto 0; cursor:pointer; padding:8px 12px; font-family:inherit; font-size:13px; text-decoration:underline; text-underline-offset:4px; transition:color .2s; }
.login-switch:hover,.back-button:hover { color:#fff; }
.credentials-area { animation:credential-enter .25s ease-out; }
.credentials-title { font-size:22px; font-weight:650; margin-bottom:5px; letter-spacing:-.03em; }
.credentials-subtitle { font-size:13px; color:var(--text-secondary); margin-bottom:28px; }
.back-button { display:inline-block; border:0; padding:8px 0; margin-bottom:22px; background:none; color:#aaa; font-family:inherit; font-size:13px; cursor:pointer; }
.oauth-error { margin-top:18px; }
@keyframes credential-enter { from {opacity:0;transform:translateY(6px)} to {opacity:1;transform:translateY(0)} }
@media (prefers-reduced-motion: reduce) { .credentials-area {animation:none;} .discord-signin {transition:none;} }

/* Orbit V4 — glassy login and soft jelly-button motion */
body{background:radial-gradient(ellipse at 80% 12%,rgba(121,56,252,.23),transparent 52%),radial-gradient(ellipse at 18% 90%,rgba(108,54,196,.18),transparent 52%),#090614}
.login-panel{background:linear-gradient(160deg,rgba(23,14,47,.68),rgba(10,7,24,.35));backdrop-filter:blur(14px)}
.discord-signin,.sign-in{background:linear-gradient(115deg,#6845df,#9b55ed 56%,#6b52e9)!important;color:#fff!important;border:1px solid rgba(219,186,255,.51)!important;box-shadow:0 10px 30px rgba(119,58,230,.3),inset 0 1px 0 rgba(255,255,255,.2)!important;border-radius:15px!important;transition:transform .5s cubic-bezier(.18,1.55,.35,1),box-shadow .3s ease,filter .25s ease!important}
.discord-signin:hover,.sign-in:hover:not(:disabled){transform:translateY(-4px) scale(1.035)!important;filter:brightness(1.14);box-shadow:0 16px 40px rgba(148,78,255,.48)!important}
.discord-signin:active,.sign-in:active:not(:disabled){transform:scale(.95)!important;transition-duration:.12s!important}
.credentials-area{border:1px solid rgba(194,157,255,.16);border-radius:18px;padding:15px;background:rgba(37,26,68,.2)}
.turnstile-container{margin:16px 0;min-height:64px}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important;animation:none!important;transform:none!important}}
