/* ============================================================
   AgroRise — Page-Specific Styles
   ============================================================ */

/* ============================================================
   Landing page
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--topbar-height);
  overflow: hidden;
  background: var(--gradient-hero);
}
.hero .hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(700px 500px at 70% 40%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(700px 500px at 70% 40%, black 30%, transparent 75%);
  opacity: 0.5;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--space-12);
  padding-block: var(--space-12);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-13);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-5);
}
.hero-badge .pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); animation: pulse 1.8s infinite; }
.hero h1 { margin-bottom: var(--space-5); }
.hero .hero-sub { font-size: var(--fs-18); color: var(--text-secondary); max-width: 520px; line-height: var(--lh-loose); margin-bottom: var(--space-8); }
.hero-cta { display: flex; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-10); }
.hero-trust { display: flex; gap: var(--space-8); flex-wrap: wrap; }
.hero-trust .trust-item { display: flex; align-items: center; gap: 8px; font-size: var(--fs-14); color: var(--text-secondary); }
.hero-trust .trust-item svg { width: 18px; height: 18px; color: var(--success); }

/* Hero visual card stack */
.hero-visual { position: relative; height: 520px; }
.hero-chart-card {
  position: absolute;
  top: 40px; left: 0; right: 0;
  height: 320px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  z-index: 2;
}
.hero-chart-card .chart-mini { height: 200px; }
.float-card {
  position: absolute;
  z-index: 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: float 5s ease-in-out infinite;
}
.float-card .fc-label { font-size: var(--fs-12); color: var(--text-secondary); }
.float-card .fc-value { font-size: var(--fs-18); font-weight: var(--fw-extrabold); }
.float-card .fc-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.float-card .fc-ico svg { width: 20px; height: 20px; }
.float-card.fc-1 { top: 300px; left: -40px; animation-delay: 0.5s; }
.float-card.fc-2 { bottom: 30px; right: 20px; animation-delay: 1.4s; }
.float-card.fc-3 { top: 380px; left: 60px; animation-delay: 2.2s; }

/* Growing plant illustration */
.plant-stage { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 1; opacity: 0.9; }
.plant-stage .plant { animation: growPlant 3s var(--ease-out) both; }
.plant-stage svg { width: 160px; height: auto; }

/* Trust section */
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.trust-card { text-align: left; }
.trust-card .trust-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); margin-bottom: var(--space-5); }
.trust-card .trust-ico svg { width: 26px; height: 26px; }
.trust-card h3 { font-size: var(--fs-18); margin-bottom: var(--space-2); }
.trust-card p { font-size: var(--fs-14); color: var(--text-secondary); line-height: var(--lh-loose); }

/* Stats strip */
.stats-strip {
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  padding: var(--space-12);
  color: #fff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  position: relative;
  overflow: hidden;
}
.stats-strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(400px 200px at 20% 0%, rgba(255,255,255,0.14), transparent);
}
.stat-block { position: relative; z-index: 1; }
.stat-block .stat-num { font-size: var(--fs-40); font-weight: var(--fw-extrabold); }
.stat-block .stat-label { font-size: var(--fs-14); opacity: 0.9; margin-top: 4px; }

/* How it works */
.step-card { position: relative; }
.step-num {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-20);
  font-weight: var(--fw-extrabold);
  display: grid;
  place-items: center;
  margin-bottom: var(--space-5);
  position: relative;
}
.step-card:nth-child(even) .step-num { background: rgba(212, 163, 115, 0.2); color: var(--brand-accent); }

/* Testimonial card */
.testimonial-card { padding: var(--space-8); position: relative; }
.testimonial-card .quote-mark { font-size: var(--fs-56); line-height: 1; color: var(--primary-soft); font-family: Georgia, serif; position: absolute; top: 20px; right: 28px; }
.testimonial-card .testi-stars { color: var(--brand-accent); margin-bottom: var(--space-4); font-size: var(--fs-16); }
.testimonial-card p { font-size: var(--fs-16); line-height: var(--lh-loose); color: var(--text-primary); }
.testimonial-card .testi-author { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-6); }
.testimonial-card .testi-author b { display: block; font-size: var(--fs-14); }
.testimonial-card .testi-author span { font-size: var(--fs-12); color: var(--text-secondary); }

