/* =============================================
   AgroLestari Smart Hub — Custom Styles
   ============================================= */

:root {
  --forest:    #1A3D1B;
  --green:     #2C5F2D;
  --moss:      #97BC62;
  --gold:      #D4A24C;
  --gold-2:    #B88A3A;
  --terracotta:#C2603F;
  --cream:     #F5F1E8;
  --paper:     #FAF7F0;
  --ink:       #1F2A1D;
  --line:      #D9D2C2;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { font-family: 'Inter', sans-serif; background: var(--paper); color: var(--ink); overflow-x: hidden; }
h1, h2, h3, h4 { font-family: 'Playfair Display', Georgia, serif; }

/* ===== Selection ===== */
::selection { background: var(--gold); color: var(--forest); }

/* ===== Custom scrollbar ===== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--green); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--forest); }

/* ===== Utility ===== */
.eyebrow { letter-spacing: 0.35em; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.gold-divider { display: inline-block; width: 60px; height: 4px; background: var(--gold); margin: 0.5rem 0; border-radius: 2px; }
.sec { padding: 5rem 1.5rem; }
@media (min-width: 768px) { .sec { padding: 7rem 2rem; } }
.shadow-soft { box-shadow: 0 4px 24px -4px rgba(26, 61, 27, 0.12); }
.shadow-elev { box-shadow: 0 18px 50px -18px rgba(26, 61, 27, 0.30); }

/* ===== Preloader ===== */
.preloader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--forest); display: flex; align-items: center; justify-content: center; flex-direction: column;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.preloader.hidden { opacity: 0; visibility: hidden; }
.preloader-logo {
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--gold); display: flex; align-items: center; justify-content: center;
  animation: pulse-ring 1.6s ease-out infinite;
}
.preloader-logo i { color: var(--forest); font-size: 2.4rem; }
.preloader-text {
  margin-top: 1.5rem; color: white; font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 700; letter-spacing: 0.2em;
}
.preloader-bar {
  margin-top: 1.5rem; width: 200px; height: 2px; background: rgba(255,255,255,0.2); position: relative; overflow: hidden;
}
.preloader-bar::after {
  content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 40%;
  background: var(--gold); animation: load-bar 1.4s ease-in-out infinite;
}
@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(212,162,76,0.7); }
  70%  { box-shadow: 0 0 0 26px rgba(212,162,76,0); }
  100% { box-shadow: 0 0 0 0 rgba(212,162,76,0); }
}
@keyframes load-bar {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ===== Scroll progress bar ===== */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; background: linear-gradient(90deg, var(--gold), var(--moss));
  z-index: 100; width: 0%; transition: width 0.05s linear;
}

/* ===== Navbar ===== */
.nav-base { transition: all 0.35s ease; }
.nav-scrolled {
  background: rgba(26, 61, 27, 0.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; left: 50%; bottom: -6px; width: 0; height: 2px;
  background: var(--gold); transition: all 0.3s ease; transform: translateX(-50%);
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Lang toggle pill */
.lang-toggle {
  display: inline-flex; background: rgba(255,255,255,0.1); border: 1px solid rgba(212,162,76,0.4);
  border-radius: 999px; padding: 3px; font-size: 11px; font-weight: 700;
}
.lang-btn { padding: 4px 10px; border-radius: 999px; color: rgba(255,255,255,0.7); transition: all 0.2s; cursor: pointer; }
.lang-btn.active { background: var(--gold); color: var(--forest); }

/* ===== Hero ===== */
.hero-bg {
  background:
    linear-gradient(135deg, rgba(26,61,27,0.92) 0%, rgba(26,61,27,0.78) 55%, rgba(44,95,45,0.68) 100%),
    url('https://images.unsplash.com/photo-1500382017468-9049fed747ef?auto=format&fit=crop&w=1920&q=80');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
@media (max-width: 768px) { .hero-bg { background-attachment: scroll; } }

/* Floating leaf particles */
.leaf-particle {
  position: absolute; color: rgba(151, 188, 98, 0.18); pointer-events: none;
  animation: float-leaf 14s linear infinite;
}
@keyframes float-leaf {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(110vh) rotate(420deg); opacity: 0; }
}

/* Live status badge */
.live-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; background: rgba(151,188,98,0.18); border: 1px solid rgba(151,188,98,0.4);
  border-radius: 999px; color: var(--moss); font-size: 11px; font-weight: 700; letter-spacing: 0.15em;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #4ade80;
  animation: pulse-dot 1.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6); }
  50%      { opacity: 0.7; box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
}

/* Tag chips */
.chip {
  display: inline-flex; align-items: center; padding: 0.35rem 0.9rem;
  border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.1); color: var(--cream);
  border: 1px solid rgba(212, 162, 76, 0.4);
  transition: all 0.2s;
}
.chip:hover { background: rgba(212, 162, 76, 0.2); transform: translateY(-2px); }

