/* ==========================================================================
   AgriFarm Design System
   ========================================================================== */

:root {
  --primary: #2f7a4d;
  --primary-dark: #1f5535;
  --primary-light: #e6f2ea;
  --accent: #d98c3b;
  --text: #1c2620;
  --muted: #5c6b62;
  --background: #fbfaf7;
  --surface: #ffffff;
  --border: #e4e2da;
  --earth: #a9714a;
  --danger: #c9432f;
  --success: #2f7a4d;

  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 8px rgba(28, 38, 32, 0.06);
  --shadow: 0 8px 30px rgba(28, 38, 32, 0.08);
  --shadow-lg: 0 20px 60px rgba(28, 38, 32, 0.14);

  --font-heading: 'Manrope', 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--background);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; color: var(--text); letter-spacing: -0.01em; }

a { color: var(--primary-dark); text-decoration: none; }
a:hover { color: var(--primary); }

img { max-width: 100%; height: auto; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.container { max-width: 1200px; }

/* ---------- Buttons ---------- */
.btn-af-primary {
  background: var(--primary);
  border: 1px solid var(--primary);
  color: #fff;
  font-weight: 600;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-af-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-af-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 600;
  padding: 0.68rem 1.5rem;
  border-radius: 999px;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.btn-af-outline:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }

.btn-af-lg { padding: 0.9rem 2rem; font-size: 1.05rem; }

.af-link-login { font-weight: 600; color: var(--text); margin-right: 0.5rem; padding: 0.6rem 0.8rem; }
.af-link-login:hover { color: var(--primary); }

/* ---------- Navbar ---------- */
.af-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(251, 250, 247, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.af-navbar .navbar { padding: 0.85rem 0; }
.af-logo { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-heading); font-weight: 800; font-size: 1.3rem; color: var(--text); }
.af-logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff; font-size: 1.1rem;
}
.af-nav-links { gap: 0.25rem; }
.af-nav-links .nav-link { font-weight: 600; color: var(--text); padding: 0.5rem 0.9rem !important; border-radius: 999px; }
.af-nav-links .nav-link:hover { background: var(--primary-light); color: var(--primary-dark); }
.af-dropdown { border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 0.4rem; }
.af-dropdown .dropdown-item { border-radius: 8px; padding: 0.5rem 0.8rem; font-weight: 500; }
.af-dropdown .dropdown-item:hover { background: var(--primary-light); color: var(--primary-dark); }
.af-nav-cta { display: flex; align-items: center; margin-left: 1rem; }
.af-nav-toggle { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); width: 42px; height: 42px; font-size: 1.3rem; }
.af-mobile-nav { width: 300px; }
.af-mobile-plain { margin-top: 1rem; }
.af-mobile-plain li a, .af-mobile-accordion a { display: block; padding: 0.6rem 0.2rem; font-weight: 600; color: var(--text); }
.af-mobile-cta { margin-top: 1.5rem; }

/* ---------- Sections ---------- */
.section { padding: 5.5rem 0; }
.section-sm { padding: 3.5rem 0; }
.section-title { font-size: clamp(1.8rem, 3vw, 2.5rem); margin-bottom: 0.75rem; }
.section-eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--primary-dark); background: var(--primary-light); padding: 0.35rem 0.85rem; border-radius: 999px;
  margin-bottom: 1rem;
}
.section-lead { color: var(--muted); font-size: 1.1rem; max-width: 640px; }
.bg-soft { background: var(--surface); }
.bg-tint { background: var(--primary-light); }

/* ---------- Hero ---------- */
.af-hero { padding: 4.5rem 0 3rem; overflow: hidden; position: relative; }
.af-hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 500px;
  background: radial-gradient(60% 60% at 30% 30%, rgba(47, 122, 77, 0.12), transparent 70%);
  z-index: 0; pointer-events: none;
}
.af-hero .container { position: relative; z-index: 1; }
.af-hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); line-height: 1.08; margin-bottom: 1.1rem; }
.af-hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 540px; }
.af-hero-cta { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 1.6rem; }
.af-hero-explore { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.4rem; font-weight: 600; }