/* CTA banner */
.cta-banner {
  position: relative;
  overflow: hidden;
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  padding: var(--space-16) var(--space-12);
  text-align: center;
  color: #fff;
}
.cta-banner h2 { color: #fff; font-size: var(--fs-40); margin-bottom: var(--space-4); }
.cta-banner p { opacity: 0.9; font-size: var(--fs-18); max-width: 520px; margin: 0 auto var(--space-8); }
.cta-banner .btn-white { background: #fff; color: var(--brand-primary); }
.cta-banner .btn-white:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(0,0,0,0.2); }
.cta-banner .floating-coin { position: absolute; opacity: 0.5; animation: float 6s ease-in-out infinite; }

/* Newsletter */
.newsletter-form { display: flex; gap: var(--space-2); max-width: 420px; }
.newsletter-form input { background: var(--bg-app); }

/* ============================================================
   Package detail / pricing
   ============================================================ */
.package-hero-img { height: 240px; border-radius: var(--radius-lg); display: grid; place-items: center; position: relative; overflow: hidden; }
.package-hero-img svg { width: 90px; height: 90px; color: var(--primary-contrast); }

/* My packages */
.my-package-card .mp-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.my-package-card .mp-meta { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-top: var(--space-5); }
.my-package-card .mp-actions { display: flex; gap: var(--space-3); margin-top: var(--space-6); }

/* Wallet balance card */
.wallet-balance {
  position: relative;
  overflow: hidden;
  background: var(--gradient-brand);
  border-radius: var(--radius-lg);
  color: #fff;
  padding: var(--space-8);
}
.wallet-balance::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(300px 160px at 90% 10%, rgba(255,255,255,0.18), transparent 60%);
}
.wallet-balance .wb-label { font-size: var(--fs-14); opacity: 0.9; display: flex; align-items: center; gap: 8px; }
.wallet-balance .wb-amount { font-size: var(--fs-40); font-weight: var(--fw-extrabold); margin-top: var(--space-3); }
.wallet-balance .wb-sub { opacity: 0.85; font-size: var(--fs-13); margin-top: var(--space-2); }
.wallet-balance .wb-actions { display: flex; gap: var(--space-3); margin-top: var(--space-6); flex-wrap: wrap; position: relative; z-index: 1; }
.wallet-balance .btn-light { background: rgba(255,255,255,0.16); color: #fff; border: 1px solid rgba(255,255,255,0.28); backdrop-filter: blur(4px); }
.wallet-balance .btn-light:hover { background: rgba(255,255,255,0.26); color: #fff; }

/* Referral */
.referral-card { text-align: center; padding: var(--space-8); }
.referral-code { font-family: monospace; font-size: var(--fs-20); font-weight: var(--fw-bold); letter-spacing: 0.1em; color: var(--primary); }

/* Profile header */
.profile-hero { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; }
.profile-hero .profile-info b { font-size: var(--fs-24); display: block; }
.profile-hero .profile-info span { color: var(--text-secondary); font-size: var(--fs-14); }

/* KYC progress */
.kyc-steps { display: flex; align-items: center; gap: 0; }
.kyc-step { flex: 1; text-align: center; position: relative; }
.kyc-step .kyc-dot {
  width: 34px; height: 34px;
  border-radius: 50%;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  background: var(--bg-surface);
  color: var(--text-disabled);
  border: 2px solid var(--border);
  font-size: var(--fs-13);
  font-weight: var(--fw-bold);
  transition: all var(--transition) ease;
  position: relative;
  z-index: 1;
}
.kyc-step.active .kyc-dot { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); box-shadow: 0 0 0 4px var(--primary-soft); }
.kyc-step.done .kyc-dot { background: var(--success); border-color: var(--success); color: #fff; }
.kyc-step .kyc-label { font-size: var(--fs-12); color: var(--text-secondary); }
.kyc-step.active .kyc-label { color: var(--primary); font-weight: var(--fw-semibold); }
.kyc-line { height: 3px; flex: 1; background: var(--border); border-radius: 3px; margin-bottom: 26px; position: relative; }
.kyc-line.filled { background: var(--gradient-brand); }

/* ============================================================
   Admin
   ============================================================ */
.sys-health-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.sys-health-item { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: 14px; background: var(--bg-surface); }
.sys-health-item .sh-info { flex: 1; }
.sys-health-item .sh-name { font-size: var(--fs-13); font-weight: var(--fw-medium); }
.sys-health-item .sh-val { font-size: var(--fs-12); color: var(--text-secondary); }

.draggable-row { display: flex; align-items: center; gap: var(--space-3); padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-card); margin-bottom: var(--space-3); cursor: grab; }
.draggable-row:active { cursor: grabbing; }
.draggable-row .drag-handle { color: var(--text-disabled); }
.draggable-row .drag-handle svg { width: 18px; height: 18px; }

/* Role badge colors */
.role-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--radius-pill); font-size: var(--fs-12); font-weight: var(--fw-semibold); }
.role-pill.admin { background: var(--danger-bg); color: var(--danger); }
.role-pill.moderator { background: var(--warning-bg); color: var(--warning); }
.role-pill.user { background: var(--info-bg); color: var(--info); }

