/* ============================================================
   login.css — xWildChat Login Screen
   Matches dashboard dark-purple aesthetic exactly
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ── RESET & VARIABLES (mirrors dashboard.css) ────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:    #040404;
  --sur:   #121212;
  --sur2:  #1e1e1e;
  --bdr:   rgba(246,48,144,0.15);
  --acc:   #f63090;
  --acc2:  #f95faa;
  --grn:   #10b981;
  --red:   #ef4444;
  --gold:  #f59e0b;
  --txt:   #f8f8f8;
  --mut:   #8e8e8e;
  --pink:  #f979b7;
  --font:  'Outfit', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-y: auto;
}

/* ── BACKGROUND EFFECTS ───────────────────────────────────── */
.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-bg-grid {
  position: absolute;
  inset: -50%;
  width: 200%; height: 200%;
  background-image:
    linear-gradient(rgba(246,48,144,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246,48,144,0.03) 1px, transparent 1px);
  background-size: 55px 55px;
  animation: gridDrift 35s linear infinite;
}
@keyframes gridDrift { to { transform: translate(55px, 55px); } }

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.3;
}
.login-bg-orb:nth-child(2) {
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(224,25,121,0.5), transparent 70%);
  top: -15%; right: -8%;
  animation: orbA 22s ease-in-out infinite alternate;
}
.login-bg-orb:nth-child(3) {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(246,48,144,0.45), transparent 70%);
  bottom: -10%; left: -10%;
  animation: orbA 18s ease-in-out infinite alternate-reverse;
}
.login-bg-orb:nth-child(4) {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(244,114,182,0.3), transparent 70%);
  top: 40%; left: 50%;
  animation: orbA 26s ease-in-out infinite alternate;
  opacity: 0.18;
}
@keyframes orbA {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(25px, -18px) scale(1.06); }
  100% { transform: translate(-15px, 12px) scale(0.96); }
}

.login-particles { position: absolute; inset: 0; }
.login-particle {
  position: absolute;
  width: 2.5px; height: 2.5px;
  background: #e01979;
  border-radius: 50%;
  opacity: 0;
  animation: pRise linear infinite;
}
.login-particle:nth-child(1)  { left: 10%; animation-duration: 11s; animation-delay: 0s; }
.login-particle:nth-child(2)  { left: 22%; animation-duration: 13s; animation-delay: 2s; }
.login-particle:nth-child(3)  { left: 35%; animation-duration: 10s; animation-delay: 4s; }
.login-particle:nth-child(4)  { left: 48%; animation-duration: 14s; animation-delay: 1s; }
.login-particle:nth-child(5)  { left: 60%; animation-duration: 12s; animation-delay: 3s; }
.login-particle:nth-child(6)  { left: 74%; animation-duration: 9s;  animation-delay: 5s; }
.login-particle:nth-child(7)  { left: 85%; animation-duration: 15s; animation-delay: 2s; }
.login-particle:nth-child(8)  { left: 42%; animation-duration: 11s; animation-delay: 6s; }

@keyframes pRise {
  0%   { bottom: -4%; opacity: 0; transform: translateX(0); }
  12%  { opacity: 0.5; }
  88%  { opacity: 0.2; }
  100% { bottom: 105%; opacity: 0; transform: translateX(20px); }
}

/* ── MAIN LAYOUT ──────────────────────────────────────────── */
.login-screen {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 28px 20px;
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── BRAND AREA ───────────────────────────────────────────── */
.login-brand {
  text-align: center;
  margin-bottom: 28px;
  animation: fadeIn 0.55s 0.12s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.login-logo-img {
  height: 46px;
  border-radius: 12px;
  filter: drop-shadow(0 4px 16px rgba(224,25,121,0.3));
}
.login-logo-text {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.8px;
}
.login-logo-text span {
  background: linear-gradient(135deg, #e01979, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-tagline {
  font-size: 12px;
  color: var(--mut);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── LOGIN CARD ───────────────────────────────────────────── */
.login-card {
  background: var(--sur);
  border: 1px solid var(--bdr);
  border-radius: 20px;
  padding: 32px 28px 26px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 20px 50px rgba(0,0,0,0.45),
    0 0 0 1px rgba(246,48,144,0.06) inset;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, #f63090, #e01979, #f472b6);
  opacity: 0.8;
}

/* ── HEADER ───────────────────────────────────────────────── */
.login-header { margin-bottom: 24px; }
.login-title {
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--mut);
  font-weight: 400;
}

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

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mut);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}
.login-label-icon { font-size: 13px; opacity: 0.8; }

/* ── INPUT ────────────────────────────────────────────────── */
.login-input-wrap { position: relative; }

.login-input {
  width: 100%;
  padding: 13px 15px;
  background: var(--sur2);
  border: 1.5px solid var(--bdr);
  border-radius: 12px;
  color: var(--txt);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input::placeholder {
  color: rgba(142,142,142,0.45);
  font-weight: 400;
}
.login-input:focus {
  border-color: rgba(224,25,121,0.5);
  box-shadow:
    0 0 0 3px rgba(224,25,121,0.08),
    0 0 18px rgba(224,25,121,0.06);
}

.login-input-glow {
  position: absolute; inset: 0;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
  background: linear-gradient(135deg, rgba(224,25,121,0.04), rgba(246,48,144,0.04));
}
.login-input:focus ~ .login-input-glow { opacity: 1; }

/* ── PASSWORD TOGGLE ──────────────────────────────────────── */
.login-pw-toggle {
  position: absolute;
  right: 13px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none;
  color: var(--mut);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  transition: color 0.2s;
  line-height: 1;
}
.login-pw-toggle:hover { color: var(--pink); }

/* ── ERROR ────────────────────────────────────────────────── */
.login-field.has-error .login-input {
  border-color: rgba(239,68,68,0.5);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.08);
}

.login-error {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 10px 13px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.18);
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: #f87171;
  animation: shake 0.4s ease;
}
.login-error.show { display: flex; }
.login-error-icon { font-size: 14px; flex-shrink: 0; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(3px); }
}

