/* ===== God Pixels - Main Styles ===== */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;900&family=Nunito:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #7B2FBE;
  --primary-light: #9B59D6;
  --primary-dark: #5A1F8A;
  --accent: #A855F7;
  --accent-glow: rgba(168, 85, 247, 0.4);
  --pink-accent: #EC4899;
  --gold: #F59E0B;
  --bg-dark: #0F0A1E;
  --bg-card: rgba(255,255,255,0.97);
  --bg-modal: #F3F0FF;
  --text-dark: #1A1035;
  --text-mid: #4B3B6B;
  --text-muted: #8B7AA8;
  --border: rgba(123,47,190,0.2);
  --shadow-glow: 0 0 40px rgba(168,85,247,0.25);
  --shadow-card: 0 20px 60px rgba(0,0,0,0.15);
  --radius: 20px;
  --radius-sm: 12px;
  --font-display: 'Cinzel', serif;
  --font-body: 'Nunito', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at 20% 20%, rgba(123,47,190,0.3) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 80%, rgba(168,85,247,0.2) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, rgba(236,72,153,0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Pixel sparkle animation */
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px var(--accent-glow); }
  50% { box-shadow: 0 0 40px rgba(168,85,247,0.6), 0 0 80px rgba(168,85,247,0.3); }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== LAYOUT ===== */
.app-container { position: relative; z-index: 1; }
.page { display: none; min-height: 100vh; }
.page.active { display: block; animation: fadeInUp 0.4s ease; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== MODAL OVERLAY ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,5,25,0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeInUp 0.3s ease;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px 32px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  animation: fadeInUp 0.4s ease;
}

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border: 2px solid #DDD; border-radius: 50%;
  background: #F5F5F5; cursor: pointer;
  font-size: 16px; color: #888;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: #eee; color: #333; }

.modal-icon {
  text-align: center; margin-bottom: 20px;
}
.modal-icon img, .modal-icon .pixel-lock {
  width: 100px; height: 100px; object-fit: contain;
}
.pixel-lock {
  font-size: 72px; display: inline-block;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 16px var(--accent-glow));
}

.modal-title {
  text-align: center; margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 22px; font-weight: 700; color: var(--text-dark);
}
.modal-title span { color: var(--primary); }
.modal-subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }

/* ===== FORM ELEMENTS ===== */
.form-group { margin-bottom: 14px; position: relative; }
.form-input {
  width: 100%; padding: 14px 16px 14px 44px;
  border: 1.5px solid #E5E0F0;
  border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 15px;
  color: var(--text-dark); background: #FAFAFE;
  outline: none; transition: all 0.2s;
}
.form-input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(123,47,190,0.1); }
.form-input::placeholder { color: var(--text-muted); }
.input-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); font-size: 16px;
}
.input-eye {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); cursor: pointer; color: var(--text-muted); font-size: 16px;
}
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--text-mid); margin-bottom: 6px; }
.form-select {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid #E5E0F0; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 15px;
  color: var(--text-dark); background: #FAFAFE;
  outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238B7AA8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}

.forgot-link {
  text-align: right; margin-top: -8px; margin-bottom: 12px;
  font-size: 13px;
}
.link { color: var(--primary); cursor: pointer; text-decoration: underline; font-weight: 600; }
.link:hover { color: var(--primary-dark); }

/* ===== BUTTONS ===== */
.btn {
  width: 100%; padding: 15px 24px;
  border: none; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all 0.25s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(123,47,190,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(123,47,190,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: rgba(123,47,190,0.08); }
.btn-gold {
  background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
  color: #fff; box-shadow: 0 4px 20px rgba(245,158,11,0.4);
}
.btn-pay {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--pink-accent) 100%);
  color: #fff; box-shadow: 0 4px 20px rgba(123,47,190,0.4);
  animation: pulse-glow 2s ease-in-out infinite;
}
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; border-radius: 8px; }

.divider-or {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0; color: var(--text-muted); font-size: 13px;
}
.divider-or::before, .divider-or::after {
  content: ''; flex: 1; height: 1px; background: #E5E0F0;
}

.auth-footer { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 14px; display: none;
}
.alert.show { display: block; animation: fadeInUp 0.3s ease; }
.alert-error { background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA; }
.alert-success { background: #D1FAE5; color: #059669; border: 1px solid #A7F3D0; }
.alert-info { background: #EDE9FF; color: var(--primary); border: 1px solid #C4B5FD; }

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(10,5,25,0.7); backdrop-filter: blur(4px);
  z-index: 9999; display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
.loading-overlay.show { display: flex; }
.loading-text { color: #fff; font-size: 16px; font-family: var(--font-body); }

/* ===== PIXEL GRID VISUAL ===== */
.pixel-grid-art {
  display: grid; grid-template-columns: repeat(10, 1fr);
  gap: 3px; width: 120px; margin: 0 auto;
}
.pixel-cell {
  width: 10px; height: 10px; border-radius: 2px;
  background: var(--primary-light); opacity: 0.7;
  animation: sparkle 2s ease-in-out infinite;
}
.pixel-cell:nth-child(odd) { animation-delay: 0.3s; }
.pixel-cell:nth-child(3n) { background: var(--accent); }

/* ===== TAGS ===== */
.badge {
  display: inline-block; padding: 4px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
}
.badge-purple { background: rgba(123,47,190,0.1); color: var(--primary); }
.badge-gold { background: rgba(245,158,11,0.15); color: #D97706; }
.badge-green { background: #D1FAE5; color: #059669; }
.badge-pink { background: rgba(236,72,153,0.1); color: var(--pink-accent); }

/* ===== TOAST ===== */
#toast {
  position: fixed; bottom: 30px; right: 30px;
  background: var(--primary); color: #fff;
  padding: 14px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-glow);
  z-index: 9999; display: none;
  animation: fadeInUp 0.3s ease;
}
#toast.show { display: block; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1A0D35; }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .modal-card { padding: 28px 20px; }
  .container { padding: 0 16px; }
}