/* ============================================================
   Error pages
   ============================================================ */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}
.error-page .error-code {
  font-size: clamp(96px, 20vw, 180px);
  font-weight: var(--fw-extrabold);
  line-height: 1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}
.error-page .error-art { width: 160px; height: 160px; margin-bottom: var(--space-6); }
.error-page h1 { font-size: var(--fs-32); margin-bottom: var(--space-3); }
.error-page p { color: var(--text-secondary); max-width: 440px; margin-bottom: var(--space-8); }

/* Maintenance / offline */
.maintenance-screen { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6); }
.maintenance-card { text-align: center; max-width: 520px; }
.maintenance-card .maint-art { width: 140px; height: 140px; margin: 0 auto var(--space-6); animation: float 5s ease-in-out infinite; }

/* Login page featured panel (used on landing auth) */
.feature-list { display: flex; flex-direction: column; gap: var(--space-4); }
.feature-list li { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-14); color: var(--text-secondary); }
.feature-list li svg { width: 20px; height: 20px; color: var(--success); flex-shrink: 0; }

/* ============================================================
   Help / support
   ============================================================ */
.support-card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.support-card .support-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.support-card .support-ico svg { width: 24px; height: 24px; }

/* Chat placeholder */
.chat-placeholder { height: 380px; display: flex; flex-direction: column; }
.chat-bubble { max-width: 75%; padding: 12px 16px; border-radius: 16px; font-size: var(--fs-14); line-height: var(--lh-normal); margin-bottom: var(--space-3); }
.chat-bubble.bot { background: var(--bg-surface); border-bottom-left-radius: 4px; align-self: flex-start; }
.chat-bubble.user { background: var(--gradient-brand); color: var(--primary-contrast); border-bottom-right-radius: 4px; align-self: flex-end; }
.chat-input-row { display: flex; gap: var(--space-2); margin-top: auto; }
.chat-input-row input { flex: 1; }

/* Data table row actions */
.row-actions { display: flex; gap: 6px; }
.row-actions button { padding: 7px; border-radius: 9px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary); display: grid; place-items: center; transition: all var(--transition-fast); }
.row-actions button svg { width: 16px; height: 16px; }
.row-actions button:hover { color: var(--primary); border-color: var(--primary); }
.row-actions button.danger:hover { color: var(--danger); border-color: var(--danger); }

/* QR placeholder */
.qr-placeholder {
  width: 180px; height: 180px;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  display: grid;
  place-items: center;
  position: relative;
}
.qr-placeholder svg { width: 120px; height: 120px; color: var(--text-primary); opacity: 0.85; }

/* ============================================================
   Referral downline tree
   ============================================================ */
.tree-list { list-style: none; margin: 0; padding: 0; }
.tree-node.collapsed > .tree-children { display: none; }
.tree-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
}
.tree-row:hover { background: var(--bg-surface); }
.tree-toggle {
  width: 26px; height: 26px; border: 0; background: var(--bg-surface);
  border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary); flex-shrink: 0;
}
.tree-toggle svg { width: 14px; height: 14px; transition: transform .2s ease; }
.tree-toggle.open svg { transform: rotate(180deg); }
.tree-toggle.leaf { cursor: default; background: transparent; }
.tree-leaf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-disabled); }
.tree-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.tree-children { position: relative; margin-left: 18px; padding-left: 10px; }
.tree-children .tree-line {
  position: absolute; left: 0; top: 4px; bottom: 4px; width: 1px; background: var(--border);
}
.tree-children .tree-list { margin-top: 2px; }
.tree-node > .tree-children .tree-row { margin-left: 6px; }
