/* ============================================================
   EduPass — Premium Student Membership App UI
   Design System
   ============================================================ */

/* ---------- ROOT TOKENS ---------- */
:root {
  --ep-primary:       #6C63FF;
  --ep-primary-dark:  #4f46e5;
  --ep-primary-light: #EEF0FF;
  --ep-accent:        #FF6B6B;
  --ep-green:         #22C55E;
  --ep-gold:          #F59E0B;
  --ep-bg:            #F5F5FA;
  --ep-surface:       #FFFFFF;
  --ep-surface2:      #F0F0F8;
  --ep-text:          #12101E;
  --ep-muted:         #6B7280;
  --ep-border:        #E5E5F0;
  --ep-radius-card:   20px;
  --ep-radius-btn:    14px;
  --ep-shadow:        0 4px 20px rgba(108,99,255,0.10);
  --ep-shadow-card:   0 2px 12px rgba(18,16,30,0.06);
}

/* ---------- BASE ---------- */
* { box-sizing: border-box; }

html, body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--ep-bg);
  color: var(--ep-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,h2,h3,h4,h5,h6,
.ep-display {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

/* ---------- LAYOUT SHELL ---------- */
.ep-page {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 80px;
  min-height: 100vh;
  background: var(--ep-bg);
  overflow-x: hidden;
}

/* ---------- STATUS BAR (cosmetic) ---------- */
.ep-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ep-text);
}
.ep-statusbar .icons { display: flex; gap: 6px; align-items: center; }
.ep-statusbar.light { color: #fff; }

/* ---------- TOP NAV BAR ---------- */
.ep-topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px 8px;
}
.ep-topnav .greeting small { font-size: 12px; color: var(--ep-muted); font-weight: 400; display: block; }
.ep-topnav .greeting h2 { font-size: 20px; font-weight: 800; color: var(--ep-text); margin: 0; }
.ep-topnav .avatar-row { display: flex; gap: 10px; align-items: center; }

.ep-icon-btn {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--ep-surface);
  border: 1.5px solid var(--ep-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--ep-muted);
  text-decoration: none; position: relative; cursor: pointer;
  transition: border-color 0.2s;
}
.ep-icon-btn:hover { border-color: var(--ep-primary); color: var(--ep-primary); }
.ep-icon-btn img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.ep-badge-dot {
  position: absolute; top: 4px; right: 4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ep-accent); border: 2px solid var(--ep-surface);
}

/* ---------- SECTION HEADING ---------- */
.ep-sec {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px 10px;
}
.ep-sec h3 { font-size: 15px; font-weight: 700; color: var(--ep-text); margin: 0; }
.ep-sec a { font-size: 12px; color: var(--ep-primary); font-weight: 600; text-decoration: none; }

/* ---------- CARDS ---------- */
.ep-card {
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-card);
  box-shadow: var(--ep-shadow-card);
}

