/* ════════════════════════════════════════════════════════
   AUTH.CSS v2 — Dark Space Theme (Login / Register)
   Reference: dark purple/space bg + glowing portal
════════════════════════════════════════════════════════ */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

/* ── Page ────────────────────────────────────────────── */
.auth-body {
  min-height: 100vh;
  background: #0b0c14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 16px 60px;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #f0f2f8;
  position: relative;
  overflow: hidden;
}

/* ── Background layers ──────────────────────────────── */
/* Deep radial glow top */
.auth-body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 50% -10%, rgba(108,92,231,.28) 0%, transparent 65%),
    radial-gradient(ellipse 60% 40% at 20% 30%, rgba(90,70,200,.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 20%, rgba(162,155,254,.06) 0%, transparent 60%),
    #0b0c14;
}
/* Ground / horizon glow */
.auth-body::after {
  content: '';
  position: fixed; left: 0; right: 0; bottom: 0; height: 45vh;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(108,92,231,.55) 0%, rgba(60,40,180,.18) 40%, transparent 70%);
}

/* ── Decorative mountain silhouette ─────────────────── */
.auth-mountains {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1;
  height: 35vh; pointer-events: none; overflow: hidden;
}
.auth-mountains svg { width: 100%; height: 100%; }

/* ── Floating particles ─────────────────────────────── */
.auth-particles {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden;
}
.auth-particle {
  position: absolute; border-radius: 50%;
  background: rgba(162,155,254,.35);
  animation: authFloat linear infinite;
}
@keyframes authFloat {
  0%   { transform: translateY(0) scale(1); opacity: .6; }
  50%  { transform: translateY(-30px) scale(1.1); opacity: .9; }
  100% { transform: translateY(0) scale(1); opacity: .6; }
}

/* ── Decorative lines / grid ────────────────────────── */
.auth-grid-lines {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(108,92,231,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(108,92,231,.04) 1px, transparent 1px);
  background-size: 50px 50px;
}

/* ── Portal glow at bottom ──────────────────────────── */
.auth-portal {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  z-index: 2; pointer-events: none;
  width: 260px; height: 200px;
}
.auth-portal-ring {
  position: absolute; left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: 140px; height: 140px; border-radius: 50%;
  border: 2px solid rgba(162,155,254,.35);
  box-shadow:
    0 0 30px 10px rgba(108,92,231,.5),
    0 0 60px 20px rgba(108,92,231,.25),
    inset 0 0 30px rgba(108,92,231,.3);
  animation: portalPulse 3s ease-in-out infinite;
}
.auth-portal-inner {
  position: absolute; left: 50%; bottom: 6px;
  transform: translateX(-50%);
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle, rgba(162,155,254,.6) 0%, rgba(108,92,231,.4) 40%, transparent 70%);
  animation: portalPulse 3s ease-in-out infinite .3s;
}
@keyframes portalPulse {
  0%,100% { opacity: .7; transform: translateX(-50%) scale(1); }
  50%     { opacity: 1;  transform: translateX(-50%) scale(1.06); }
}

