@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Prompt:wght@400;500;600;700&display=swap');

/* =============================================
   Premium CSS Variables & Reset
   ============================================= */
:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121c;
  --bg-card: rgba(20, 20, 30, 0.4);
  
  /* Gold/Elegance Theme */
  --accent: #d4af37;
  --accent-light: #f3e5ab;
  --accent-dark: #aa8529;
  --accent-gradient: linear-gradient(135deg, #f3e5ab 0%, #d4af37 50%, #aa8529 100%);
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-glow: 0 0 30px rgba(212, 175, 55, 0.15);
  --shadow-card: 0 10px 40px -10px rgba(0, 0, 0, 0.7);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Prompt', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(212, 175, 55, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(212, 175, 55, 0.06) 0%, transparent 40%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

/* Add a subtle animated grain overlay */
body::before {
  content: "";
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url('data:image/svg+xml;utf8,%3Csvg viewBox=%220 0 200 200%22 xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cfilter id=%22noiseFilter%22%3E%3CfeTurbulence type=%22fractalNoise%22 baseFrequency=%220.65%22 numOctaves=%223%22 stitchTiles=%22stitch%22/%3E%3C/filter%3E%3Crect width=%22100%25%22 height=%22100%25%22 filter=%22url(%23noiseFilter)%22 opacity=%220.03%22/%3E%3C/svg%3E');
  pointer-events: none;
  z-index: 9999;
}

/* =============================================
   Layout & Animations
   ============================================= */
.container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.hidden { display: none !important; }

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

/* =============================================
   Premium Glassmorphism Card
   ============================================= */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-highlight);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  position: relative;
  overflow: hidden;
  animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 24px;
  text-align: center;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

/* =============================================
   Brand Logo
   ============================================= */
.brand-logo-wrapper {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.brand-logo {
  max-width: 250px;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.6));
  animation: slideUpFade 0.5s ease-out forwards;
}

/* =============================================
   Hero Section
   ============================================= */
.hero {
  text-align: center;
  padding: 56px 0 40px;
  position: relative;
}

.hero-badge {
  display: inline-flex;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 100px;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
  animation: slideUpFade 0.6s ease-out forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -1px;
  animation: slideUpFade 0.6s ease-out forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.hero-title .highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: var(--accent);
  display: inline-block;
  padding: 0 4px;
  text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
  animation: slideUpFade 0.6s ease-out forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

/* =============================================
   Promo Info Steps
   ============================================= */
.promo-info { margin-bottom: 24px; }

.steps-summary {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.step-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  transition: transform 0.3s ease, background 0.3s ease;
}

.step-item:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.3);
}

.step-number {
  background: var(--accent-gradient);
  color: #000;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  margin-right: 16px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

.step-item p {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.95rem;
}

/* =============================================
   Install Instructions Tabs
   ============================================= */
.section-desc {
  color: var(--text-secondary);
  text-align: center;
  margin-top: -16px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.platform-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  background: rgba(0, 0, 0, 0.2);
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.tab-btn {
  flex: 1;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  padding: 12px 0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.tab-btn:hover { color: var(--text-primary); }

.tab-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tab-content { display: none; }
.tab-content.active {
  display: block;
  animation: slideUpFade 0.4s ease-out forwards;
}

.install-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.install-steps li {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
}

.step-icon {
  font-size: 1.5rem;
  margin-right: 16px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.install-steps li span:last-child {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.install-steps li strong { color: var(--text-primary); }

/* =============================================
   Inputs & Buttons
   ============================================= */
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  padding: 16px 20px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  transition: all 0.3s;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

.btn {
  display: block;
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #000;
  padding: 16px 20px;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:not(:disabled) {
  animation: pulseGlow 2s infinite;
}

.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  20% { left: 200%; }
  100% { left: 200%; }
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  animation: none !important;
}

/* =============================================
   Alert & Messages
   ============================================= */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-top: 24px;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideUpFade 0.3s ease-out;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* =============================================
   Spinners
   ============================================= */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  border-top-color: #000;
  animation: spin 1s ease-in-out infinite;
  display: none;
}

#btn-text.loading + .spinner {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
}

#btn-text.loading {
  display: none;
}

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

/* =============================================
   FAQ & Debug
   ============================================= */
.faq-section {
  margin-top: 40px;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

.faq-title {
  text-align: center;
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-weight: 600;
}

.accordion-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
  transition: background 0.3s;
}

.accordion-header {
  width: 100%;
  background: transparent;
  border: none;
  padding: 18px 20px;
  text-align: left;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: inherit;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.icon-arrow {
  transition: transform 0.3s ease;
  font-size: 0.8rem;
  color: var(--accent);
}

.accordion-item.active .icon-arrow {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

.accordion-item.active .accordion-content {
  padding: 0 20px 18px;
}

.debug-info {
  margin-top: 40px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: monospace;
  overflow-x: auto;
}

/* =============================================
   PWA Installation Banner (Optional generic state)
   ============================================= */
.install-banner {
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.2);
}

/* =============================================
   Full-screen Loading Overlay
   ============================================= */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-overlay.hidden {
  display: none !important;
}

.loading-content {
  text-align: center;
  animation: slideUpFade 0.4s ease-out;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(212, 175, 55, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}

.loading-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 500;
}

/* =============================================
   Result Message States
   ============================================= */
.result-message {
  padding: 20px;
  border-radius: var(--radius-sm);
  margin-top: 24px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.6;
  text-align: center;
  animation: slideUpFade 0.4s ease-out;
}

.result-message.eligible {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.result-message.not_found {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.result-message.insufficient_deposit {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
}

.result-message.already_claimed {
  background: rgba(100, 116, 139, 0.1);
  border: 1px solid rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}

.result-message.checking {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

.result-message.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* =============================================
   Form Helper & Error Text
   ============================================= */
.helper-text {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.error-text {
  display: block;
  font-size: 0.85rem;
  color: var(--error);
  margin-top: 6px;
  font-weight: 500;
}

.input-error {
  border-color: var(--error) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

/* =============================================
   Claim Button
   ============================================= */
.btn-claim {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 16px 20px;
  background: var(--accent-gradient);
  color: #000;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn-claim:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-claim:active {
  transform: translateY(0);
}

.btn-claim:not(:disabled) {
  animation: pulseGlow 2s infinite;
}

.btn-claim::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  animation: shimmer 3s infinite;
}

.btn-claim:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  animation: none !important;
}

.loader {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(0, 0, 0, 0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* =============================================
   Debug Panel
   ============================================= */
.debug-panel {
  margin-top: 40px;
  margin-bottom: 20px;
}

.debug-panel details {
  background: rgba(0, 0, 0, 0.3);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.debug-panel summary {
  padding: 12px 16px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.debug-content {
  padding: 0 16px 16px;
}

.debug-row {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.75rem;
  font-family: monospace;
  color: var(--text-muted);
  word-break: break-all;
}

.debug-label {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--text-secondary);
}

/* =============================================
   FAQ Item
   ============================================= */
.faq-item {
  border-bottom: 1px solid var(--glass-border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: 16px 0;
  text-align: left;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  max-height: 200px;
  padding-bottom: 16px;
}

/* =============================================
   Footer
   ============================================= */
.footer {
  padding-bottom: 24px;
}