/* ---------- MEMBERSHIP CARD ---------- */
.ep-membership-card {
  margin: 10px 16px 0;
  border-radius: 24px;
  background: linear-gradient(135deg, #1e1b5e 0%, #4f46e5 55%, #7c3aed 100%);
  padding: 22px 22px 20px;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}
.ep-membership-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px; border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.ep-membership-card::after {
  content: ''; position: absolute; bottom: -60px; left: -20px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.ep-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 18px; }
.ep-card-chip-label {
  background: rgba(255,255,255,0.18); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.1em;
  padding: 4px 10px; border-radius: 999px;
}
.ep-card-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff; font-weight: 800;
  font-family: 'Space Grotesk', sans-serif;
}
.ep-card-name  { color: rgba(255,255,255,0.65); font-size: 11px; margin-bottom: 2px; }
.ep-card-student { color: #fff; font-size: 18px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; margin: 0; }
.ep-card-college { color: rgba(255,255,255,0.55); font-size: 11px; margin-top: 2px; }
.ep-card-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 18px; position: relative; z-index: 1;
}
.ep-card-bal-label, .ep-card-plan-label {
  color: rgba(255,255,255,0.6); font-size: 10px; letter-spacing: 0.06em;
}
.ep-card-plan-label { text-align: right; }
.ep-card-balance {
  color: #fff; font-size: 22px; font-weight: 800;
  font-family: 'Space Grotesk', sans-serif; margin: 0;
}
.ep-card-plan { color: #FFD700; font-size: 13px; font-weight: 700; text-align: right; }

/* ---------- VERIFIED BADGE ---------- */
.ep-verified {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(34,197,94,0.25); color: #4ade80;
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 999px; margin-top: 6px;
  border: 1px solid rgba(74,222,128,0.3);
}
.ep-pending {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(245,158,11,0.25); color: #FCD34D;
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 999px; margin-top: 6px;
  border: 1px solid rgba(245,158,11,0.3);
}

/* ---------- STATS ROW ---------- */
.ep-stats-row { display: flex; gap: 10px; padding: 0 16px; }
.ep-stat-card {
  flex: 1;
  background: var(--ep-surface);
  border-radius: 16px;
  padding: 14px 12px;
  border: 1px solid var(--ep-border);
  box-shadow: var(--ep-shadow-card);
}
.ep-stat-label { font-size: 11px; color: var(--ep-muted); font-weight: 500; margin-bottom: 5px; }
.ep-stat-val   { font-size: 20px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; color: var(--ep-text); line-height: 1; }
.ep-stat-sub   { font-size: 10px; margin-top: 3px; }
.ep-stat-sub.up     { color: var(--ep-green); }
.ep-stat-sub.streak { color: var(--ep-gold); }
.ep-stat-sub.primary { color: var(--ep-primary); }

/* ---------- QUICK ACTIONS ---------- */
.ep-quick-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 0 16px;
}
.ep-qa {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--ep-surface); border-radius: 14px; padding: 10px 4px;
  border: 1px solid var(--ep-border); cursor: pointer;
  text-decoration: none; transition: transform 0.15s, box-shadow 0.15s;
}
.ep-qa:hover { transform: translateY(-2px); box-shadow: var(--ep-shadow); }
.ep-qa-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.ep-qa-icon.blue   { background: #EEF2FF; color: #6C63FF; }
.ep-qa-icon.green  { background: #ECFDF5; color: #16A34A; }
.ep-qa-icon.orange { background: #FFF7ED; color: #EA580C; }
.ep-qa-icon.purple { background: #F5F3FF; color: #7C3AED; }
.ep-qa-label { font-size: 9px; font-weight: 600; color: var(--ep-muted); text-align: center; line-height: 1.3; }

/* ---------- CHECKIN CARD ---------- */
.ep-checkin-card {
  margin: 0 16px;
  border-radius: var(--ep-radius-card);
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  border: 1px solid #A7F3D0;
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.ep-checkin-card h4 { font-size: 14px; font-weight: 700; color: #064E3B; margin-bottom: 2px; }
.ep-checkin-card p  { font-size: 11px; color: #065F46; margin: 0; }
.ep-streak-dots { display: flex; gap: 3px; margin-top: 6px; }
.ep-dot { width: 8px; height: 8px; border-radius: 50%; background: #A7F3D0; }
.ep-dot.done { background: var(--ep-green); }
.ep-checkin-btn {
  background: var(--ep-green); color: #fff;
  border: none; border-radius: var(--ep-radius-btn);
  padding: 10px 16px; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  font-family: 'Space Grotesk', sans-serif;
  transition: opacity 0.2s;
}
.ep-checkin-btn:hover { opacity: 0.88; }
.ep-checkin-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- REFERRAL BANNER ---------- */
.ep-referral {
  margin: 0 16px;
  border-radius: var(--ep-radius-card);
  background: linear-gradient(135deg, #F0F0FF, #E8E8FF);
  border: 1px solid #D4D4FF;
  padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.ep-referral h4 { font-size: 14px; font-weight: 700; color: #312E81; margin-bottom: 2px; }
.ep-referral p  { font-size: 11px; color: #5B5A9E; margin: 0; }
.ep-referral code {
  background: #fff; border: 1px solid #C7C7FF;
  color: var(--ep-primary); padding: 2px 8px;
  border-radius: 6px; font-family: 'Space Grotesk', sans-serif;
  font-weight: 700; font-size: 12px;
}
.ep-referral-icon {
  width: 52px; height: 52px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(135deg, #6C63FF, #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff;
}

/* ---------- DEAL CARDS ---------- */
.ep-deals-scroll {
  display: flex; gap: 12px; padding: 0 16px 4px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ep-deals-scroll::-webkit-scrollbar { display: none; }
.ep-deal-card {
  flex: 0 0 180px; height: 140px;
  border-radius: 18px; overflow: hidden;
  position: relative; cursor: pointer; text-decoration: none; display: block;
  scroll-snap-align: start;
}
.ep-deal-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-deal-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0) 60%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 10px 12px;
}
.ep-deal-chip {
  align-self: flex-start;
  background: #FFD700; color: #111;
  font-size: 9px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px; margin-bottom: 4px;
}
.ep-deal-title { color: #fff; font-size: 12px; font-weight: 700; line-height: 1.3; }
.ep-deal-sub   { color: rgba(255,255,255,0.75); font-size: 10px; }

/* Full-width ad card (advertisements page) */
.ep-ad-card {
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-card);
  overflow: hidden;
  box-shadow: var(--ep-shadow-card);
}
.ep-ad-card img { width: 100%; height: 200px; object-fit: cover; display: block; }
.ep-ad-body { padding: 14px 16px; }
.ep-ad-body h5 { font-size: 15px; font-weight: 700; color: var(--ep-text); margin-bottom: 4px; }
.ep-ad-body p  { font-size: 13px; color: var(--ep-muted); margin-bottom: 12px; }

/* ---------- ANNOUNCEMENT CARDS ---------- */
.ep-announce-card {
  margin: 0 16px 10px;
  background: var(--ep-surface);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--ep-border);
  display: flex; gap: 12px; align-items: flex-start;
  box-shadow: var(--ep-shadow-card);
}
.ep-announce-icon {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: #FFF7ED; color: #EA580C;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.ep-announce-title { font-size: 13px; font-weight: 700; color: var(--ep-text); margin-bottom: 2px; }
.ep-announce-text  { font-size: 12px; color: var(--ep-muted); line-height: 1.5; }
.ep-announce-time  { font-size: 10px; color: var(--ep-muted); margin-top: 4px; }

/* ---------- WALLET SCREEN ---------- */
.ep-wallet-hero {
  background: linear-gradient(135deg, #064E3B, #059669);
  margin: 10px 16px 0; border-radius: 24px;
  padding: 22px 22px 20px; position: relative; overflow: hidden;
}
.ep-wallet-hero::before {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.ep-wallet-label  { color: rgba(255,255,255,0.7); font-size: 11px; margin-bottom: 4px; }
.ep-wallet-amount {
  color: #fff; font-size: 36px; font-weight: 800;
  font-family: 'Space Grotesk', sans-serif; letter-spacing: -1px; margin: 0;
}
.ep-wallet-stats { display: flex; gap: 10px; margin-top: 16px; }
.ep-wallet-stat {
  flex: 1; background: rgba(255,255,255,0.12);
  border-radius: 14px; padding: 10px 12px;
}
.ep-wallet-stat small { color: rgba(255,255,255,0.65); font-size: 10px; display: block; }
.ep-wallet-stat span  { color: #fff; font-size: 15px; font-weight: 700; display: block; margin-top: 2px; font-family: 'Space Grotesk', sans-serif; }

/* Wallet action buttons */
.ep-wallet-actions { display: flex; gap: 10px; padding: 16px 16px 0; }
.ep-wallet-actions .ep-btn-primary,
.ep-wallet-actions .ep-btn-outline { flex: 1; }

/* Transaction row */
.ep-tx-card {
  margin: 0 16px 8px;
  background: var(--ep-surface);
  border-radius: 16px;
  padding: 14px 16px;
  border: 1px solid var(--ep-border);
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--ep-shadow-card);
}
.ep-tx-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.ep-tx-icon.purple { background: #F5F3FF; color: #7C3AED; }
.ep-tx-icon.blue   { background: #EEF2FF; color: #4F46E5; }
.ep-tx-icon.green  { background: #ECFDF5; color: #16A34A; }
.ep-tx-icon.red    { background: #FEF2F2; color: #DC2626; }
.ep-tx-icon.orange { background: #FFF7ED; color: #EA580C; }
.ep-tx-label  { font-size: 13px; font-weight: 700; color: var(--ep-text); margin: 0; }
.ep-tx-sub    { font-size: 11px; color: var(--ep-muted); margin: 1px 0 0; }
.ep-tx-amt    { font-size: 14px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; text-align: right; white-space: nowrap; }
.ep-tx-amt.cr { color: var(--ep-green); }
.ep-tx-amt.dr { color: #DC2626; }
.ep-tx-bal    { font-size: 10px; color: var(--ep-muted); text-align: right; margin-top: 1px; }

/* ---------- PLAN CARDS ---------- */
.ep-plan-card {
  background: var(--ep-surface);
  border: 1.5px solid var(--ep-border);
  border-radius: 24px;
  padding: 20px 18px;
  position: relative;
  margin: 0 16px 16px;
  box-shadow: var(--ep-shadow-card);
}
.ep-plan-card.featured {
  border-color: var(--ep-primary);
  background: linear-gradient(180deg, #FAFBFF 0%, #EEF0FF 100%);
}
.ep-plan-badge {
  position: absolute; top: -12px; right: 20px;
  background: linear-gradient(135deg, var(--ep-primary), #7C3AED);
  color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0.08em;
  padding: 4px 12px; border-radius: 999px;
}
.ep-plan-icon {
  width: 50px; height: 50px; border-radius: 16px;
  background: linear-gradient(135deg, var(--ep-primary), #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: #fff; margin-bottom: 14px;
}
.ep-plan-name  { font-size: 18px; font-weight: 700; color: var(--ep-text); margin: 0 0 4px; }
.ep-plan-price {
  font-size: 32px; font-weight: 800; color: var(--ep-primary);
  font-family: 'Space Grotesk', sans-serif; line-height: 1; margin: 0 0 4px;
}
.ep-plan-price span { font-size: 14px; font-weight: 500; color: var(--ep-muted); }
.ep-plan-cashback {
  display: inline-flex; align-items: center; gap: 4px;
  background: #ECFDF5; color: #16A34A;
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
.ep-feature-list { list-style: none; padding: 0; margin: 0 0 16px; }
.ep-feature-list li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--ep-text); padding: 5px 0;
  border-bottom: 1px solid var(--ep-border);
}
.ep-feature-list li:last-child { border-bottom: none; }
.ep-feature-list li i { color: var(--ep-green); font-size: 16px; margin-top: 1px; flex-shrink: 0; }

/* ---------- PROFILE SCREEN ---------- */
.ep-profile-hero {
  background: linear-gradient(135deg, #1e1b5e, #6C63FF);
  padding: 28px 20px 40px; text-align: center; position: relative;
}
.ep-profile-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  object-fit: cover; margin: 0 auto 10px; display: block;
}
.ep-profile-initials {
  width: 80px; height: 80px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.4);
  background: linear-gradient(135deg, #F59E0B, #EF4444);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #fff;
  margin: 0 auto 10px; font-family: 'Space Grotesk', sans-serif;
}
.ep-profile-name   { color: #fff; font-size: 20px; font-weight: 700; margin: 0 0 2px; }
.ep-profile-mobile { color: rgba(255,255,255,0.7); font-size: 13px; margin: 0; }
.ep-profile-body   { margin-top: -20px; padding: 0 16px; }

.ep-profile-section {
  background: var(--ep-surface);
  border-radius: 20px;
  border: 1px solid var(--ep-border);
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: var(--ep-shadow-card);
}
.ep-profile-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--ep-border);
}
.ep-profile-row:last-child { border-bottom: none; }
.ep-profile-row-icon {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.ep-profile-row-icon.blue   { background: #EEF2FF; color: #4F46E5; }
.ep-profile-row-icon.green  { background: #ECFDF5; color: #16A34A; }
.ep-profile-row-icon.purple { background: #F5F3FF; color: #7C3AED; }
.ep-profile-row-icon.orange { background: #FFF7ED; color: #EA580C; }
.ep-profile-row-icon.red    { background: #FEF2F2; color: #E11D48; }
.ep-profile-row-label { font-size: 13px; font-weight: 600; color: var(--ep-text); margin: 0 0 1px; }
.ep-profile-row-sub   { font-size: 11px; color: var(--ep-muted); margin: 0; }
.ep-profile-row-right { margin-left: auto; color: var(--ep-muted); font-size: 18px; display: flex; align-items: center; }

.ep-mini-wallet {
  background: linear-gradient(135deg, #064E3B, #059669);
  border-radius: 18px; padding: 16px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.ep-mini-wallet-label  { color: rgba(255,255,255,0.7); font-size: 11px; }
.ep-mini-wallet-amount { color: #fff; font-size: 22px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; margin: 0; }

/* ---------- AUTH SCREENS ---------- */
.ep-auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px;
  background: var(--ep-bg);
}
.ep-auth-card {
  width: 100%; max-width: 420px;
  background: var(--ep-surface);
  border-radius: 28px;
  border: 1px solid var(--ep-border);
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(108,99,255,0.12);
}
.ep-app-logo {
  width: 72px; height: 72px; border-radius: 22px;
  background: linear-gradient(135deg, #6C63FF, #7C3AED);
  color: #fff; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 12px 30px rgba(108,99,255,0.35);
}
.ep-auth-title { font-size: 26px; font-weight: 800; color: var(--ep-text); text-align: center; margin-bottom: 4px; }
.ep-auth-sub   { font-size: 14px; color: var(--ep-muted); text-align: center; margin-bottom: 28px; }

.ep-features-row { display: flex; gap: 20px; justify-content: center; margin-bottom: 28px; }
.ep-feat { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ep-feat-icon {
  width: 44px; height: 44px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.ep-feat-icon.a { background: #EEF2FF; color: #4F46E5; }
.ep-feat-icon.b { background: #ECFDF5; color: #16A34A; }
.ep-feat-icon.c { background: #FFF7ED; color: #EA580C; }
.ep-feat span { font-size: 11px; font-weight: 600; color: var(--ep-muted); }

/* Form fields */
.ep-field { margin-bottom: 16px; }
.ep-label {
  font-size: 11px; font-weight: 700; color: var(--ep-muted);
  letter-spacing: 0.06em; display: block; margin-bottom: 6px;
}
.ep-input-wrap { position: relative; }
.ep-input-wrap > i.ep-input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--ep-muted); font-size: 18px; pointer-events: none;
}
.ep-input-prefix {
  position: absolute; left: 44px; top: 50%; transform: translateY(-50%);
  font-size: 14px; font-weight: 600; color: var(--ep-text);
  pointer-events: none;
}
.ep-input {
  width: 100%; padding: 13px 14px 13px 44px;
  border: 1.5px solid var(--ep-border); border-radius: 14px;
  font-size: 15px; font-family: 'Inter', sans-serif;
  background: var(--ep-surface); color: var(--ep-text);
  outline: none; transition: border-color 0.2s;
}
.ep-input.with-prefix { padding-left: 82px; }
.ep-input:focus { border-color: var(--ep-primary); }
.ep-input.ep-otp {
  letter-spacing: 0.5rem; text-align: center;
  font-size: 1.5rem; font-weight: 700;
}
.ep-input-group-text {
  display: flex; align-items: center; gap: 6px;
  padding: 13px 14px; background: var(--ep-surface2);
  border: 1.5px solid var(--ep-border); border-right: none;
  border-radius: 14px 0 0 14px; font-size: 14px; font-weight: 600; color: var(--ep-text);
}
.ep-input-group-right {
  border-radius: 0 14px 14px 0; border-left: none; padding-left: 12px;
}

select.ep-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236B7280' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.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; }

/* ---------- BUTTONS ---------- */
.ep-btn-primary {
  display: block; width: 100%; border: none;
  background: linear-gradient(135deg, var(--ep-primary), #7C3AED);
  color: #fff; font-size: 15px; font-weight: 700;
  border-radius: var(--ep-radius-btn); padding: 14px;
  cursor: pointer; font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.02em; text-align: center; text-decoration: none;
  box-shadow: 0 8px 20px rgba(108,99,255,0.28);
  transition: opacity 0.2s, transform 0.1s;
}
.ep-btn-primary:hover  { opacity: 0.92; color: #fff; text-decoration: none; }
.ep-btn-primary:active { transform: scale(0.98); }
.ep-btn-primary.green  { background: linear-gradient(135deg,#16A34A,#15803D); box-shadow: 0 8px 20px rgba(22,163,74,0.25); }
.ep-btn-primary.silver { background: linear-gradient(135deg,#9CA3AF,#6B7280); box-shadow: none; }
.ep-btn-primary.platinum { background: linear-gradient(135deg,#7C3AED,#4C1D95); box-shadow: 0 8px 20px rgba(124,58,237,0.25); }
.ep-btn-primary.sm { font-size: 13px; padding: 10px 16px; }

.ep-btn-outline {
  display: block; width: 100%; padding: 14px;
  border: 1.5px solid var(--ep-border); background: var(--ep-surface);
  color: var(--ep-text); font-size: 15px; font-weight: 700;
  border-radius: var(--ep-radius-btn); cursor: pointer;
  font-family: 'Space Grotesk', sans-serif; text-align: center; text-decoration: none;
  transition: border-color 0.2s;
}
.ep-btn-outline:hover { border-color: var(--ep-primary); color: var(--ep-primary); text-decoration: none; }

.ep-btn-danger {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 1.5px solid #FEE2E2;
  background: var(--ep-surface); color: #DC2626;
  font-size: 14px; font-weight: 700;
  border-radius: var(--ep-radius-btn); padding: 14px;
  cursor: pointer; font-family: 'Space Grotesk', sans-serif;
  transition: background 0.2s;
}
.ep-btn-danger:hover { background: #FEF2F2; }

.ep-btn-ghost-sm {
  background: rgba(255,255,255,0.2); color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px; padding: 10px 16px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
}

.ep-share-btn {
  background: var(--ep-surface);
  border: 1.5px solid var(--ep-border);
  border-radius: 10px; padding: 8px 12px;
  color: var(--ep-muted); font-size: 16px; cursor: pointer;
}

/* ---------- SOCIAL PROOF ---------- */
.ep-social-proof {
  background: var(--ep-surface); border-radius: 16px;
  padding: 14px; border: 1px solid var(--ep-border);
  margin-top: 24px;
}
.ep-avatars { display: flex; }
.ep-avatar-mini {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--ep-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  margin-left: -7px;
}
.ep-avatar-mini:first-child { margin-left: 0; }

/* ---------- DIVIDER ---------- */
.ep-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0;
}
.ep-divider span  { color: var(--ep-muted); font-size: 12px; }
.ep-divider-line  { flex: 1; height: 1px; background: var(--ep-border); }

/* ---------- ALERT ---------- */
.ep-alert {
  border-radius: 14px; padding: 12px 16px;
  font-size: 13px; margin: 0 16px 12px;
  display: none;
}
.ep-alert.show { display: block; }
.ep-alert-warning { background: #FFFBEB; border: 1px solid #FCD34D; color: #92400E; }
.ep-alert-danger  { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.ep-alert-success { background: #ECFDF5; border: 1px solid #A7F3D0; color: #065F46; }
.ep-alert-info    { background: var(--ep-primary-light); border: 1px solid #C7C7FF; color: #312E81; }

/* ---------- BOTTOM NAV ---------- */
.ep-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0; right: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--ep-border);
  display: flex; justify-content: space-around;
  padding: 10px 0 20px; z-index: 100;
  box-shadow: 0 -4px 16px rgba(18,16,30,0.06);
}
.ep-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--ep-muted); font-size: 9px; font-weight: 700;
  text-decoration: none; letter-spacing: 0.04em; cursor: pointer;
  position: relative; padding: 0 6px;
}
.ep-nav-item i { font-size: 22px; }
.ep-nav-item.active { color: var(--ep-primary); }
.ep-nav-pip {
  position: absolute; bottom: -8px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--ep-primary);
  display: none;
}
.ep-nav-item.active .ep-nav-pip { display: block; }

/* ---------- SUCCESS PAGE ---------- */
.ep-success-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: #ECFDF5; color: var(--ep-green);
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; margin: 0 auto 16px;
}

/* ---------- TERMS ---------- */
.ep-terms-box {
  max-height: 320px; overflow-y: auto;
  background: var(--ep-bg); border: 1.5px solid var(--ep-border);
  border-radius: 14px; padding: 1rem; font-size: 0.9rem;
}

/* ---------- MISC UTILITIES ---------- */
.ep-muted { color: var(--ep-muted); }
.ep-text-primary { color: var(--ep-primary); }
.ep-text-success { color: var(--ep-green); }
.ep-font-display { font-family: 'Space Grotesk', sans-serif; }
.ep-mt-page { margin-top: 10px; }


/* =================================================================
   LAYOUT & RESPONSIVE SYSTEM
   
   Structure: body > .ep-shell > .ep-scroll + .ep-bottom-nav
   
   .ep-shell  = the visible phone card (flex column, clips corners)
   .ep-scroll = scrollable content (flex:1, fills shell above nav)
   .ep-bottom-nav = always last child of .ep-shell (normal flow)
   
   On mobile: shell is full-width, nav is fixed to viewport bottom
   On 768px+:  shell is a floating card, nav is in normal flow inside shell
   ================================================================= */

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  width: 100%; min-height: 100vh;
  overflow-x: hidden;
  background: var(--ep-bg);
  font-family: 'Inter', system-ui, sans-serif;
}

/* ================================================================
   MOBILE  (base — 0px to 767px)
   Full-width app, nav fixed to viewport bottom
   ================================================================ */

.ep-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  background: var(--ep-bg);
  position: relative;
}

.ep-scroll {
  flex: 1;
  overflow-x: hidden;
  /* Extra bottom padding so content doesn't hide behind fixed nav */
  padding-bottom: 80px;
}

/* Nav: fixed to viewport on mobile */
.ep-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--ep-border);
  display: flex;
  justify-content: space-around;
  padding: 10px 0 20px;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(18,16,30,0.08);
}

/* Safe area for iPhone home bar */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .ep-bottom-nav {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .ep-scroll {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* ================================================================
   TABLET + DESKTOP  768px+
   Floating phone card. Nav in normal flow at bottom of card.
   ================================================================ */
@media (min-width: 768px) {
  html, body {
    background: #CACAE8;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 28px 0;
    box-sizing: border-box;
  }

  /* The phone card */
  .ep-shell {
    /* Fixed phone-sized card */
    width: 390px;
    min-width: 390px;
    max-width: 390px;
    height: calc(100vh - 56px);
    max-height: 850px;
    min-height: 500px;
    border-radius: 44px;
    overflow: hidden;      /* clips rounded corners AND the nav */
    flex-shrink: 0;
    /* White bezel + shadow */
    box-shadow:
      0 0 0 10px #fff,
      0 0 0 11px rgba(0,0,0,0.07),
      0 32px 80px rgba(108,99,255,0.28);
    background: var(--ep-bg);
  }

  /* Scrollable area: takes all space above the nav */
  .ep-scroll {
    flex: 1;
    min-height: 0;          /* crucial: allows flex child to shrink */
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    padding-bottom: 0;      /* nav is in normal flow, no padding needed */
    -webkit-overflow-scrolling: touch;
  }
  .ep-scroll::-webkit-scrollbar { display: none; }

  /* Nav: normal flow — sits at shell bottom, always visible */
  .ep-bottom-nav {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 0 44px 44px;
    padding-bottom: 16px;
    z-index: 10;
    flex-shrink: 0;
  }

  /* Auth pages: same card shape, but auto height */
  .ep-auth-shell {
    width: 390px;
    min-width: 390px;
    max-width: 390px;
    min-height: auto;
    padding: 0;
    margin: 0;
    background: transparent;
    border-radius: 44px;
    box-shadow:
      0 0 0 10px #fff,
      0 0 0 11px rgba(0,0,0,0.07),
      0 32px 80px rgba(108,99,255,0.28);
    align-items: unset;
    justify-content: unset;
  }
  .ep-auth-card {
    border-radius: 44px;
    padding: 44px 36px 52px;
    border: none;
    box-shadow: none;
    max-width: 100%;
    width: 100%;
  }
}

/* ---- Legacy: .ep-page still works inside .ep-scroll ---- */
.ep-page { width: 100%; }

/* ---- Auth shell (mobile) ---- */
.ep-auth-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 60px;
  background: var(--ep-bg);
}
.ep-auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--ep-surface);
  border-radius: 28px;
  border: 1px solid var(--ep-border);
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(108,99,255,0.12);
}

/* ---- Spacing helpers ---- */
.ep-topnav         { padding: 14px 16px 8px; }
.ep-sec            { padding: 16px 16px 10px; }
.ep-quick-grid     { padding: 0 16px; }
.ep-deals-scroll   { padding: 0 16px 4px; }
.ep-stats-row      { padding: 0 16px; }
.ep-wallet-actions { padding: 14px 16px 0; }
.ep-profile-body   { padding: 0 16px; }

.ep-membership-card, .ep-checkin-card, .ep-referral,
.ep-wallet-hero, .ep-plan-card, .ep-banner-ad,
.ep-announce-card, .ep-tx-card, .ep-alert {
  margin-left: 16px;
  margin-right: 16px;
}

/* Ad panel: edge-to-edge with rounded corners */
.ep-adpanel {
  margin: 0 16px;
  border-radius: 16px;
  overflow: hidden;
}

/* ---- Prevent iOS zoom ---- */
input, select, textarea { font-size: 16px !important; }

/* ---- Touch ---- */
a, button, .ep-qa, .ep-nav-item { touch-action: manipulation; }

/* ---- Overflow safety ---- */
.ep-card-student, .ep-card-college { word-break: break-word; }
.ep-card-footer { flex-wrap: wrap; gap: 8px; }
.ep-referral code { word-break: break-all; }
.ep-quick-grid { overflow: hidden; }
.ep-qa { min-width: 0; overflow: hidden; }
.ep-stats-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.ep-stats-row::-webkit-scrollbar { display: none; }
.ep-stat-card { min-width: 0; flex: 0 0 auto; min-width: 90px; }

/* ---- Deal scroll ---- */
.ep-deals-scroll {
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.ep-deal-card { scroll-snap-align: start; }

/* ---- Wallet actions ---- */
.ep-wallet-actions { display: flex; gap: 10px; }
.ep-wallet-actions .ep-btn-primary,
.ep-wallet-actions .ep-btn-outline { flex: 1; width: auto; }


/* ================================================================
   SMALL PHONES  < 380px
   ================================================================ */
@media (max-width: 380px) {
  .ep-topnav .greeting h2 { font-size: 17px; }
  .ep-membership-card { padding: 16px 14px; }
  .ep-card-balance    { font-size: 18px; }
  .ep-card-student    { font-size: 14px; }
  .ep-stat-val        { font-size: 16px; }
  .ep-wallet-amount   { font-size: 28px; }
  .ep-plan-price      { font-size: 26px; }
  .ep-auth-title      { font-size: 22px; }
  .ep-quick-grid      { gap: 5px; }
  .ep-qa              { padding: 8px 2px; }
  .ep-qa-icon         { width: 28px; height: 28px; font-size: 13px; }
  .ep-qa-label        { font-size: 8px; }
  .ep-membership-card,
  .ep-checkin-card, .ep-referral, .ep-wallet-hero,
  .ep-plan-card, .ep-banner-ad, .ep-announce-card,
  .ep-tx-card, .ep-alert { margin-left: 12px; margin-right: 12px; }
}

/* ============================================================
   PAGE-LEVEL LAYOUT HELPERS
   ============================================================ */

/* Page header (wallet, plans, offers, profile) */
.ep-page-header {
  padding: 18px 16px 4px;
}
.ep-page-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ep-text);
  margin: 0 0 2px;
}
.ep-page-sub {
  font-size: 13px;
  color: var(--ep-muted);
  margin: 0;
}

/* Empty state */
.ep-empty-state {
  padding: 0 16px;
  font-size: 13px;
  color: var(--ep-muted);
  line-height: 1.6;
}

/* Wallet button fix */
.ep-wallet-btn {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-size: 13px;
}

/* Transaction card internals */
.ep-tx-info {
  flex: 1;
  min-width: 0;
}
.ep-tx-right {
  text-align: right;
  flex-shrink: 0;
}

/* Plan desc */
.ep-plan-desc {
  font-size: 13px;
  color: var(--ep-muted);
  margin: 0 0 12px;
}

/* Ads list */
.ep-ads-list {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
}
.ep-ad-img-wrap {
  position: relative;
}
.ep-ad-chip {
  position: absolute;
  top: 10px;
  left: 12px;
  background: #FFD700;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
}
.ep-ad-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.ep-ad-cta {
  flex: 1;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-decoration: none;
}

/* Profile section title */
.ep-profile-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ep-text);
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--ep-border);
}
.ep-profile-section-title i {
  color: var(--ep-primary);
}

/* File input */
.ep-file-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--ep-border);
  border-radius: 14px;
  font-size: 14px;
  background: var(--ep-surface);
  color: var(--ep-text);
  cursor: pointer;
}

/* Form row — 2 columns side by side */
.ep-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ep-form-row .ep-field {
  margin-bottom: 0;
}

/* Input without icon padding */
.ep-input-bare {
  padding-left: 14px !important;
  width: 100%;
}

/* Auth page shell — full centered layout */
.ep-auth-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 60px;
  background: var(--ep-bg);
}
.ep-auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--ep-surface);
  border-radius: 24px;
  border: 1px solid var(--ep-border);
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(108,99,255,0.12);
}

/* Bottom nav links must be full clickable */
.ep-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ep-muted);
  font-size: 9px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
  cursor: pointer;
  position: relative;
  padding: 0 6px;
  -webkit-tap-highlight-color: transparent;
}
.ep-nav-item i { font-size: 22px; }
.ep-nav-item.active { color: var(--ep-primary); }
.ep-nav-pip {
  position: absolute;
  bottom: -6px;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--ep-primary);
  display: none;
}
.ep-nav-item.active .ep-nav-pip { display: block; }

/* Profile body spacing */
.ep-profile-body {
  padding: 0 16px;
  margin-top: -16px;
}
.ep-profile-body > * + * {
  margin-top: 0;
}

/* Profile hero safe top padding */
.ep-profile-hero {
  padding-top: 32px;
}

/* Make all inner-page sections not escape the card */
.ep-page > * {
  max-width: 100%;
  overflow-x: hidden;
}



/* ============================================================
   ADVERTISEMENT PANEL — Dashboard Quick-Access Banner
   ============================================================ */

/* Carousel wrapper */
.ep-adpanel {
  margin: 0 16px;
  border-radius: var(--ep-radius-card);
  overflow: hidden;
  position: relative;
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  box-shadow: var(--ep-shadow-card);
}

/* Slides track */
.ep-adpanel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Each slide */
.ep-adpanel-slide {
  flex: 0 0 100%;
  position: relative;
  display: block;
  text-decoration: none;
  min-height: 120px;
  background: linear-gradient(135deg, var(--ep-primary-dark), var(--ep-primary));
}

.ep-adpanel-slide img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

/* Gradient overlay */
.ep-adpanel-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(15,12,60,0.72) 0%,
    rgba(108,99,255,0.30) 60%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
  gap: 4px;
}

/* "AD" pill */
.ep-adpanel-tag {
  align-self: flex-start;
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  margin-bottom: 2px;
}

.ep-adpanel-title {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.ep-adpanel-sub {
  color: rgba(255,255,255,0.80);
  font-size: 11px;
  line-height: 1.4;
  margin-top: 1px;
}

.ep-adpanel-cta {
  align-self: flex-start;
  margin-top: 6px;
  background: #FFD700;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 999px;
}

/* Dot indicators */
.ep-adpanel-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding: 8px 0 10px;
  background: var(--ep-surface);
}

.ep-adpanel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ep-border);
  transition: background 0.25s, width 0.25s;
  cursor: pointer;
  border: none;
  padding: 0;
}

.ep-adpanel-dot.active {
  background: var(--ep-primary);
  width: 18px;
  border-radius: 3px;
}

/* Empty state when no ads */
.ep-adpanel-empty {
  display: none; /* hidden when ads exist */
}

/* ============================================================
   FULL MOBILE RESPONSIVE IMPROVEMENTS
   ============================================================ */

/* Prevent content bleed on ultra-narrow viewports */
@media (max-width: 359px) {
  .ep-page { padding-bottom: 90px; }
  .ep-topnav .greeting h2 { font-size: 15px; }
  .ep-quick-grid { grid-template-columns: repeat(4,1fr); gap: 4px; padding: 0 12px; }
  .ep-qa { padding: 10px 2px; border-radius: 14px; }
  .ep-qa-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }
  .ep-qa-label { font-size: 8px; }
  .ep-membership-card { margin: 10px 12px 0; padding: 14px 14px 16px; }
  .ep-card-balance { font-size: 18px; }
  .ep-card-student { font-size: 14px; }
  .ep-adpanel { margin: 0 12px; }
  .ep-checkin-card, .ep-referral { margin-left: 12px; margin-right: 12px; }
  .ep-announce-card { margin-left: 12px; margin-right: 12px; }
  .ep-bottom-nav { padding: 8px 0 16px; }
  .ep-nav-item { font-size: 8px; padding: 0 3px; }
  .ep-nav-item i { font-size: 18px; }
}

/* Safe area insets (iPhone notch / home bar) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .ep-bottom-nav {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
  .ep-page {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

/* Prevent text from touching edges */
.ep-card-footer { align-items: flex-end; }
.ep-checkin-card { flex-wrap: nowrap; gap: 10px; }
.ep-checkin-card > div { min-width: 0; flex: 1; }
.ep-checkin-btn { flex-shrink: 0; }

/* Referral wrapping */
.ep-referral { flex-wrap: wrap; }
.ep-referral > div:first-child { flex: 1; min-width: 0; }
.ep-referral-icon { flex-shrink: 0; }

/* Announcement card text overflow */
.ep-announce-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-announce-text  { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Deal card consistent height on small screens */
.ep-deal-card { height: 130px; }
@media (max-width: 380px) { .ep-deal-card { flex: 0 0 160px; } }

/* Membership card plan label wrap-safe */
.ep-card-plan { word-break: break-word; max-width: 160px; }

/* Touch targets minimum 44px */
.ep-icon-btn { min-width: 44px; min-height: 44px; }
.ep-checkin-btn { min-height: 44px; }
.ep-adpanel-dot { min-width: 20px; min-height: 20px; }

/* Stats row keeps on one line */
.ep-stats-row { overflow-x: auto; scrollbar-width: none; }
.ep-stats-row::-webkit-scrollbar { display: none; }
.ep-stat-card { flex: 0 0 auto; min-width: 90px; }


/* ============================================================
   ADVERTISEMENT PANEL — Placeholder (no active ads)
   ============================================================ */
.ep-adpanel-placeholder {
  padding: 18px 16px;
  background: linear-gradient(135deg, #f0f0ff 0%, #e8e8ff 100%);
}

.ep-adpanel-placeholder-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ep-adpanel-placeholder-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ep-primary), #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #fff;
  flex-shrink: 0;
}

.ep-adpanel-placeholder-title {
  font-size: 14px;
  font-weight: 700;
  color: #312E81;
  font-family: 'Space Grotesk', sans-serif;
  margin-bottom: 3px;
}

.ep-adpanel-placeholder-sub {
  font-size: 11px;
  color: #5B5A9E;
  line-height: 1.4;
}

/* =====================================================================
   Investment Module
   ===================================================================== */

/* ---- Invest plan cards ---- */
.ep-invest-card {
  background: var(--ep-surface);
  border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-card);
  box-shadow: var(--ep-shadow-card);
  padding: 16px;
  margin: 0 16px 14px;
}
.ep-invest-top { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.ep-invest-icon {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 20px;
}
.ep-invest-name { font-size: 16px; font-weight: 800; color: var(--ep-text); margin: 0; font-family: 'Space Grotesk', sans-serif; }
.ep-invest-desc { font-size: 12px; color: var(--ep-muted); margin: 2px 0 0; }
.ep-invest-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  background: var(--ep-bg); border-radius: 14px; padding: 12px;
}
.ep-invest-stat { text-align: center; }
.ep-invest-stat-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ep-muted); margin-bottom: 3px; }
.ep-invest-stat-value { font-size: 15px; font-weight: 800; color: var(--ep-text); font-family: 'Space Grotesk', sans-serif; }
.ep-invest-stat-value.green { color: var(--ep-green); }
.ep-invest-profit {
  margin-top: 10px; font-size: 12px; font-weight: 700; color: #16A34A;
  background: #ECFDF5; border-radius: 10px; padding: 8px 10px; text-align: center;
}
.ep-fineprint { font-size: 11px; color: var(--ep-muted); line-height: 1.5; padding: 0 20px; }

/* ---- Checkout ---- */
.ep-checkout-summary {
  background: var(--ep-surface); border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-card); box-shadow: var(--ep-shadow-card);
  padding: 14px 16px; margin: 0 16px 12px;
}
.ep-cs-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; font-size: 13px; color: var(--ep-muted); }
.ep-cs-row + .ep-cs-row { border-top: 1px solid var(--ep-border); }
.ep-cs-row strong { font-size: 15px; color: var(--ep-text); font-family: 'Space Grotesk', sans-serif; }
.ep-cs-row strong.green { color: var(--ep-green); }

.ep-checkout-block {
  background: var(--ep-surface); border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-card); box-shadow: var(--ep-shadow-card);
  padding: 16px; margin: 0 16px 12px;
}
.ep-checkout-step { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--ep-text); margin-bottom: 12px; }
.ep-checkout-step span {
  width: 22px; height: 22px; border-radius: 50%; background: var(--ep-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.ep-pay-target { display: flex; justify-content: space-between; align-items: center; background: var(--ep-bg); border-radius: 12px; padding: 12px; }
.ep-pay-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ep-muted); }
.ep-pay-value { font-size: 15px; font-weight: 700; color: var(--ep-text); font-family: 'Space Grotesk', sans-serif; word-break: break-all; }
.ep-copy-btn { background: var(--ep-primary); color: #fff; border: none; border-radius: 10px; padding: 8px 12px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.ep-pay-bank { margin-top: 10px; background: var(--ep-bg); border-radius: 12px; padding: 12px; font-size: 13px; color: var(--ep-text); line-height: 1.6; }

/* ---- Success box ---- */
.ep-success-box {
  background: var(--ep-surface); border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-card); box-shadow: var(--ep-shadow-card);
  padding: 26px 18px; margin: 0 16px; text-align: center;
}
.ep-success-icon { font-size: 52px; color: var(--ep-green); line-height: 1; }
.ep-success-box h3 { font-size: 18px; font-weight: 800; color: var(--ep-text); margin: 12px 0 4px; }
.ep-success-box p { font-size: 12px; color: var(--ep-muted); margin: 0; }
.ep-invest-code {
  font-family: 'Space Grotesk', sans-serif; font-size: 20px; font-weight: 800; letter-spacing: .04em;
  color: var(--ep-primary); background: var(--ep-primary-light); border-radius: 12px;
  padding: 12px; margin: 8px 0 12px;
}
.ep-success-sub { font-size: 12px; color: var(--ep-muted); line-height: 1.6; margin-bottom: 16px !important; }

/* ---- Portfolio ---- */
.ep-portfolio-hero {
  margin: 0 16px 12px; border-radius: var(--ep-radius-card);
  background: linear-gradient(135deg, #10B981, #059669); color: #fff;
  padding: 18px; box-shadow: 0 8px 24px rgba(16,185,129,.28);
}
.ep-portfolio-label { font-size: 12px; opacity: .9; }
.ep-portfolio-amount { font-size: 28px; font-weight: 800; font-family: 'Space Grotesk', sans-serif; margin: 2px 0 12px; }
.ep-portfolio-stats { display: flex; gap: 10px; }
.ep-portfolio-stat { flex: 1; background: rgba(255,255,255,.15); border-radius: 12px; padding: 10px; }
.ep-portfolio-stat small { display: block; font-size: 10px; opacity: .9; }
.ep-portfolio-stat span { font-size: 16px; font-weight: 700; font-family: 'Space Grotesk', sans-serif; }

/* ---- Investment list item ---- */
.ep-inv-item {
  background: var(--ep-surface); border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-card); box-shadow: var(--ep-shadow-card);
  padding: 14px 16px; margin: 0 16px 10px;
}
.ep-inv-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ep-inv-code { font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 14px; color: var(--ep-text); }
.ep-inv-plan { font-size: 12px; color: var(--ep-muted); }
.ep-inv-status { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.ep-inv-status.pending  { background: #FFF7ED; color: #EA580C; }
.ep-inv-status.active   { background: #EEF2FF; color: #4F46E5; }
.ep-inv-status.matured  { background: #ECFDF5; color: #16A34A; }
.ep-inv-status.rejected { background: #FEF2F2; color: #DC2626; }
.ep-inv-body { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ep-inv-cell small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--ep-muted); }
.ep-inv-cell span { font-size: 14px; font-weight: 700; color: var(--ep-text); font-family: 'Space Grotesk', sans-serif; }
.ep-inv-cell span.green { color: var(--ep-green); }
.ep-inv-progress { margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--ep-primary); background: var(--ep-primary-light); border-radius: 10px; padding: 8px 10px; }
.ep-inv-progress.done { color: #16A34A; background: #ECFDF5; }
.ep-inv-progress.rejected { color: #DC2626; background: #FEF2F2; }

/* ---- Withdraw ---- */
.ep-payout-preview { background: var(--ep-bg); border-radius: 12px; padding: 10px 12px; font-size: 13px; color: var(--ep-text); margin-bottom: 4px; }
.ep-payout-preview div { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.ep-wd-badge { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.ep-wd-badge.pending    { background: #FFF7ED; color: #EA580C; }
.ep-wd-badge.processing { background: #EFF6FF; color: #2563EB; }
.ep-wd-badge.completed  { background: #ECFDF5; color: #16A34A; }
.ep-wd-badge.rejected   { background: #FEF2F2; color: #DC2626; }

/* ---- Documents ---- */
.ep-doc-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--ep-surface); border: 1px solid var(--ep-border);
  border-radius: 16px; box-shadow: var(--ep-shadow-card);
  padding: 12px 14px; margin: 0 16px 10px;
}
.ep-doc-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.ep-doc-icon.pdf { background: #FEF2F2; color: #DC2626; }
.ep-doc-icon.img { background: #EEF2FF; color: #4F46E5; }
.ep-doc-info { flex: 1; min-width: 0; }
.ep-doc-name { font-size: 14px; font-weight: 700; color: var(--ep-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-doc-sub { font-size: 11px; color: var(--ep-muted); margin: 0; }
.ep-doc-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ep-doc-btn { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--ep-border); background: var(--ep-surface); color: var(--ep-muted); display: inline-flex; align-items: center; justify-content: center; }
.ep-doc-btn.danger { color: #DC2626; border-color: #FECACA; }

/* ---- Notifications ---- */
.ep-notif-card {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--ep-surface); border: 1px solid var(--ep-border);
  border-radius: 16px; box-shadow: var(--ep-shadow-card);
  padding: 12px 14px; margin: 0 16px 10px;
}
.ep-notif-card.unread { border-left: 3px solid var(--ep-primary); background: #FCFCFF; }
.ep-notif-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.ep-notif-icon.blue   { background: #EEF2FF; color: #4F46E5; }
.ep-notif-icon.green  { background: #ECFDF5; color: #16A34A; }
.ep-notif-icon.red    { background: #FEF2F2; color: #DC2626; }
.ep-notif-icon.purple { background: #F5F3FF; color: #7C3AED; }
.ep-notif-icon.orange { background: #FFF7ED; color: #EA580C; }
.ep-notif-info { flex: 1; min-width: 0; }
.ep-notif-title { font-size: 14px; font-weight: 700; color: var(--ep-text); margin: 0; }
.ep-notif-text { font-size: 12px; color: var(--ep-muted); margin: 2px 0 0; line-height: 1.5; }
.ep-notif-time { font-size: 10px; color: var(--ep-muted); margin: 4px 0 0; }

/* ---- Dashboard portfolio summary ---- */
.ep-invest-summary {
  display: flex; align-items: stretch; gap: 4px;
  background: var(--ep-surface); border: 1px solid var(--ep-border);
  border-radius: var(--ep-radius-card); box-shadow: var(--ep-shadow-card);
  padding: 14px 8px; margin: 0 16px 8px;
}
.ep-is-cell { flex: 1; text-align: center; }
.ep-is-cell small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .03em; color: var(--ep-muted); margin-bottom: 3px; }
.ep-is-cell span { font-size: 16px; font-weight: 800; color: var(--ep-text); font-family: 'Space Grotesk', sans-serif; }
.ep-is-cell span.green { color: var(--ep-green); }
.ep-is-cell span.orange { color: #EA580C; }
.ep-is-divider { width: 1px; background: var(--ep-border); }

/* ---- One-time login popup ---- */
.ep-popup-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(18, 16, 30, .55);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: epPopupFade .22s ease;
}
.ep-popup-overlay.closing { opacity: 0; transition: opacity .18s ease; }
@keyframes epPopupFade { from { opacity: 0; } to { opacity: 1; } }
.ep-popup {
  width: 100%; max-width: 360px;
  background: var(--ep-surface);
  border-radius: var(--ep-radius-card);
  box-shadow: 0 20px 50px rgba(18,16,30,.3);
  padding: 22px 20px 20px;
  max-height: 82vh; display: flex; flex-direction: column;
  animation: epPopupIn .26s cubic-bezier(.2,.8,.3,1);
}
@keyframes epPopupIn { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.ep-popup-head { text-align: center; margin-bottom: 12px; }
.ep-popup-icon {
  width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 10px;
  background: linear-gradient(135deg, var(--ep-primary), #7C3AED);
  color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.ep-popup-title { font-size: 18px; font-weight: 800; color: var(--ep-text); margin: 0; font-family: 'Space Grotesk', sans-serif; }
.ep-popup-body {
  font-size: 13.5px; line-height: 1.65; color: var(--ep-text);
  overflow-y: auto; margin-bottom: 16px; padding: 2px 2px 0;
  -webkit-overflow-scrolling: touch;
}

/* Desktop: keep the popup inside the phone card instead of covering the page */
@media (min-width: 768px) {
  .ep-popup-overlay { position: absolute; border-radius: 44px; padding: 16px; }
  .ep-popup { max-width: 320px; max-height: 78%; }
}

/* ---- Legal page contact / social links ---- */
.ep-legal-links {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--ep-bg); border-radius: 14px; padding: 12px 14px;
}
.ep-legal-links a {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; color: var(--ep-primary); text-decoration: none;
}
.ep-legal-links a i { font-size: 15px; }