/* ── OPTIONS ROW ──────────────────────────────────────────── */
.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.login-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mut);
  cursor: pointer;
  user-select: none;
}
.login-remember input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--acc);
  cursor: pointer;
}
.login-forgot {
  font-size: 12px;
  color: #fa8bc1;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.login-forgot:hover { color: #fc84be; }

/* ── SUBMIT BUTTON ────────────────────────────────────────── */
.login-btn {
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 13px;
  background: linear-gradient(135deg, #f63090 0%, #e01979 50%, #f472b6 100%);
  background-size: 200% 200%;
  color: #fff;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s, box-shadow 0.2s, background-position 0.4s;
  box-shadow: 0 4px 20px rgba(246,48,144,0.25);
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}
.login-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(246,48,144,0.35);
  background-position: 100% 50%;
}
.login-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(246,48,144,0.2);
}
.login-btn-arrow {
  transition: transform 0.2s;
  font-size: 17px;
}
.login-btn:hover .login-btn-arrow { transform: translateX(4px); }

/* Loading */
.login-btn.loading { pointer-events: none; opacity: 0.8; }
.login-btn.loading .login-btn-text,
.login-btn.loading .login-btn-arrow { visibility: hidden; }
.login-btn.loading::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── DIVIDER ──────────────────────────────────────────────── */
.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1; height: 1px;
  background: rgba(246,48,144,0.12);
}
.login-divider span {
  font-size: 10.5px;
  color: rgba(142,142,142,0.45);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ── SOCIAL BUTTONS ───────────────────────────────────────── */
.login-socials {
  display: flex;
  gap: 8px;
}
.login-social {
  flex: 1;
  padding: 10px 8px;
  background: rgba(8,8,8,0.5);
  border: 1px solid var(--bdr);
  border-radius: 10px;
  color: var(--mut);
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.18s;
}
.login-social:hover {
  border-color: rgba(246,48,144,0.3);
  background: rgba(246,48,144,0.06);
  color: var(--txt);
}
.login-social svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════════
   OFFER WALL PREVIEW (sidebar-style widget on login page)
   Matches the sidebar "Earn Sparks" section exactly
   ══════════════════════════════════════════════════════════════ */
.login-offers {
  margin-top: 22px;
  background: var(--sur);
  border: 1px solid rgba(16,185,129,0.18);
  border-radius: 16px;
  padding: 16px 18px 14px;
  animation: fadeIn 0.6s 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.login-offers-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--grn);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-offer-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-offer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 10px;
  transition: background 0.15s;
}
.login-offer-item:hover {
  background: rgba(255,255,255,0.03);
}

.login-offer-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.06);
}

.login-offer-info {
  flex: 1;
  min-width: 0;
}
.login-offer-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--txt);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.login-offer-cat {
  font-size: 10.5px;
  color: var(--mut);
  margin-top: 1px;
}

.login-offer-sparks {
  font-size: 13px;
  font-weight: 800;
  color: var(--grn);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}
.login-offer-sparks .sparkle { font-size: 11px; }

.login-offers-cta {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 9px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.22);
  border-radius: 10px;
  color: var(--grn);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
  letter-spacing: 0.2px;
}
.login-offers-cta:hover {
  background: rgba(16,185,129,0.2);
}

/* ── CARD FOOTER ──────────────────────────────────────────── */
.login-footer {
  text-align: center;
  padding-top: 18px;
  margin-top: 6px;
  border-top: 1px solid rgba(246,48,144,0.08);
  font-size: 12.5px;
  color: var(--mut);
}
.login-footer a {
  color: #fa8bc1;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
}
.login-footer a:hover { color: #fc84be; }

/* ── BOTTOM META ──────────────────────────────────────────── */
.login-meta {
  margin-top: 18px;
  text-align: center;
  font-size: 10.5px;
  color: rgba(142,142,142,0.35);
  animation: fadeIn 0.7s 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
  letter-spacing: 0.3px;
}
.login-meta a {
  color: rgba(250,139,193,0.45);
  text-decoration: none;
}
.login-meta a:hover { color: #fa8bc1; }

/* ── SUCCESS STATE ────────────────────────────────────────── */
.login-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 28px 0 8px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}
.login-success.show { display: flex; }

.login-success-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(16,185,129,0.12);
  border: 2px solid rgba(16,185,129,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  animation: pop 0.5s ease;
}
@keyframes pop {
  0%   { transform: scale(0.5); opacity: 0; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}

.login-success-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--grn);
}
.login-success-sub {
  font-size: 12.5px;
  color: var(--mut);
}
.login-success-bar {
  width: 100%;
  height: 4px;
  background: rgba(16,185,129,0.12);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}
.login-success-bar-fill {
  height: 100%;
  background: var(--grn);
  border-radius: 4px;
  animation: barFill 2s ease-out forwards;
}
@keyframes barFill { from { width: 0; } to { width: 100%; } }

/* ── SCROLLBAR (match dashboard) ──────────────────────────── */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgba(246,48,144,.2); border-radius: 4px; }

/* ── RESPONSIVE ───────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-screen { padding: 16px 14px; }
  .login-card { padding: 26px 20px 22px; border-radius: 16px; }
  .login-title { font-size: 19px; }
  .login-btn { padding: 13px 16px; }
  .login-socials { flex-direction: column; }
  .login-logo-text { font-size: 22px; }
  .login-logo-img { height: 38px; }
  .login-offers { padding: 14px 14px 12px; }
}