:root {
  --bg: #08080f;
  --bg-elev: #10101a;
  --bg-card: rgba(17, 17, 28, 0.72);
  --bg-card-strong: rgba(18, 18, 30, 0.9);
  --text: #f5f7ff;
  --text-soft: rgba(245, 247, 255, 0.72);
  --text-dim: rgba(245, 247, 255, 0.58);
  --border: rgba(255, 255, 255, 0.08);
  --primary: #a76cff;
  --primary-2: #7c4dff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: Inter, Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(167, 108, 255, 0.16), transparent 28%),
    radial-gradient(circle at bottom right, rgba(124, 77, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #08080f 0%, #0d0d17 100%);
  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
}

.site-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(167, 108, 255, 0.12), transparent 30%),
    radial-gradient(circle at 80% 75%, rgba(124, 77, 255, 0.12), transparent 28%);
  z-index: 0;
}

.site-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
  z-index: 0;
}

/* =========================
   AUTH PAGES (Ez ID)
========================= */

.auth-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.auth-title {
  font-size: 2rem;
  line-height: 1.1;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-subtitle {
  color: var(--text-soft);
  margin: 0 0 26px;
  font-size: 0.98rem;
  line-height: 1.5;
}

.auth-form {
  width: 100%;
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

.auth-form input {
  width: 100%;
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.03);
  color: var(--text);
  margin-bottom: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font: inherit;
}

.auth-form input::placeholder {
  color: rgba(245, 247, 255, 0.38);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(167,108,255,0.15);
  background: rgba(255,255,255,0.04);
}

.auth-button {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  font-family: inherit;
}

.auth-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(124,77,255,0.35);
}

.auth-button:active {
  transform: translateY(0);
}

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
}

.auth-footer a:hover {
  text-decoration: underline;
}

.auth-message {
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.auth-message.error {
  background: rgba(255,80,80,0.08);
  border: 1px solid rgba(255,80,80,0.35);
  color: #ffb3b3;
}

.auth-message.success {
  background: rgba(80,200,120,0.08);
  border: 1px solid rgba(80,200,120,0.35);
  color: #baf5c8;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 640px) {
  .auth-wrapper {
    padding: 20px;
  }

  .auth-card {
    padding: 28px 22px;
    border-radius: 16px;
  }

  .auth-title {
    font-size: 1.75rem;
  }

  .auth-subtitle {
    font-size: 0.95rem;
  }
}

.auth-button-link {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  font-family: inherit;
}

.auth-button-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(124,77,255,0.35);
}

.auth-help {
  display: block;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 6px;
  margin-bottom: 14px;
}

.auth-form label {
  display: block;
  margin-bottom: 8px;
}

.auth-form input {
  margin-bottom: 0;
}

#username-status {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  margin-bottom: 14px;
}

#username-status.is-valid {
  color: #57d38c;
}

#username-status.is-invalid {
  color: #ff7b7b;
}

.auth-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.auth-button:disabled:hover {
  transform: none;
  box-shadow: none;
}