/* Dashboard preview mock */
.af-dash-preview {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 1.1rem; position: relative;
}
.af-dash-preview .af-dash-topbar { display: flex; align-items: center; gap: 0.4rem; margin-bottom: 0.9rem; }
.af-dash-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.af-dash-dot.g { background: #9fd6b3; }
.af-dash-dot.y { background: #f1cf8a; }
.af-dash-dot.r { background: #e9a99a; }
.af-dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; }
.af-dash-stat {
  background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
}
.af-dash-stat .lbl { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.af-dash-stat .val { font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; }
.af-dash-stat .val.up { color: var(--primary); }
.af-dash-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 0.7rem; margin-top: 0.7rem; }
.af-dash-card { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.9rem; }
.af-dash-card h6 { font-size: 0.85rem; margin-bottom: 0.6rem; }
.af-chip { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 600; padding: 0.3rem 0.6rem; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); }
.af-chip.warn { background: #fbe9d0; color: #8a5a13; }
.af-task-row { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0; font-size: 0.85rem; border-bottom: 1px dashed var(--border); }
.af-task-row:last-child { border-bottom: none; }
.af-floating-badge {
  position: absolute; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; font-size: 0.8rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.5rem;
}
.af-floating-badge i { color: var(--primary); }
.af-floating-badge.weather { top: -18px; right: -18px; }
.af-floating-badge.revenue { bottom: -18px; left: -18px; }

/* ---------- Trust strip ---------- */
.af-trust-strip { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; justify-content: center; }
.af-trust-pill {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  padding: 0.55rem 1.1rem; font-weight: 600; font-size: 0.92rem; color: var(--muted);
}
.af-trust-pill i { color: var(--primary); }

/* ---------- Before / After ---------- */
.af-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.af-compare-card { border-radius: var(--radius); padding: 1.75rem; height: 100%; }
.af-compare-card.before { background: #fbf3ee; border: 1px solid #f0dccb; }
.af-compare-card.after { background: var(--primary-light); border: 1px solid #cfe6d8; }
.af-compare-card h4 { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.1rem; }
.af-compare-card ul { list-style: none; padding: 0; margin: 0; }
.af-compare-card li { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.5rem 0; font-weight: 500; }
.af-compare-card.before li i { color: var(--danger); margin-top: 0.2rem; }
.af-compare-card.after li i { color: var(--primary); margin-top: 0.2rem; }

/* ---------- Feature cards ---------- */
.feature-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.7rem; height: 100%; transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.feature-card .icon-wrap {
  width: 48px; height: 48px; border-radius: 12px; background: var(--primary-light); color: var(--primary-dark);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 1rem;
}
.feature-card h5 { margin-bottom: 0.5rem; }
.feature-card p { color: var(--muted); margin-bottom: 0; font-size: 0.95rem; }

/* ---------- Solution cards ---------- */
.solution-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; height: 100%; display: block; transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.solution-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.solution-card .icon-wrap { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }
.solution-card h5 { color: var(--text); }
.solution-card p { color: var(--muted); font-size: 0.95rem; }
.solution-card .learn-more { font-weight: 700; color: var(--primary-dark); font-size: 0.9rem; }

/* ---------- Alternating feature highlight rows ---------- */
.af-highlight-row { display: flex; align-items: center; gap: 3rem; }
.af-highlight-row.reverse { flex-direction: row-reverse; }
.af-highlight-text { flex: 1 1 0; min-width: 280px; }
.af-highlight-visual { flex: 1 1 0; min-width: 280px; }
.af-highlight-text ul { list-style: none; padding: 0; margin: 1.2rem 0 0; }
.af-highlight-text li { display: flex; gap: 0.6rem; padding: 0.4rem 0; font-weight: 500; }
.af-highlight-text li i { color: var(--primary); margin-top: 0.25rem; }

/* Crop lifecycle timeline */
.af-lifecycle { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }
.af-lifecycle-step { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.5rem; flex: 1; min-width: 90px; }
.af-lifecycle-step .dot { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; }
.af-lifecycle-step.active .dot { background: var(--primary); color: #fff; }
.af-lifecycle-step span.lbl { font-size: 0.8rem; font-weight: 700; }
.af-lifecycle-line { flex: 0.3; height: 2px; background: var(--border); min-width: 20px; }

/* Field map mock */
.af-map-mock {
  position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #eef4ea, #e4efe6); aspect-ratio: 16/11; padding: 1rem;
}
.af-map-field { position: absolute; border-radius: 10px; opacity: 0.85; display: flex; align-items: flex-end; padding: 0.4rem 0.6rem; font-size: 0.72rem; font-weight: 700; color: #1c2620; }
.af-map-legend { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1rem; }
.af-map-legend span { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.af-map-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
#af-leaflet-map { width: 100%; height: 420px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }

/* Task board mock */
.af-task-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; }
.af-task-col { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8rem; }
.af-task-col h6 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 0.7rem; }
.af-task-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 0.65rem 0.75rem; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.6rem; box-shadow: var(--shadow-sm); }
.af-task-card small { display: block; font-weight: 500; color: var(--muted); margin-top: 0.2rem; }

/* Financial chart card */
.af-finance-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; box-shadow: var(--shadow); }

/* ---------- How it works ---------- */
.af-step-card { text-align: left; padding: 1.6rem; height: 100%; }
.af-step-num { font-family: var(--font-heading); font-weight: 800; font-size: 2.2rem; color: var(--primary-light); -webkit-text-stroke: 1.5px var(--primary); display: block; margin-bottom: 0.6rem; }

/* ---------- Benefits ---------- */
.benefit-item { display: flex; gap: 0.9rem; align-items: flex-start; }
.benefit-item .icon-wrap { flex-shrink: 0; width: 42px; height: 42px; border-radius: 10px; background: var(--primary-light); color: var(--primary-dark); display: flex; align-items: center; justify-content: center; }
.benefit-item h6 { margin-bottom: 0.2rem; }
.benefit-item p { color: var(--muted); font-size: 0.9rem; margin-bottom: 0; }

/* ---------- Pricing ---------- */
.pricing-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; height: 100%; position: relative; transition: box-shadow .2s ease, transform .2s ease; }
.pricing-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.pricing-card.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.pricing-card .badge-popular { position: absolute; top: -14px; right: 1.5rem; background: var(--accent); color: #fff; font-weight: 700; padding: 0.35rem 0.9rem; border-radius: 999px; font-size: 0.78rem; }
.pricing-card .price { font-family: var(--font-heading); font-weight: 800; font-size: 2.1rem; margin: 0.6rem 0; }
.pricing-card .price small { font-size: 0.95rem; font-weight: 500; color: var(--muted); }
.pricing-card ul { list-style: none; padding: 0; margin: 1.4rem 0; }
.pricing-card li { display: flex; gap: 0.6rem; padding: 0.4rem 0; font-size: 0.92rem; }
.pricing-card li i { color: var(--primary); margin-top: 0.2rem; }

/* ---------- Stat cards ---------- */
.stat-card { text-align: center; padding: 1.4rem; }
.stat-card .num { font-family: var(--font-heading); font-weight: 800; font-size: 2.2rem; color: var(--primary-dark); }
.stat-card .lbl { color: var(--muted); font-weight: 600; font-size: 0.9rem; }

/* ---------- Testimonial (reserved, unused unless real quotes supplied) ---------- */
.testimonial-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem; }

/* ---------- CTA section ---------- */
.cta-section {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius-lg); padding: 3.5rem; color: #fff; text-align: center;
}
.cta-section h2 { color: #fff; }
.cta-section p { color: rgba(255,255,255,0.85); }
.cta-section .btn-af-outline { border-color: rgba(255,255,255,0.5); color: #fff; }
.cta-section .btn-af-outline:hover { background: rgba(255,255,255,0.12); border-color: #fff; }
.cta-section .btn-af-primary { background: #fff; color: var(--primary-dark); border-color: #fff; }
.cta-section .btn-af-primary:hover { background: #f0f0f0; }

/* ---------- Badges ---------- */
.badge-af { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; padding: 0.35rem 0.8rem; border-radius: 999px; font-size: 0.78rem; }

/* ---------- Forms ---------- */
.af-form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow); }
.af-form-card label { font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.af-form-card .form-control, .af-form-card .form-select { border-radius: 10px; border-color: var(--border); padding: 0.65rem 0.9rem; }
.af-form-card .form-control:focus, .af-form-card .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,122,77,0.15); }
.af-form-msg { border-radius: 10px; padding: 0.9rem 1.1rem; font-weight: 600; }
.af-form-msg.success { background: var(--primary-light); color: var(--primary-dark); }
.af-form-msg.error { background: #fbe6e2; color: var(--danger); }

/* ---------- FAQ ---------- */
.af-accordion .accordion-item { border: 1px solid var(--border); border-radius: var(--radius-sm) !important; margin-bottom: 0.7rem; overflow: hidden; }
.af-accordion .accordion-button { font-weight: 700; padding: 1.1rem 1.3rem; }
.af-accordion .accordion-button:not(.collapsed) { background: var(--primary-light); color: var(--primary-dark); box-shadow: none; }
.af-accordion .accordion-body { color: var(--muted); padding: 0.2rem 1.3rem 1.2rem; }

/* ---------- Blog ---------- */
.blog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; height: 100%; transition: box-shadow .2s ease, transform .2s ease; }
.blog-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.blog-card .thumb { height: 170px; background: linear-gradient(135deg, var(--primary-light), #dcebe0); display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 2rem; }
.blog-card .body { padding: 1.3rem; }
.blog-card .cat { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--primary-dark); }
.blog-card h5 { margin: 0.4rem 0 0.5rem; font-size: 1.05rem; }
.blog-card .meta { color: var(--muted); font-size: 0.82rem; }
.blog-featured { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow); }
.blog-featured .thumb { height: 260px; border-radius: var(--radius); }
.blog-article-body { max-width: 760px; margin: 0 auto; font-size: 1.05rem; }
.blog-article-body h2 { margin-top: 2rem; }
.blog-article-body p { margin-bottom: 1.2rem; color: var(--text); }

/* ---------- Auth pages ---------- */
.af-auth-wrap { min-height: 60vh; display: flex; align-items: center; }
.af-auth-card { max-width: 440px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2.2rem; box-shadow: var(--shadow); }

/* ---------- Footer ---------- */
.af-footer { background: #16241b; color: #cfe0d4; padding: 4rem 0 1.5rem; margin-top: 3rem; }
.af-footer .af-logo { color: #fff; }
.af-footer-top { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 2rem; padding-bottom: 2.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.af-footer-brand p { color: #9db3a4; margin-top: 0.8rem; max-width: 260px; font-size: 0.9rem; }
.af-footer-col h6 { color: #fff; font-weight: 700; margin-bottom: 1rem; font-size: 0.9rem; }
.af-footer-col ul { list-style: none; padding: 0; margin: 0; }
.af-footer-col li { margin-bottom: 0.6rem; }
.af-footer-col a { color: #9db3a4; font-size: 0.9rem; }
.af-footer-col a:hover { color: #fff; }
.af-footer-bottom { padding-top: 1.5rem; text-align: center; color: #7f9689; font-size: 0.85rem; }

/* ---------- Scroll animations ---------- */
.af-reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.af-reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .af-reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .af-hero { padding: 2.5rem 0 2rem; text-align: center; }
  .af-hero .lead { margin-left: auto; margin-right: auto; }
  .af-hero-cta, .af-hero-explore { justify-content: center; }
  .af-highlight-row, .af-highlight-row.reverse { flex-direction: column; }
  .af-compare { grid-template-columns: 1fr; }
  .af-footer-top { grid-template-columns: 1fr 1fr; }
  .blog-featured { grid-template-columns: 1fr; }
  .af-task-board { grid-template-columns: 1fr; }
  .section { padding: 3.5rem 0; }
}
@media (max-width: 767.98px) {
  .af-dash-grid { grid-template-columns: repeat(2, 1fr); }
  .af-dash-row { grid-template-columns: 1fr; }
  .af-footer-top { grid-template-columns: 1fr; }
  .af-floating-badge { display: none; }
  .af-lifecycle { flex-direction: column; }
  .af-lifecycle-line { width: 2px; height: 20px; }
}
