:root {
  --navy-bg: #0f172a;
  --navy-card: #1e293b;
  --pink-primary: #d946ef;
  --pink-hover: #c026d3;
  --green-primary: #16a34a;
  --green-hover: #15803d;
  --green-light: #22c55e;
  --yellow-accent: #facc15;
  --text-white: #ffffff;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--navy-bg);
  color: var(--text-white);
  min-height: 100vh;
  padding-bottom: 80px;
}

.brand-logo {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
}

.header-logo {
  height: 36px;
  width: auto;
  display: block;
}

/* ---------- Dashboard ---------- */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background-color: var(--navy-bg);
}

.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: 1px; }

.user-info {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  font-size: 1rem;
}

.user-name { color: var(--yellow-accent); font-weight: bold; }
.balance { color: var(--yellow-accent); text-align: right; }

.action-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  padding: 20px;
  text-align: center;
}

.action-btn {
  background-color: var(--pink-primary);
  border-radius: 12px;
  padding: 15px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s;
}

.action-btn:hover { background-color: var(--pink-hover); }
.action-btn i { font-size: 1.5rem; margin-bottom: 5px; }
.action-btn span { font-size: 0.8rem; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding: 0 20px;
}

.stat-card {
  background-color: var(--pink-primary);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card h3 { font-size: 1.5rem; margin-bottom: 5px; }
.stat-card p { font-size: 0.85rem; opacity: 0.9; }

.invite-card {
  background-color: var(--pink-primary);
  margin: 20px;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.referral-box {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 12px;
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: monospace;
  font-size: 1rem;
  font-weight: bold;
}

.referral-box button {
  background: var(--yellow-accent);
  color: var(--navy-bg);
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  font-size: 0.8rem;
}

.referral-box button:hover { opacity: 0.85; }

body.green-theme .action-btn { background-color: var(--green-primary); }
body.green-theme .action-btn:hover { background-color: var(--green-hover); }
body.green-theme .stat-card { background-color: var(--green-primary); }
body.green-theme .invite-card { background-color: var(--green-primary); }
body.green-theme .bottom-nav { background-color: var(--green-primary); }

/* ---------- Site Footer ---------- */
.site-footer {
  margin: 30px 20px 0;
  padding: 30px 20px;
  border-top: 1px solid #334155;
  text-align: center;
}

.footer-logo img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 12px;
  display: inline-block;
}

.footer-brand {
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--yellow-accent);
  margin-bottom: 4px;
}

.footer-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-links a { color: var(--text-muted); text-decoration: none; transition: 0.15s; }
.footer-links a:hover { color: var(--yellow-accent); }
.footer-links span { color: #334155; }

.footer-copy { font-size: 0.7rem; color: #64748b; letter-spacing: 0.3px; }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--pink-primary);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  color: white;
  text-decoration: none;
  gap: 4px;
}

.nav-item i { font-size: 1.1rem; }

/* ---------- Auth Pages ---------- */
.auth-container {
  max-width: 420px;
  margin: 0 auto;
  padding: 30px 20px;
}

.auth-header {
  text-align: center;
  margin-bottom: 25px;
}

.auth-header h2 { font-size: 1.5rem; margin-bottom: 6px; }
.auth-header p { color: var(--text-muted); font-size: 0.85rem; }

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

.form-group { margin-bottom: 15px; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input {
  width: 100%;
  padding: 13px;
  border-radius: 8px;
  border: 1px solid #334155;
  background-color: var(--navy-bg);
  color: white;
  font-size: 1rem;
  outline: none;
  transition: 0.2s;
}

.form-group input:focus { border-color: var(--yellow-accent); }

.btn-primary {
  width: 100%;
  padding: 14px;
  background-color: var(--yellow-accent);
  color: var(--navy-bg);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  transition: 0.2s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

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

.auth-footer a {
  color: var(--yellow-accent);
  text-decoration: none;
  font-weight: bold;
}

.auth-footer a:hover { text-decoration: underline; }

/* ---------- Messages ---------- */
.message {
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
  padding: 10px;
  border-radius: 8px;
  display: none;
}

.message.error {
  display: block;
  background-color: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border: 1px solid #f87171;
}

.message.success {
  display: block;
  background-color: rgba(34, 197, 94, 0.15);
  color: #4ade80;
  border: 1px solid #34d399;
}

#logoutBtn:hover { background-color: #dc2626 !important; }

/* ---------- Floating WhatsApp Button ---------- */
.wa-float {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #25d366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: wa-pulse 2s infinite;
}

.wa-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.7);
}

.wa-float i { line-height: 1; }

@keyframes wa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
  70%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@media (max-width: 380px) {
  .wa-float {
    width: 42px;
    height: 42px;
    font-size: 1.3rem;
    top: 14px;
    right: 14px;
  }
  .brand-logo { width: 66px; height: 66px; }
  .header-logo { height: 30px; }
  .footer-logo img { width: 50px; height: 50px; }
  .form-row { grid-template-columns: 1fr; }
}