@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,600;0,700;0,800;1,600&display=swap');

*, *::before, *::after { box-sizing: border-box; }
body { 
  margin: 0; padding: 0; 
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%); 
  font-family: 'Inter', sans-serif; 
  -webkit-font-smoothing: antialiased; 
  color: #1f2937; 
  min-height: 100vh;
}
.hidden { display: none !important; }
.text-center { text-align: center; }

.page-wrap { 
  min-height: 100vh; 
  display: flex; flex-direction: column; align-items: center; justify-content: center; 
  padding: 40px 20px; 
  position: relative;
  overflow: hidden;
}

/* Decorative background elements */
.page-wrap::before {
  content: '';
  position: absolute;
  top: -150px; right: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(185, 28, 28, 0.08), transparent 70%);
  filter: blur(40px);
  z-index: 0;
  border-radius: 50%;
}
.page-wrap::after {
  content: '';
  position: absolute;
  bottom: -100px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(30, 58, 138, 0.05), transparent 70%);
  filter: blur(60px);
  z-index: 0;
  border-radius: 50%;
}

.gleam-wrapper { 
  width: 100%; max-width: 650px; 
  background: rgba(255, 255, 255, 0.95); 
  backdrop-filter: blur(10px);
  border-radius: 16px; 
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.05); 
  overflow: hidden; 
  border: 1px solid rgba(255,255,255,0.4); 
  position: relative;
  z-index: 1;
}

/* Hero */
.hero-img { 
  height: 280px; 
  background-size: cover; 
  background-position: center; 
  background-color: #e5e7eb; 
  position: relative;
}
.hero-img::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(255,255,255,1), transparent);
}

