:root {
  --bg: #0a0712;
  --surface-solid: #181125;
  --border: #2a2140;
  --text: #ece8f5;
  --muted: #a99fc4;
  --accent: #be8bf5;
  --accent-2: #9d5cf0;
  --accent-soft: #be8bf51a;
  --danger: #ff7a8a;
  --ok: #7df5b0;
  --radius: 16px;
  --shadow: 0 24px 70px -24px rgba(0,0,0,.8);
}

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

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  -webkit-font-smoothing: antialiased;
  position: relative; overflow: hidden;
}

.auth-glow {
  position: fixed; top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(closest-side, var(--accent-2), transparent 70%);
  opacity: .25; filter: blur(40px); z-index: 0; pointer-events: none;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.auth-shell {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
}

.auth-brand { display: flex; align-items: center; gap: 11px; }
.auth-logo { width: 38px; height: 38px; object-fit: contain; }
.auth-name { font-weight: 800; font-size: 24px; letter-spacing: -.02em; }

.auth-card {
  width: 100%;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 28px;
}

/* Tabs */
.auth-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  background: #0e0a18; border: 1px solid var(--border); border-radius: 12px;
  padding: 5px; margin-bottom: 24px;
}
.auth-tab {
  position: relative; z-index: 1; background: none; border: 0; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--muted);
  padding: 10px; border-radius: 8px; transition: color .25s;
}
.auth-tab.active { color: #15091f; }
.auth-tab-indicator {
  position: absolute; top: 5px; left: 5px; z-index: 0;
  width: calc(50% - 5px); height: calc(100% - 10px);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 8px; transition: transform .28s cubic-bezier(.4,.0,.2,1);
}
.auth-tabs.signup .auth-tab-indicator { transform: translateX(100%); }

/* Forms */
.auth-form { display: none; flex-direction: column; gap: 16px; }
.auth-form.active { display: flex; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.auth-title { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); font-size: 14px; margin-top: -8px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  font-family: inherit; font-size: 15px; color: var(--text);
  background: #0e0a18; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #6a6088; }
.field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field input.invalid { border-color: var(--danger); }

.field-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.checkbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; }
.checkbox input { accent-color: var(--accent); width: 15px; height: 15px; }
.checkbox.terms { line-height: 1.5; align-items: flex-start; }
.link { color: var(--accent); font-weight: 600; }
.link:hover { text-decoration: underline; }

.btn-auth {
  font-family: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
  color: #15091f; border: 0; border-radius: 999px; padding: 13px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 12px 30px -12px var(--accent-2);
  transition: transform .15s, box-shadow .2s;
}
.btn-auth:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -12px var(--accent-2); }
.btn-auth:active { transform: translateY(0); }
.btn-auth:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-discord {
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: var(--text); background: #5865F2; border: 0; border-radius: 999px; padding: 12px;
  transition: filter .2s, transform .15s;
}
.btn-discord:hover { filter: brightness(1.1); transform: translateY(-2px); }

.form-msg { font-size: 13px; min-height: 18px; text-align: center; margin-top: -4px; }
.form-msg.error { color: var(--danger); }
.form-msg.success { color: var(--ok); }

.auth-foot { color: var(--muted); font-size: 13px; }

@media (max-width: 480px) {
  .auth-card { padding: 22px 18px; }
}