/* ===== Buttons ===== */
.btn-gold {
  background: var(--gold); color: var(--forest); padding: 14px 32px; border-radius: 999px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 10px;
  transition: all 0.25s; box-shadow: 0 6px 20px -6px rgba(212,162,76,0.6);
}
.btn-gold:hover { background: white; transform: translateY(-2px); box-shadow: 0 10px 28px -8px rgba(212,162,76,0.7); }
.btn-outline {
  background: transparent; color: white; padding: 14px 32px; border-radius: 999px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 10px;
  border: 2px solid white; transition: all 0.25s;
}
.btn-outline:hover { background: white; color: var(--forest); }

/* ===== Stat cards with count-up ===== */
.stat-card {
  background: white; padding: 1.75rem; border-radius: 8px; border-left: 4px solid var(--gold);
  box-shadow: 0 4px 20px -8px rgba(26,61,27,0.15); transition: all 0.3s;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; right: -40px; width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(212,162,76,0.1), transparent 70%);
}
.stat-card:hover { transform: translateY(-6px); box-shadow: 0 18px 35px -12px rgba(26,61,27,0.25); }
.stat-num { font-family: 'Playfair Display', serif; font-size: 4rem; font-weight: 800; color: var(--green); line-height: 1; }
@media (min-width: 768px) { .stat-num { font-size: 5rem; } }

/* ===== Section titles ===== */
.sec-title { font-size: 2rem; font-weight: 800; color: var(--forest); }
@media (min-width: 768px) { .sec-title { font-size: 3rem; } }

/* ===== Site Map (SVG zones) ===== */
.zone {
  cursor: pointer; transition: all 0.3s;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}
.zone:hover { transform: translateY(-2px); filter: drop-shadow(0 8px 16px rgba(0,0,0,0.25)); }
.zone-label { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 16px; fill: white; pointer-events: none; }
.zone-info {
  background: white; padding: 1.5rem; border-radius: 8px; border-left: 4px solid var(--gold);
  box-shadow: 0 8px 30px -10px rgba(26,61,27,0.2); min-height: 200px;
}
.zone-info-title { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.5rem; color: var(--forest); }

/* ===== Module cards ===== */
.module-card {
  background: white; border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 20px -8px rgba(26,61,27,0.15);
  transition: all 0.4s cubic-bezier(.4, 0, .2, 1);
  cursor: pointer; position: relative;
  display: flex; flex-direction: column;
}
.module-card:hover { transform: translateY(-8px); box-shadow: 0 25px 50px -15px rgba(26,61,27,0.25); }
.module-card .accent-bar {
  height: 4px; width: 30%; transition: width 0.4s ease;
}
.module-card:hover .accent-bar { width: 100%; }
.module-card .mod-num {
  position: absolute; top: 1rem; right: 1.25rem;
  font-family: 'Playfair Display', serif; font-size: 3rem; font-weight: 800; color: rgba(0,0,0,0.06); line-height: 1;
}
.mod-ic {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.4rem;
  box-shadow: 0 8px 18px -6px currentColor;
}