/* Stats Bar */
.stats-bar { 
  display: flex; 
  background: #fff; 
  position: relative;
  z-index: 2;
  margin-top: -30px;
  padding: 0 24px;
  gap: 16px;
}
.stat-box { 
  flex: 1; 
  padding: 16px; 
  text-align: center; 
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid #f3f4f6;
}
.stat-val { display: block; font-size: 1.5rem; font-family: 'Playfair Display', serif; font-weight: 800; color: #b91c1c; }
.stat-label { display: block; font-size: 0.7rem; color: #6b7280; text-transform: uppercase; margin-top: 4px; letter-spacing: 0.08em; font-weight: 600; }
.colon { margin: 0 2px; color: #d1d5db; }

/* Content area */
.content-pad { padding: 32px 32px; }
h1 { font-family: 'Playfair Display', serif; font-size: 2.2rem; font-weight: 800; color: #111827; margin: 0 0 12px; line-height: 1.1; text-align: center; }
.blurb { color: #4b5563; font-size: 1.05rem; line-height: 1.6; margin: 0 0 32px; text-align: center; }

/* Entry List Accordion */
.entry-list { display: flex; flex-direction: column; gap: 12px; }
.entry-item { 
  border: 1px solid #e5e7eb; 
  border-radius: 12px; 
  overflow: hidden; 
  background: #fff; 
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.entry-header { 
  display: flex; 
  align-items: center; 
  padding: 18px 20px; 
  min-height: 60px; /* Improved tap target */
  cursor: pointer; 
  background: #fff; 
  transition: background 0.2s; 
}
.entry-header:hover { background: #f9fafb; }

.entry-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; margin-right: 16px; color: #9ca3af; transition: color 0.3s; }
.entry-icon svg { width: 100%; height: 100%; }
.entry-label { flex: 1; font-weight: 600; color: #374151; font-size: 1.05rem; }
.entry-points { background: #f3f4f6; color: #4b5563; font-weight: 700; font-size: 0.85rem; padding: 6px 12px; border-radius: 20px; min-width: 45px; text-align: center; transition: all 0.3s; }

/* States */
.entry-item.active-task { 
  border-color: #b91c1c; 
  box-shadow: 0 4px 12px rgba(185, 28, 28, 0.1); 
  transform: translateY(-2px);
}
.entry-item.active-task .entry-points { background: #b91c1c; color: #fff; }
.entry-item.active-task .entry-icon { color: #b91c1c; }

.entry-item.locked { opacity: 0.7; pointer-events: none; background: #f9fafb; border-color: #f3f4f6; }
.entry-item.locked .entry-header { background: #f9fafb; }
.entry-item.locked .entry-label { color: #9ca3af; }

.entry-item.completed { border-color: #059669; }
.entry-item.completed .entry-points { background: #059669; color: white; }
.entry-item.completed .entry-icon { color: #059669; }

.entry-body { padding: 20px; border-top: 1px solid #f3f4f6; background: #fafafa; }

/* Forms & Buttons */
input { 
  width: 100%; padding: 14px 16px; 
  border: 1px solid #d1d5db; border-radius: 8px; margin-bottom: 16px; 
  font-family: inherit; font-size: 16px; /* 16px prevents iOS zoom */
  min-height: 50px; /* Improved tap target */
  color: #1f2937; background: #fff; 
  transition: all 0.2s; 
}
input:focus { outline: none; border-color: #b91c1c; box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.1); }
input[readonly] { background: #f9fafb; cursor: text; }

.btn { 
  width: 100%; padding: 14px 24px; 
  min-height: 50px; /* Improved tap target */
  background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%); 
  color: white; font-weight: 600; font-size: 16px; 
  border: none; border-radius: 8px; cursor: pointer; 
  transition: all 0.3s ease; 
  box-shadow: 0 4px 6px -1px rgba(185, 28, 28, 0.2);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 12px -2px rgba(185, 28, 28, 0.3); }
.btn:disabled { background: #fca5a5; cursor: not-allowed; transform: none; box-shadow: none; }

#error-alert { background: #fef2f2; color: #991b1b; padding: 14px; border-radius: 8px; margin-bottom: 20px; font-size: 0.95rem; text-align: center; border: 1px solid #fecaca; }

/* Referral Block */
.referral-highlight { 
  background: linear-gradient(135deg, #fef2f2 0%, #fff 100%); 
  border: 1px solid #fecaca; border-radius: 12px; padding: 24px; text-align: center; 
  box-shadow: 0 10px 25px -5px rgba(185, 28, 28, 0.05);
}
.referral-highlight h3 { font-family: 'Playfair Display', serif; color: #991b1b; font-size: 1.4rem; font-weight: 700; margin: 0 0 10px; }
.referral-highlight p { color: #b91c1c; font-size: 1rem; margin: 0 0 24px; }

.share-row { display: flex; gap: 8px; margin-bottom: 20px; }
.share-row input { margin-bottom: 0; border-color: #fca5a5; font-family: monospace; font-size: 0.9rem; color: #991b1b; background: #fff; }
.share-row button { width: auto; flex-shrink: 0; background: #b91c1c; }

/* How It Works Box */
.how-it-works-box {
  background: #fff;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 20px;
  margin-top: 24px;
  text-align: left;
}
.how-it-works-box h4 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: #991b1b;
  font-weight: 700;
}
.how-it-works-box p {
  margin: 0;
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.5;
}


/* Footer */
.footer-links { text-align: center; padding: 20px; border-top: 1px solid #f3f4f6; background: #fafafa; }
.text-link { 
  background: none; border: none; color: #6b7280; font-size: 0.9rem; cursor: pointer; text-decoration: underline; font-family: inherit; transition: color 0.2s; 
  padding: 12px 24px; /* Improved tap target */
  display: inline-block;
}
.text-link:hover { color: #111827; }

/* Modals */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(17, 24, 39, 0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; backdrop-filter: blur(8px); opacity: 1; transition: opacity 0.3s; }
.modal.hidden { opacity: 0; pointer-events: none; }
.modal-content { background: #fff; width: 100%; max-width: 500px; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); overflow: hidden; max-height: 90vh; display: flex; flex-direction: column; transform: scale(1); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.modal.hidden .modal-content { transform: scale(0.95); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #f3f4f6; background: #fafafa; }
.modal-header h2 { margin: 0; font-size: 1.35rem; font-family: 'Playfair Display', serif; font-weight: 700; color: #111827; }
.close-btn { 
  background: none; border: none; font-size: 1.75rem; line-height: 1; cursor: pointer; color: #9ca3af; transition: color 0.2s; 
  width: 48px; height: 48px; /* Large tap target for accessibility */
  display: flex; align-items: center; justify-content: center;
  margin: -12px; /* Offset to keep visual alignment */
  border-radius: 50%;
}
.close-btn:hover { color: #111827; background: #f3f4f6; }
.modal-body { padding: 24px; overflow-y: auto; }

.iw-content { padding: 40px 32px; text-align: center; }
.iw-content h2 { font-family: 'Playfair Display', serif; color: #b91c1c; font-size: 1.8rem; margin: 0 0 16px; }

/* MOBILE OPTIMIZATIONS */
@media (max-width: 600px) {
  .page-wrap { padding: 16px 8px; }
  .content-pad { padding: 24px 16px; }
  
  .stats-bar { padding: 0 12px; gap: 12px; flex-wrap: wrap; margin-top: -20px; }
  .stat-box { padding: 12px; min-width: 120px; }
  .stat-val { font-size: 1.25rem; }
  
  h1 { font-size: 1.75rem; }
  .hero-img { height: 180px; }
  
  /* Stack share row on narrow screens to maximize tap target size */
  .share-row { flex-direction: column; gap: 12px; }
  .share-row button { width: 100%; }
  
  .entry-header { padding: 14px 16px; }
  .entry-label { font-size: 1rem; }
  .entry-icon { margin-right: 12px; }
  
  .iw-content { padding: 24px 20px; }
}