/* ── Topbar ─────────────────────────────────────────── */
.auth-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 56px;
  display: flex; align-items: center; padding: 0 24px;
  background: rgba(11,12,20,.8);
  border-bottom: 1px solid rgba(255,255,255,.06);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.auth-topbar-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 900; font-size: 1rem;
}
.auth-topbar-logo {
  width: 30px; height: 30px; border-radius: 8px; overflow: hidden;
  background: rgba(108,92,231,.15); border: 1.5px solid rgba(108,92,231,.35);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.auth-topbar-logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-topbar-brand .bp1 { color: #fff; }
.auth-topbar-brand .bp2 { color: #a29bfe; }
.auth-topbar-links { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.auth-topbar-links a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 10px;
  font-size: .82rem; font-weight: 700;
  color: rgba(240,242,248,.55); text-decoration: none;
  border: 1px solid transparent; transition: all .2s;
}
.auth-topbar-links a:hover { color: #e8eaf0; background: rgba(255,255,255,.06); }
.auth-topbar-links a.atcta {
  color: #a29bfe; background: rgba(108,92,231,.14); border-color: rgba(108,92,231,.32);
}
.auth-topbar-links a.atcta:hover { background: rgba(108,92,231,.22); }

/* ── Main wrap ──────────────────────────────────────── */
.auth-wrap {
  position: relative; z-index: 10;
  width: 100%; max-width: 440px;
  animation: authFadeUp .45s cubic-bezier(.34,1.12,.64,1) both;
}
@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(28px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Card ───────────────────────────────────────────── */
.auth-card {
  background: rgba(19,21,31,.92);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 28px;
  padding: 36px 34px 32px;
  width: 100%;
  box-shadow:
    0 0 0 1px rgba(108,92,231,.1),
    0 40px 80px rgba(0,0,0,.7),
    0 2px 40px rgba(108,92,231,.08),
    inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: blur(24px);
  position: relative; overflow: hidden;
}
/* top shimmer line */
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 15%; right: 15%;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(108,92,231,.8), rgba(162,155,254,.6), transparent);
}

/* ── Logo area ──────────────────────────────────────── */
.auth-logo-area { text-align: center; margin-bottom: 22px; }
.auth-logo {
  width: 72px; height: 72px; border-radius: 22px; overflow: hidden;
  margin: 0 auto 12px;
  background: linear-gradient(135deg,#1a1d2e,#0b0c14);
  border: 2px solid rgba(108,92,231,.4);
  box-shadow: 0 0 32px rgba(108,92,231,.35), 0 4px 24px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
}
.auth-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-logo i { font-size: 2rem; color: #a29bfe; }
.auth-sitename {
  font-size: 1.1rem; font-weight: 900;
  background: linear-gradient(135deg, #fff 30%, #a29bfe);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.01em;
}
.auth-site-sub { font-size: .78rem; color: rgba(240,242,248,.4); margin-top: 2px; }

/* ── Heading ────────────────────────────────────────── */
.auth-title {
  font-size: 1.55rem; font-weight: 900; text-align: center;
  margin-bottom: 5px;
  background: linear-gradient(135deg, #f0f2f8 40%, #a29bfe 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.02em;
}
.auth-sub {
  font-size: .84rem; color: rgba(240,242,248,.42);
  text-align: center; margin-bottom: 24px; line-height: 1.5;
}
.auth-sub strong, .auth-sub .sitename { color: #a29bfe; font-weight: 700; }

/* ── Alerts ─────────────────────────────────────────── */
.auth-alert {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 12px 14px; border-radius: 12px; font-size: .83rem;
  margin-bottom: 18px; line-height: 1.4; font-weight: 600;
}
.auth-alert i { margin-top: 1px; flex-shrink: 0; font-size: .85rem; }
.auth-alert-error  { background: rgba(255,82,82,.1);  border: 1px solid rgba(255,82,82,.3);  color: #ff8a80; }
.auth-alert-success{ background: rgba(0,230,118,.1);  border: 1px solid rgba(0,230,118,.3);  color: #69f0ae; }

/* ── Field ──────────────────────────────────────────── */
.auth-field { margin-bottom: 14px; }
.auth-field-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
}
.auth-label { font-size: .78rem; font-weight: 700; color: rgba(240,242,248,.7); }
.auth-label-hint { font-size: .72rem; color: rgba(240,242,248,.3); }
.auth-input-wrap {
  position: relative; display: flex; align-items: center;
}
.auth-input-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: rgba(240,242,248,.3); font-size: .82rem; pointer-events: none; z-index: 1;
}
.auth-input {
  width: 100%; padding: 12px 14px 12px 38px;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 12px;
  color: #f0f2f8; font-size: .88rem; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
  -webkit-appearance: none;
}
.auth-input::placeholder { color: rgba(240,242,248,.28); }
.auth-input:focus {
  border-color: rgba(108,92,231,.7);
  background: rgba(108,92,231,.07);
  box-shadow: 0 0 0 3px rgba(108,92,231,.2);
}
.auth-input.has-eye { padding-right: 44px; }

/* Eye toggle */
.auth-eye-btn {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: rgba(240,242,248,.35); font-size: .88rem;
  padding: 4px; line-height: 1; transition: color .15s;
  z-index: 1;
}
.auth-eye-btn:hover { color: #a29bfe; }

/* Forgot */
.auth-forgot { text-align: right; margin: -6px 0 14px; }
.auth-forgot a {
  font-size: .78rem; font-weight: 700;
  color: #a29bfe; text-decoration: none;
  transition: color .15s;
}
.auth-forgot a:hover { color: #c4b5fd; }

/* ── Terms checkbox ─────────────────────────────────── */
.auth-terms {
  display: flex; align-items: flex-start; gap: 9px;
  margin-bottom: 16px; cursor: pointer;
}
.auth-terms input[type=checkbox] {
  width: 17px; height: 17px; accent-color: #6c5ce7;
  cursor: pointer; flex-shrink: 0; margin-top: 1px;
}
.auth-terms-lbl {
  font-size: .79rem; color: rgba(240,242,248,.5); line-height: 1.45;
}
.auth-terms-lbl a { color: #a29bfe; text-decoration: none; }
.auth-terms-lbl a:hover { text-decoration: underline; }

/* ── Submit button ──────────────────────────────────── */
.auth-btn {
  width: 100%; padding: 13.5px 20px;
  border-radius: 14px; border: none; cursor: pointer;
  font-size: .95rem; font-weight: 800; letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(135deg, #6c5ce7 0%, #8b7cf8 50%, #a29bfe 100%);
  box-shadow: 0 4px 24px rgba(108,92,231,.55), 0 1px 0 rgba(255,255,255,.15) inset;
  transition: transform .18s, box-shadow .18s, opacity .18s;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  position: relative; overflow: hidden;
}
.auth-btn::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg,transparent 35%,rgba(255,255,255,.15) 50%,transparent 65%);
  transform: translateX(-100%);
  transition: transform .5s ease;
  pointer-events: none;
}
.auth-btn:hover::after { transform: translateX(100%); }
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(108,92,231,.65); opacity: .95; }
.auth-btn:active { transform: translateY(0); box-shadow: 0 2px 12px rgba(108,92,231,.4); }
.auth-btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* ── Divider ────────────────────────────────────────── */
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0;
  color: rgba(240,242,248,.25); font-size: .78rem;
}
.auth-divider::before,.auth-divider::after {
  content: ''; flex: 1;
  height: 1px; background: rgba(255,255,255,.1);
}

/* ── Google button ──────────────────────────────────── */
.auth-google-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: 14px;
  color: #e8eaf0; font-size: .9rem; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: background .18s, border-color .18s, transform .18s, box-shadow .18s;
  letter-spacing: .01em;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.auth-google-btn:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.28);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.auth-google-btn:active { transform: translateY(0); }
/* Google G icon */
.auth-google-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem;
}
.auth-google-icon img { width: 16px; height: 16px; }

/* ── Security note ──────────────────────────────────── */
.auth-security-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 14px;
  font-size: .74rem; color: rgba(240,242,248,.28);
}
.auth-security-note i { color: rgba(108,92,231,.7); font-size: .78rem; }

/* ── Switch link ────────────────────────────────────── */
.auth-switch {
  margin-top: 18px; text-align: center;
  font-size: .82rem; color: rgba(240,242,248,.4);
}
.auth-switch a {
  color: #a29bfe; font-weight: 700; text-decoration: none;
}
.auth-switch a:hover { color: #c4b5fd; text-decoration: underline; }

/* ── Strength bar ───────────────────────────────────── */
.pw-strength-wrap { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
#pwStrength {
  flex: 1; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,.08); overflow: hidden;
}
#pwStrengthBar { height: 100%; width: 0; border-radius: 4px; transition: width .3s, background .3s; }
.pw-strength-label { font-size: .7rem; font-weight: 700; min-width: 64px; }

/* ── Captcha box ────────────────────────────────────── */
.captcha-box {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(108,92,231,.06);
  border: 1.5px solid rgba(108,92,231,.22);
  border-radius: 16px; padding: 16px 18px 14px;
}
.captcha-question { display: flex; align-items: center; gap: 10px; justify-content: center; }
.captcha-nums { font-size: 1.7rem; font-weight: 900; color: #f0f2f8; font-family: monospace; }
.captcha-op { font-size: 1.5rem; font-weight: 900; color: #a29bfe; min-width: 20px; text-align: center; }
.captcha-eq { font-size: 1.4rem; font-weight: 800; color: rgba(240,242,248,.4); }
.captcha-mark { font-size: 1.7rem; font-weight: 900; color: #00e676; animation: captchaPulse 1.4s ease-in-out infinite; }
@keyframes captchaPulse { 0%,100% { opacity:1;transform:scale(1); } 50% { opacity:.6;transform:scale(1.15); } }
.captcha-hint { font-size: .72rem; min-height: 14px; text-align: center; font-weight: 600; }
.captcha-refresh-btn {
  background: rgba(108,92,231,.1); border: 1px solid rgba(108,92,231,.25);
  color: #a29bfe; padding: 5px 12px; border-radius: 8px;
  font-size: .75rem; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
}
.captcha-refresh-btn:hover { background: rgba(108,92,231,.2); }

/* ── Google sign-in loading overlay ─────────────────── */
.auth-google-loading {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(11,12,20,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  animation: authFadeIn .2s ease;
}
@keyframes authFadeIn { from{opacity:0} to{opacity:1} }
.auth-google-loading-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(108,92,231,.15); border: 2px solid rgba(108,92,231,.4);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: #a29bfe;
  animation: authSpin 1s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }
.auth-google-loading p { color: rgba(240,242,248,.6); font-size: .88rem; }

/* ── Responsive ─────────────────────────────────────── */
@media(max-width:480px) {
  .auth-body { padding: 70px 12px 40px; }
  .auth-card { padding: 28px 20px 24px; border-radius: 22px; }
  .auth-title { font-size: 1.35rem; }
  .auth-topbar-links a span { display: none; }
}