/* Module modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(26,61,27,0.85); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; visibility: hidden; transition: all 0.3s;
  backdrop-filter: blur(6px);
}
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal-content {
  background: white; border-radius: 16px; max-width: 720px; width: 100%; max-height: 92vh; overflow-y: auto;
  transform: scale(0.94) translateY(20px); transition: transform 0.35s cubic-bezier(.34,1.56,.64,1);
}
.modal-backdrop.open .modal-content { transform: scale(1) translateY(0); }

/* ===== Live Dashboard Mockup ===== */
.dash-frame {
  background: linear-gradient(160deg, #0f1f10 0%, #1A3D1B 100%);
  border-radius: 18px; padding: 1.5rem; box-shadow: 0 30px 70px -25px rgba(26,61,27,0.55);
  border: 1px solid rgba(212,162,76,0.3);
  position: relative; overflow: hidden;
}
.dash-frame::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--moss), var(--gold));
}
.dash-card {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(151,188,98,0.15);
  border-radius: 12px; padding: 1rem; transition: all 0.3s;
}
.dash-card:hover { background: rgba(151,188,98,0.08); border-color: rgba(212,162,76,0.4); }
.dash-metric { font-family: 'Playfair Display', serif; font-size: 1.85rem; font-weight: 800; color: white; line-height: 1; }
.dash-label { font-size: 0.65rem; letter-spacing: 0.2em; color: var(--moss); text-transform: uppercase; font-weight: 700; }
.dash-trend-up { color: #4ade80; font-size: 0.75rem; font-weight: 700; }
.dash-trend-down { color: #fb7185; font-size: 0.75rem; font-weight: 700; }
.dash-bar { height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.dash-bar-fill { height: 100%; background: linear-gradient(90deg, var(--moss), var(--gold)); transition: width 0.6s ease; }

/* ===== Phase cards ===== */
.phase-card {
  background: white; border-radius: 12px; overflow: hidden;
  box-shadow: 0 6px 24px -10px rgba(26,61,27,0.18);
  transition: all 0.3s; position: relative;
}
.phase-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px -15px rgba(26,61,27,0.25); }
.phase-card::after {
  content: ''; position: absolute; right: -12px; top: 38px; width: 24px; height: 2px;
  background: var(--gold); opacity: 0.5;
}
.phase-card:last-child::after { display: none; }
@media (max-width: 1023px) { .phase-card::after { display: none; } }

/* ===== ROI Calculator ===== */
.roi-input { width: 100%; padding: 12px 16px; border: 2px solid var(--line); border-radius: 8px;
  font-size: 16px; transition: all 0.2s; background: white; }
.roi-input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 4px rgba(212,162,76,0.15); }
.roi-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--line); outline: none; }
.roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); border: 3px solid white; cursor: pointer; box-shadow: 0 4px 12px rgba(212,162,76,0.5);
}
.roi-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); border: 3px solid white; cursor: pointer;
}
.roi-result {
  background: linear-gradient(135deg, var(--forest), var(--green));
  color: white; padding: 1.5rem; border-radius: 12px; margin-top: 1rem;
  border: 1px solid rgba(212,162,76,0.3);
}

/* ===== FAQ Accordion ===== */
.faq-item {
  background: white; border-radius: 10px; margin-bottom: 12px; overflow: hidden;
  border: 1px solid var(--line); transition: all 0.3s;
}
.faq-item.open { border-color: var(--gold); box-shadow: 0 8px 24px -10px rgba(212,162,76,0.3); }
.faq-question {
  padding: 1.25rem 1.5rem; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; color: var(--ink); transition: color 0.2s;
}
.faq-question:hover { color: var(--green); }
.faq-item.open .faq-question { color: var(--green); }
.faq-icon { transition: transform 0.3s; color: var(--gold); font-size: 1.2rem; }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0; overflow: hidden; transition: max-height 0.4s ease, padding 0.3s;
  padding: 0 1.5rem; color: #555; line-height: 1.7;
}
.faq-item.open .faq-answer { max-height: 400px; padding: 0 1.5rem 1.5rem; }

/* ===== Testimonials ===== */
.testimonial {
  background: white; padding: 2rem; border-radius: 14px; box-shadow: 0 8px 30px -12px rgba(26,61,27,0.15);
  border-top: 4px solid var(--gold); position: relative;
}
.testimonial-quote { font-family: 'Playfair Display', serif; color: rgba(212,162,76,0.2); font-size: 6rem; line-height: 1; position: absolute; top: -10px; left: 18px; }

/* ===== Form ===== */
.input-dark {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); color: white;
  padding: 14px 18px; border-radius: 10px; transition: all 0.2s; width: 100%;
}
.input-dark::placeholder { color: rgba(255,255,255,0.5); }
.input-dark:focus { border-color: var(--gold); outline: none; background: rgba(255,255,255,0.12); box-shadow: 0 0 0 3px rgba(212,162,76,0.15); }

/* ===== Floats / FAB ===== */
.fab {
  position: fixed; right: 24px; z-index: 90; width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; transition: all 0.25s; cursor: pointer;
}
.fab-wa { bottom: 24px; background: #25D366; color: white; box-shadow: 0 10px 28px -6px rgba(37,211,102,0.55); }
.fab-wa:hover { transform: scale(1.1) rotate(-6deg); }
.fab-top {
  bottom: 92px; background: var(--forest); color: var(--gold);
  box-shadow: 0 10px 28px -6px rgba(26,61,27,0.45);
  opacity: 0; visibility: hidden; transform: translateY(20px);
}
.fab-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.fab-top:hover { background: var(--gold); color: var(--forest); }

/* ===== Subtle leaf pattern bg ===== */
.leaf-pattern {
  background-image: radial-gradient(circle at 1px 1px, rgba(151,188,98,0.18) 1.2px, transparent 0);
  background-size: 26px 26px;
}

/* ===== Reveal helpers ===== */
.fade-in-up { opacity: 0; transform: translateY(20px); transition: all 0.7s ease; }
.fade-in-up.visible { opacity: 1; transform: translateY(0); }

/* ===== Marquee for partner logos / fact strip ===== */
.marquee-track { display: flex; animation: marquee 30s linear infinite; gap: 3rem; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
