:root {
  --primary: #5c3cfc;
  --primary-hover: #4a2fe0;
  --accent: #f97316;
  --accent-hover: #ea580c;
  --nav-bg: #1e1338;
  --card-bg: #ffffff;
  --bg: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --danger: #ef4444;
  --radius: 16px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--bg);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR */
.navbar {
  background: var(--nav-bg);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
}

.nav-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.brand-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-text span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a:hover, .nav-links a.active {
  color: #fff;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.balance-badge {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #38bdf8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.2s;
}

.balance-badge:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-topup {
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  transition: background 0.2s, transform 0.1s;
}

.btn-topup:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* CONTAINER */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px 80px;
  flex: 1;
  width: 100%;
}

/* BANNER */
.promo-banner {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: white;
  border-radius: var(--radius);
  padding: 24px 30px;
  margin-bottom: 35px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.25);
  position: relative;
  overflow: hidden;
}

.promo-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.promo-content p {
  color: #e0e7ff;
  font-size: 0.95rem;
}

.countdown-box {
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  padding: 12px 20px;
  border-radius: 14px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.countdown-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.countdown-timer {
  font-family: monospace;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fbbf24;
}

/* SECTION HEADER */
.section-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-header h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* PRODUCT GRID */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.08);
}

.card-top {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  padding: 24px 20px;
  text-align: center;
  position: relative;
}

.card-top.vip {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  backdrop-filter: blur(4px);
}

.card-category-title {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 10px 0 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.35;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.4;
  flex: 1;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

.stock-tag {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 4px;
}

.price-box {
  text-align: right;
}

.old-price {
  font-size: 0.8rem;
  color: #94a3b8;
  text-decoration: line-through;
}

.current-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--accent);
}

.btn-buy {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s, transform 0.1s;
}

.btn-buy:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* HOW IT WORKS */
.steps-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 30px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-top: 20px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.step-num {
  width: 36px;
  height: 36px;
  background: #ede9fe;
  color: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.step-item h4 {
  font-size: 1rem;
  font-weight: 700;
}

.step-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  padding: 28px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
}

.close-modal {
  background: #f1f5f9;
  border: none;
  font-size: 1.4rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
}

.close-modal:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* FORM ELEMENTS */
.form-group {
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(92, 60, 252, 0.15);
}

/* PROGRESS ANIMATION */
.loading-box {
  text-align: center;
  padding: 30px 10px;
  display: none;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #ede9fe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-step {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.loading-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* FLOATING TELEGRAM BUTTON */
.floating-tg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  background: #25a3e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 10px 25px rgba(37, 163, 226, 0.4);
  z-index: 1000;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.floating-tg:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 30px rgba(37, 163, 226, 0.55);
}

.floating-tg svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

/* TOAST */
.toast-box {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: none;
  z-index: 3000;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .promo-banner {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* USER PILL & AUTH STYLES */
.user-pill {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: monospace;
  color: #f8fafc;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.user-pill:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: #ef4444;
  color: #fff;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.auth-tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: #f1f5f9;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
}

.auth-tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(92, 60, 252, 0.2);
}

.user-id-banner {
  background: linear-gradient(135deg, #1e1338 0%, #2b1055 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.user-id-val {
  font-family: monospace;
  font-size: 1.6rem;
  font-weight: 900;
  color: #38bdf8;
  letter-spacing: 1px;
}

/* FAQ & GUIDE ACCORDION */
.faq-section {
  background: #fff;
  border-radius: var(--radius);
  padding: 30px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-top: 25px;
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.faq-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.faq-item:hover {
  border-color: #cbd5e1;
}

.faq-item.active {
  border-color: #c7d2fe;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.06);
}

.faq-question {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  text-align: left;
  font-size: 0.98rem;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  outline: none;
  transition: color 0.2s;
  font-family: inherit;
}

.faq-question:hover {
  color: var(--primary);
}

.faq-icon {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  transition: transform 0.3s ease;
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: #ef4444;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-out;
  padding: 0 20px;
  color: #475569;
  font-size: 0.93rem;
  line-height: 1.6;
}

.faq-item.active .faq-answer {
  max-height: 500px;
  padding-bottom: 18px;
}
