/* ─── AUTH PAGES (login / register) ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --purple:       #a855f7;
  --purple-light: #c084fc;
  --purple-dark:  #7c3aed;
  --purple-glow:  rgba(168,85,247,0.35);
  --bg:           #05030a;
  --surface:      rgba(255,255,255,0.04);
  --border:       rgba(168,85,247,0.2);
  --text:         #f1eeff;
  --text-muted:   #8b7fa8;
  --error:        #f87171;
  --success:      #4ade80;
  --font:         'Inter', sans-serif;
  --radius:       14px;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ─── BG ─── */
.bg-gif-wrap { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
.bg-gif {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0.12;
  filter: saturate(1.4);
}
.bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(5,3,10,0.9) 0%, rgba(30,10,60,0.6) 50%, rgba(5,3,10,0.95) 100%);
}
#lightning-canvas { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ─── CARD ─── */
.auth-wrap {
  position: relative; z-index: 10;
  width: 100%; max-width: 440px;
  padding: 16px;
}
.auth-card {
  background: rgba(8,5,18,0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px;
  backdrop-filter: blur(24px);
  box-shadow:
    0 0 60px rgba(168,85,247,0.1),
    0 24px 64px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.06);
  animation: slideUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes slideUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}

/* ─── LOGO ─── */
.auth-logo {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; text-decoration: none;
  font-weight: 900; font-size: 1.4rem; letter-spacing: -0.04em;
  margin-bottom: 28px;
}
.auth-logo .logo-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 10px var(--purple));
}
.auth-logo .logo-text {
  background: linear-gradient(135deg, #fff 30%, var(--purple-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ─── HEADING ─── */
.auth-title {
  font-size: 1.6rem; font-weight: 800; letter-spacing: -0.04em;
  text-align: center; margin-bottom: 6px;
}
.auth-subtitle {
  text-align: center; font-size: 0.88rem; color: var(--text-muted);
  margin-bottom: 32px; line-height: 1.6;
}

/* ─── FORM ─── */
.auth-form { display: flex; flex-direction: column; gap: 18px; }

.field-group { display: flex; flex-direction: column; gap: 7px; }
.field-label {
  font-size: 0.82rem; font-weight: 600;
  color: var(--text-muted); letter-spacing: 0.01em;
}
.field-input-wrap { position: relative; }
.field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); font-size: 0.95rem; pointer-events: none;
}
.field-input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: 10px;
  padding: 12px 14px 12px 40px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field-input::placeholder { color: var(--text-muted); opacity: 0.6; }
.field-input:focus {
  border-color: rgba(168,85,247,0.5);
  background: rgba(168,85,247,0.04);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.1);
}
.field-input.error {
  border-color: rgba(248,113,113,0.5);
  box-shadow: 0 0 0 3px rgba(248,113,113,0.08);
}
.field-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px; font-size: 0.85rem; transition: color 0.2s;
}
.field-toggle:hover { color: var(--purple-light); }
.field-error {
  font-size: 0.78rem; color: var(--error); display: none;
  padding-left: 2px;
}
.field-error.show { display: block; }

/* ─── TURNSTILE ─── */
.turnstile-wrap {
  display: flex; justify-content: center;
  min-height: 65px; align-items: center;
}

/* ─── SUBMIT ─── */
.btn-auth {
  width: 100%;
  background: linear-gradient(135deg, var(--purple-dark), var(--purple));
  color: #fff; border: none;
  padding: 14px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.95rem; font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 24px rgba(168,85,247,0.35);
  position: relative; overflow: hidden;
}
.btn-auth:hover:not(:disabled) {
  opacity: 0.9; transform: translateY(-1px);
  box-shadow: 0 0 36px rgba(168,85,247,0.5);
}
.btn-auth:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-auth .spinner {
  display: none; width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto;
}
.btn-auth.loading .btn-text { display: none; }
.btn-auth.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── DIVIDER ─── */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ─── DISCORD ─── */
.btn-discord-auth {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(88,101,242,0.12);
  border: 1px solid rgba(88,101,242,0.3);
  color: #b6bcff;
  padding: 13px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-discord-auth:hover {
  background: rgba(88,101,242,0.22);
  border-color: rgba(88,101,242,0.55);
  transform: translateY(-1px);
}

/* ─── FOOTER ─── */
.auth-footer {
  text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: 22px;
}
.auth-footer a { color: var(--purple-light); text-decoration: none; font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ─── TOAST ─── */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 999;
  background: rgba(10,6,20,0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: 0.88rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
  max-width: 320px;
}
.toast.show { transform: translateX(0); }
.toast.success { border-color: rgba(74,222,128,0.3); }
.toast.error   { border-color: rgba(248,113,113,0.3); }
.toast-icon { font-size: 1rem; }

/* ─── PASSWORD STRENGTH ─── */
.pw-strength { display: none; flex-direction: column; gap: 5px; }
.pw-strength.show { display: flex; }
.pw-bar-track { height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.pw-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s, background 0.3s; width: 0; }
.pw-label { font-size: 0.72rem; color: var(--text-muted); }

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px; }
  .auth-title { font-size: 1.4rem; }
}

/* ─── AUTH LOGO FIX ─── */
.auth-logo img {
  height: 36px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(168,85,247,0.5));
}

/* ─── GOOGLE BUTTON ─── */
.btn-google-auth {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e8e0ff;
  padding: 13px;
  border-radius: 12px;
  font-family: var(--font);
  font-size: 0.92rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.btn-google-auth:hover {
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}

/* ─── FORGOT PASSWORD LINK ─── */
.forgot-link {
  font-size: 0.78rem; color: var(--purple-light);
  text-decoration: none; font-weight: 500;
}
.forgot-link:hover { text-decoration: underline; }

/* ─── LINK BUTTON (inline text button) ─── */
.link-btn {
  background: none; border: none; padding: 0;
  color: var(--purple-light); font-family: var(--font);
  font-size: inherit; font-weight: 600;
  cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover { color: #d8b4fe; }
.link-btn:disabled { color: var(--text-muted); text-decoration: none; cursor: default; }

/* ─── VERIFY ICON ─── */
.verify-icon-wrap {
  text-align: center; margin-bottom: 16px;
}
.verify-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px;
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: 50%;
  font-size: 1.8rem;
  margin: 0 auto;
  animation: popIn 0.4s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── 6-DIGIT CODE INPUTS ─── */
.verify-code-wrap {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 24px;
}
.code-digit {
  width: 46px; height: 54px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid rgba(168,85,247,0.2);
  border-radius: 10px;
  color: #f1eeff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem; font-weight: 700;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  caret-color: var(--purple);
}
.code-digit:focus {
  border-color: rgba(168,85,247,0.6);
  background: rgba(168,85,247,0.06);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.12);
}
.code-digit:not(:placeholder-shown) {
  border-color: rgba(168,85,247,0.4);
  background: rgba(168,85,247,0.05);
}

/* ─── CODE SHAKE ANIMATION ─── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.verify-code-wrap.shake {
  animation: shake 0.45s cubic-bezier(0.36,0.07,0.19,0.97) both;
}
.verify-code-wrap.shake .code-digit {
  border-color: rgba(248,113,113,0.5);
}

@media (max-width: 380px) {
  .code-digit { width: 38px; height: 46px; font-size: 1.2rem; }
  .verify-code-wrap { gap: 5px; }
}
