/* Bargdan Public SEO Website — Lightweight Botanical Design System */
:root {
  color-scheme: light;
  --bg: #f5f3eb;
  --surface: #fffefa;
  --surface-soft: #eef0e6;
  --text: #24372d;
  --muted: #6c7a6e;
  --green: #356b50;
  --green-dark: #244b39;
  --sage: #a8b99e;
  --danger: #b45348;
  --danger-soft: #f7eae8;
  --line: rgba(36, 55, 45, .1);
  --line-strong: rgba(36, 55, 45, .16);
  --shadow: 0 10px 28px rgba(36, 55, 45, .06), 0 2px 6px rgba(36, 55, 45, .03);
  --shadow-btn: 0 6px 16px rgba(53, 107, 80, .24);
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 4%, rgba(168, 185, 158, .25), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(53, 107, 80, .06), transparent 24rem),
    var(--bg);
  color: var(--text);
  font-family: "Vazirmatn", Tahoma, sans-serif;
  line-height: 1.7;
  padding-bottom: 48px;
}
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }

.container { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(245, 243, 235, .88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: #e5eadc;
  color: var(--green);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.brand-mark svg { width: 22px; height: 22px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-links a {
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 12px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--muted);
  transition: .16s;
}
.nav-links a:hover { background: var(--surface-soft); color: var(--green-dark); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
  transition: transform .13s ease, background-color .16s ease, box-shadow .16s ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(180deg, #3c7759 0%, #31634a 100%);
  color: #fff;
  box-shadow: var(--shadow-btn), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: linear-gradient(180deg, #356b50 0%, #27513d 100%); }
.btn-secondary {
  background: #f2f4ec;
  color: var(--green-dark);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: #e5ebdc; }
.btn-sm { padding: 7px 13px; font-size: .8rem; border-radius: 11px; }
.btn-full { width: 100%; }

/* Cards & Sections */
.section { margin: 28px 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; font-size: 1.24rem; font-weight: 800; color: var(--text); }
.section-sub { margin: 3px 0 0; font-size: .85rem; color: var(--muted); }

.card {
  background: rgba(255, 254, 250, .97);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .92);
  padding: 22px 24px;
}

/* Hero */
.hero {
  margin-top: 22px;
  border-radius: 28px;
  padding: 36px 34px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 14% 22%, rgba(168, 185, 158, .36), transparent 46%),
    radial-gradient(circle at 86% 80%, rgba(53, 107, 80, .12), transparent 44%),
    linear-gradient(135deg, #f9f8f2 0%, #eef2e7 54%, #e5ecdc 100%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 1.25fr .75fr;
  gap: 24px;
  align-items: center;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(53, 107, 80, .1);
  color: var(--green-dark);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.42rem, 3vw, 2.05rem);
  line-height: 1.45;
  font-weight: 800;
}
.hero p { margin: 0 0 20px; color: #546457; font-size: .95rem; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.h-stat {
  background: rgba(255, 254, 250, .86);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
}
.h-stat .num {
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}
.h-stat .lbl { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* Feature Grid */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

.feat-card { padding: 18px; }
.feat-ico {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  margin-bottom: 11px;
}
.feat-ico svg { width: 21px; height: 21px; }
.feat-card h3 { margin: 0 0 5px; font-size: .95rem; font-weight: 800; }
.feat-card p { margin: 0; font-size: .82rem; color: var(--muted); }

/* Filters & Inputs */
.field {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fbfaf6;
  color: var(--text);
  border-radius: 14px;
  padding: 10px 13px;
  outline: none;
  font-size: .88rem;
  transition: .16s;
}
.field:focus { border-color: var(--green); background: var(--surface); box-shadow: 0 0 0 3px rgba(53, 107, 80, .1); }
.field-label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 5px; }

.seg {
  display: inline-flex;
  background: #eaece2;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--line);
  gap: 4px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 11px;
  font-size: .82rem;
  font-weight: 600;
  transition: .16s;
}
.seg button.active {
  background: var(--surface);
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(36, 55, 45, .07);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-wrap { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.search-wrap svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}
.search-wrap .field { padding-right: 36px; }

/* Pamphlet / Exam Cards */
.item-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 9px;
  font-size: .72rem;
  font-weight: 700;
  background: var(--surface-soft);
  color: var(--green-dark);
}
.pill-accent { background: rgba(53, 107, 80, .12); color: var(--green); }
.pill-danger { background: var(--danger-soft); color: var(--danger); }
.item-title {
  margin: 8px 0 4px;
  font-size: .96rem;
  font-weight: 800;
  line-height: 1.5;
}
.item-title a { text-decoration: none; }
.item-title a:hover { color: var(--green); }
.item-meta { font-size: .79rem; color: var(--muted); }
.item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #efeee7;
}
.price { font-weight: 800; font-size: .9rem; color: var(--green-dark); font-variant-numeric: tabular-nums; }

/* Directory Chips for Programmatic SEO */
.grade-group { margin-bottom: 16px; }
.grade-group:last-child { margin-bottom: 0; }
.grade-title { font-size: .88rem; font-weight: 800; color: var(--green-dark); margin: 0 0 8px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.link-chip {
  text-decoration: none;
  background: #fbfaf5;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 12px;
  font-size: .81rem;
  font-weight: 600;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: .15s;
}
.link-chip:hover { background: #e8efe4; border-color: rgba(53, 107, 80, .3); color: var(--green-dark); }
.link-chip .tag { font-size: .71rem; color: var(--muted); }

/* Wrong-Answer Damage Analyzer */
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.calc-inputs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.calc-res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.calc-kpi {
  background: #fbfaf5;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 10px;
  text-align: center;
}
.calc-kpi .v { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.calc-kpi .l { font-size: .73rem; color: var(--muted); margin-top: 2px; }
.damage-banner {
  background: #fbf5f4;
  border: 1px solid #ead4d1;
  color: #7d332b;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: .84rem;
  margin-bottom: 12px;
}
.damage-banner.good {
  background: #eef5ef;
  border-color: #cde0d3;
  color: var(--green-dark);
}

/* Budget Checklist Table */
.progress-track { height: 10px; border-radius: 99px; background: #e9e9df; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--sage), var(--green)); transition: width .25s ease; }

.ch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfaf6;
  margin-bottom: 9px;
  cursor: pointer;
  transition: .15s;
}
.ch-row:hover { background: #f2f5ed; }
.ch-row.checked { background: #ecf3ec; border-color: rgba(53, 107, 80, .3); }
.ch-row.checked .ch-name { text-decoration: line-through; color: var(--muted); }
.ch-row input[type="checkbox"] { accent-color: var(--green); width: 19px; height: 19px; flex-shrink: 0; }
.ch-name { font-weight: 700; font-size: .9rem; }
.ch-weights { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }

/* Sample Quiz Questions (exam_preview.php) */
.sample-q {
  background: #fbfaf6;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
}
.sample-opt {
  width: 100%;
  text-align: right;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 13px;
  padding: 11px 13px;
  margin-top: 8px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: .88rem;
  transition: .15s;
}
.sample-opt:hover { background: var(--surface-soft); }
.sample-opt.correct { background: #e5efe8; border-color: var(--green); color: var(--green-dark); font-weight: 700; }
.sample-opt.wrong { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); font-weight: 700; }
.sample-expl {
  display: none;
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #eef4ef;
  border: 1px solid #d1e3d6;
  font-size: .83rem;
}
.sample-expl.show { display: block; }

/* FAQ */
.faq-item {
  border-bottom: 1px solid #efeee7;
  padding: 13px 0;
}
.faq-item:last-child { border-bottom: 0; }
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: .92rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { margin: 8px 0 0; font-size: .84rem; color: var(--muted); }

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: .8rem;
  color: var(--muted);
  margin: 18px 0 12px;
}
.breadcrumb a { text-decoration: none; color: var(--green-dark); font-weight: 600; }

/* Pagination */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #efeee7;
}
.pager-info { font-size: .8rem; color: var(--muted); font-weight: 600; }

/* Footer */
.site-footer {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  font-size: .82rem;
  color: var(--muted);
}

/* Iran-Friendly Smart Telegram Entry Modal */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(20, 34, 26, .48);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, visibility .2s ease;
}
.modal-bg.open { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-box {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 24px 22px;
  box-shadow: 0 22px 54px rgba(20, 36, 27, .22);
  transform: translateY(18px);
  transition: transform .22s ease;
}
.modal-bg.open .modal-box { transform: translateY(0); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.modal-head h3 { margin: 0; font-size: 1.05rem; font-weight: 800; }
.bot-id-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #f5f4ec;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  margin-top: 10px;
}
.bot-id-box code { direction: ltr; font-weight: 700; color: var(--green-dark); font-size: .9rem; }

/* Mobile Sticky Bottom CTA Bar */
.mobile-sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 45;
  background: rgba(255, 254, 250, .94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 24px rgba(24, 42, 32, .08);
}

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -18px);
  background: rgba(30, 48, 39, .95);
  color: #fffefa;
  padding: 10px 18px;
  border-radius: 14px;
  font-size: .84rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: .22s;
  z-index: 120;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding: 26px 22px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .calc-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  body { padding-bottom: 84px; }
  .container { width: calc(100% - 24px); }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .calc-inputs, .calc-res-grid { grid-template-columns: 1fr; }
  .card { padding: 18px 16px; }
  .mobile-sticky-cta { display: block; }
}
