/* ============================================================
   AGRIKARM — Legal & Support Center
   Brand palette derived from the app (#78B948 primary green),
   Kumbh Sans typography fallback stack. Mobile-first, accessible.
   ============================================================ */

:root {
  --brand: #78b948;
  --brand-dark: #4e7d2a;
  --brand-darker: #3a5f1f;
  --brand-tint: #eef6e6;
  --ink: #1f2a17;
  --body: #37423a;
  --muted: #667066;
  --line: #e2e8dd;
  --bg: #ffffff;
  --bg-soft: #f6f9f2;
  --warn-bg: #fff8e6;
  --warn-line: #f0d98a;
  --danger: #c0392b;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 2px 10px rgba(31, 42, 23, 0.06);
  --shadow-lg: 0 8px 30px rgba(31, 42, 23, 0.10);
  --maxw: 960px;
  --font: "Kumbh Sans", "Segoe UI", Roboto, system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.5rem); margin: 0 0 .5rem; }
h2 { font-size: clamp(1.35rem, 3.2vw, 1.8rem); margin: 2rem 0 .75rem; }
h3 { font-size: clamp(1.1rem, 2.4vw, 1.25rem); margin: 1.5rem 0 .5rem; }

p { margin: 0 0 1rem; }

a { color: var(--brand-dark); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--brand-darker); }

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- Skip link ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand-dark);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__logo { width: auto; height: 40px; flex: 0 0 auto; display: block; }
.brand__logo--footer { height: 46px; background: #fff; padding: 6px 10px; border-radius: 10px; }
.brand__name { font-weight: 800; font-size: 1.25rem; color: var(--brand-dark); letter-spacing: .5px; }
.brand__name span { color: var(--brand); }

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav__toggle span {
  width: 24px; height: 2px; background: var(--brand-dark); border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav__links { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.nav__links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--body);
  font-weight: 500;
  font-size: .95rem;
}
.nav__links a:hover, .nav__links a[aria-current="page"] {
  background: var(--brand-tint);
  color: var(--brand-darker);
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--brand-darker), var(--brand-dark));
  color: #fff;
  padding: clamp(2.5rem, 7vw, 4.5rem) 0;
}
.hero h1 { color: #fff; }
.hero__badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .85rem;
  margin-bottom: 1rem;
}
.hero p { color: #eaf3e0; max-width: 60ch; }
.hero__meta { margin-top: 1rem; font-size: .9rem; color: #d6e8c6; }

/* ---- Sections ---- */
.section { padding: clamp(2rem, 5vw, 3.25rem) 0; }
.section--soft { background: var(--bg-soft); }
.page { padding: clamp(1.75rem, 4vw, 2.75rem) 0 3rem; }
.section-title { text-align: center; }
.section-subtitle { text-align: center; color: var(--muted); max-width: 62ch; margin: 0 auto 1.5rem; }

.updated { color: var(--muted); font-size: .9rem; margin: 0 0 1.5rem; }

/* ---- Breadcrumb ---- */
.crumb { font-size: .88rem; color: var(--muted); margin: 0 0 1rem; }
.crumb a { color: var(--muted); }

/* ---- Cards grid ---- */
.grid { display: grid; gap: 18px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.card__icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-dark);
  font-size: 1.4rem; margin-bottom: 12px;
}
.card h3 { margin: .25rem 0 .4rem; }
.card p { color: var(--muted); margin: 0; font-size: .95rem; }
.card__link { margin-top: 10px; font-weight: 600; color: var(--brand-dark); font-size: .9rem; }

/* ---- Prose (legal body) ---- */
.prose { max-width: 760px; }
.prose ul, .prose ol { padding-left: 1.4rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .4rem; }
.prose h2 { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.prose h2:first-of-type { border-top: 0; padding-top: 0; }

/* ---- Callouts ---- */
.callout {
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 16px 18px;
  margin: 1.25rem 0;
}
.callout--warn { border-left-color: var(--warn-line); background: var(--warn-bg); }
.callout--danger { border-left-color: var(--danger); background: #fdece9; }
.callout p:last-child { margin-bottom: 0; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; margin: 1.25rem 0; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .95rem; }
caption { text-align: left; padding: 10px 14px; color: var(--muted); font-size: .85rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--brand-tint); color: var(--brand-darker); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 1rem;
  line-height: 1.2;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--brand-dark); color: #fff; }
.btn--primary:hover { background: var(--brand-darker); color: #fff; }
.btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.btn--ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.btn--outline { background: #fff; color: var(--brand-dark); border-color: var(--brand); }
.btn--outline:hover { background: var(--brand-tint); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.25rem 0; }

/* ---- Steps ---- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 1.25rem 0; }
.steps li {
  position: relative;
  padding: 0 0 1rem 3rem;
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px;
  background: var(--brand-dark); color: #fff;
  border-radius: 50%; display: grid; place-items: center; font-weight: 700;
}
.steps li strong { display: block; color: var(--ink); }

/* ---- Contact list ---- */
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 0; }
.contact-list .label { min-width: 96px; color: var(--muted); font-weight: 600; }

/* ---- Form ---- */
.form { max-width: 620px; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field .req { color: var(--danger); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger); }
.field__error { color: var(--danger); font-size: .82rem; margin-top: 4px; display: none; }
.field--error .field__error { display: block; }
.checkbox-row { display: flex; gap: 10px; align-items: flex-start; }
.checkbox-row input { width: auto; margin-top: 5px; }
.form__status { margin-top: 1rem; padding: 14px 16px; border-radius: 10px; display: none; }
.form__status--ok { display: block; background: var(--brand-tint); border: 1px solid var(--brand); color: var(--brand-darker); }
.form__status--err { display: block; background: #fdece9; border: 1px solid var(--danger); color: var(--danger); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- Footer ---- */
.site-footer { background: var(--ink); color: #cdd8c4; padding: 2.5rem 0 1.5rem; margin-top: 2rem; }
.site-footer a { color: #cdd8c4; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 28px; }
.site-footer h4 { color: #fff; margin: 0 0 .6rem; font-size: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .45rem; }
.footer-brand .brand__name { color: #fff; }
.footer-brand p { color: #a9b6a0; font-size: .92rem; max-width: 36ch; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12);
  margin-top: 1.75rem; padding-top: 1.25rem;
  font-size: .85rem; color: #9aa891; text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 820px) {
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 8px 12px 14px;
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { display: block; padding: 12px 10px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .contact-list li { flex-direction: column; gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
