/* =========================================================
   FormYar — printable product brief & comparison document
   ========================================================= */
:root {
  --doc-brand: #047857;
  --doc-brand-deep: #065f46;
  --doc-brand-soft: #ecfdf5;
  --doc-teal: #0d9488;
  --doc-ink: #13231d;
  --doc-ink-2: #2c3d36;
  --doc-muted: #61716a;
  --doc-line: #dbe7e1;
  --doc-line-strong: #bcd3c9;
  --doc-paper: #ffffff;
  --doc-canvas: #eef5f1;
  --doc-amber-soft: #fef3c7;
  --doc-amber: #92400e;
  --doc-red-soft: #fee2e2;
  --doc-red: #991b1b;
  --doc-blue-soft: #dbeafe;
  --doc-blue: #1e40af;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.doc-page {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(13, 148, 136, .10), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(4, 120, 87, .08), transparent 32rem),
    var(--doc-canvas);
  color: var(--doc-ink);
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--doc-brand); }

code {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

/* ---------- screen toolbar ---------- */
.doc-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid rgba(188, 211, 201, .8);
  backdrop-filter: blur(14px);
}

.doc-toolbar-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--doc-ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}

.doc-toolbar-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
  padding: 3px;
  border: 1px solid var(--doc-line);
}

.doc-toolbar-title {
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

.doc-toolbar-title small {
  color: var(--doc-muted);
  font-size: 9.5px;
  font-weight: 500;
}

.doc-toolbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  flex-wrap: wrap;
}

.doc-toolbar-nav a,
.doc-toolbar-nav button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--doc-ink-2);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: none;
  padding: 5px 9px;
  cursor: pointer;
}

.doc-toolbar-nav a:hover,
.doc-toolbar-nav button:hover { background: var(--doc-brand-soft); color: var(--doc-brand-deep); }
.doc-toolbar-nav .doc-primary { background: var(--doc-brand); color: #fff; border-color: var(--doc-brand); }
.doc-toolbar-nav .doc-primary:hover { background: var(--doc-brand-deep); color: #fff; }

/* ---------- paper shell ---------- */
.doc-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 24px auto 70px;
}

.doc-paper {
  background: var(--doc-paper);
  border: 1px solid rgba(188, 211, 201, .7);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(18, 58, 45, .10);
  padding: clamp(26px, 5vw, 64px);
  overflow: hidden;
}

.doc-cover {
  position: relative;
  min-height: 640px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 36px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--doc-line);
}

.doc-cover::before {
  content: "";
  position: absolute;
  inset: -70px -70px auto auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16, 185, 129, .18), transparent 68%);
  pointer-events: none;
}

.doc-cover-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.doc-brand-lockup { display: flex; align-items: center; gap: 12px; }
.doc-brand-lockup img { width: 52px; height: 52px; object-fit: contain; border-radius: 14px; border: 1px solid var(--doc-line); padding: 5px; background: #fff; }
.doc-brand-lockup b { display: block; font-size: 16px; line-height: 1.4; }
.doc-brand-lockup small { display: block; color: var(--doc-muted); font-size: 10px; }

.doc-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 5px 18px;
  color: var(--doc-muted);
  font-size: 10px;
  text-align: start;
  border: 1px solid var(--doc-line);
  border-radius: 12px;
  padding: 10px 14px;
  background: #fbfdfc;
}
.doc-meta b { color: var(--doc-ink); font-weight: 800; }

.doc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--doc-brand-deep);
  background: var(--doc-brand-soft);
  border: 1px solid #c7f0dd;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2px;
}

.doc-cover h1 {
  max-width: 840px;
  margin: 18px 0 12px;
  font-size: clamp(30px, 5.2vw, 54px);
  line-height: 1.35;
  letter-spacing: -1.2px;
  color: var(--doc-ink);
}

.doc-cover h1 span { color: var(--doc-brand); }
.doc-cover-lead { max-width: 760px; margin: 0; color: var(--doc-muted); font-size: clamp(12px, 2vw, 15px); line-height: 2.15; }

.doc-chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 22px; }
.doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--doc-line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--doc-ink-2);
  font-size: 10px;
  font-weight: 700;
}
.doc-chip b { color: var(--doc-brand); font-size: 12px; }

.doc-cover-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .6fr);
  gap: 18px;
  align-items: end;
}

.doc-callout {
  border: 1px solid var(--doc-line);
  border-inline-start: 4px solid var(--doc-brand);
  border-radius: 12px;
  background: #f8fcfa;
  padding: 12px 15px;
  color: var(--doc-ink-2);
  font-size: 10.5px;
  line-height: 2;
}

.doc-callout.warn { border-inline-start-color: #d97706; background: #fffbeb; }
.doc-callout.info { border-inline-start-color: #2563eb; background: #eff6ff; }
.doc-callout strong { color: var(--doc-ink); }

.doc-cover-rule {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--doc-muted);
  font-size: 10px;
  text-align: start;
  padding: 12px 14px;
  border: 1px dashed var(--doc-line-strong);
  border-radius: 12px;
}
.doc-cover-rule b { color: var(--doc-ink); font-size: 11px; }
.doc-cover-rule code { direction: ltr; text-align: left; display: block; font-size: 9px; color: var(--doc-brand-deep); overflow-wrap: anywhere; }

.doc-toc {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 24px;
  margin-top: 18px;
  padding: 11px 16px;
  border: 1px solid var(--doc-line);
  border-radius: 14px;
  background: #fbfdfc;
  break-inside: avoid;
}
.doc-toc a { display: flex; align-items: baseline; gap: 7px; color: var(--doc-ink-2); text-decoration: none; font-size: 10px; line-height: 1.7; }
.doc-toc a:hover { color: var(--doc-brand); }
.doc-toc a span { color: var(--doc-brand); font-size: 9px; font-weight: 800; min-width: 17px; }

/* ---------- sections ---------- */
.doc-section { margin-top: 42px; }
.doc-section-head { margin-bottom: 14px; }
.doc-section-head .doc-eyebrow { color: var(--doc-brand); font-size: 10px; font-weight: 800; letter-spacing: .3px; }
.doc-section-head h2 { margin: 3px 0 4px; font-size: clamp(21px, 3vw, 29px); line-height: 1.45; letter-spacing: -.3px; }
.doc-section-head p { margin: 0; color: var(--doc-muted); font-size: 11px; line-height: 2; max-width: 840px; }

h3.doc-subhead { margin: 24px 0 8px; font-size: 14px; line-height: 1.6; }
h3.doc-subhead small { color: var(--doc-muted); font-size: 10px; font-weight: 500; }
h4.doc-minihead { margin: 16px 0 6px; font-size: 11.5px; }

.doc-lead { color: var(--doc-muted); font-size: 11px; line-height: 2.1; }
.doc-lead strong { color: var(--doc-ink); }

/* ---------- KPI cards ---------- */
.doc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 16px 0; }
.doc-kpi { border: 1px solid var(--doc-line); border-radius: 12px; padding: 12px; background: linear-gradient(180deg, #fff, #f8fcfa); }
.doc-kpi b { display: block; color: var(--doc-brand); font-size: 22px; line-height: 1.2; }
.doc-kpi span { display: block; color: var(--doc-ink-2); font-size: 10px; font-weight: 700; margin-top: 3px; }
.doc-kpi small { display: block; color: var(--doc-muted); font-size: 8.8px; line-height: 1.7; margin-top: 2px; }

/* ---------- tables ---------- */
.doc-table-wrap { width: 100%; overflow-x: auto; margin: 12px 0 16px; border: 1px solid var(--doc-line); border-radius: 12px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 10px; line-height: 1.75; }
.doc-table th, .doc-table td { border-bottom: 1px solid var(--doc-line); border-inline-end: 1px solid var(--doc-line); padding: 6px 8px; text-align: start; vertical-align: top; }
.doc-table th:last-child, .doc-table td:last-child { border-inline-end: 0; }
.doc-table tbody tr:last-child td { border-bottom: 0; }
.doc-table thead th { background: #f1f8f5; color: var(--doc-brand-deep); font-size: 9.5px; font-weight: 800; }
.doc-table tbody tr:nth-child(even) { background: #fbfdfc; }
.doc-table td:first-child { white-space: nowrap; color: var(--doc-muted); font-size: 9px; }
.doc-table td strong { color: var(--doc-ink); }
.doc-table .center { text-align: center; white-space: nowrap; }
.doc-table .num { text-align: center; color: var(--doc-muted); font-size: 9px; width: 34px; }
.doc-table th.num { width: 34px; min-width: 34px; }
.doc-table.compact { font-size: 9.3px; }
.doc-table.compact th, .doc-table.compact td { padding: 5px 7px; }

.doc-legend { display: flex; flex-wrap: wrap; gap: 7px 14px; margin: 8px 0 4px; color: var(--doc-muted); font-size: 9.5px; }
.doc-legend span { display: inline-flex; align-items: center; gap: 5px; }

.pill { display: inline-block; border: 1px solid; border-radius: 999px; padding: 1px 7px; font-size: 8.5px; font-weight: 800; line-height: 1.8; white-space: nowrap; }
.pill.ok { color: #065f46; background: #d1fae5; border-color: #a7f3d0; }
.pill.demo { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.pill.partial { color: #1e40af; background: #dbeafe; border-color: #bfdbfe; }
.pill.no { color: #991b1b; background: #fee2e2; border-color: #fecaca; }

.doc-check { color: #047857; font-weight: 900; }
.doc-part { color: #b45309; font-weight: 900; }
.doc-no { color: #b91c1c; font-weight: 900; }

/* ---------- cards / lists ---------- */
.doc-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.doc-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.doc-card { border: 1px solid var(--doc-line); border-radius: 12px; padding: 12px 14px; background: #fcfefd; }
.doc-card h3, .doc-card h4 { margin: 0 0 4px; font-size: 11.5px; }
.doc-card p { margin: 0; color: var(--doc-muted); font-size: 9.8px; line-height: 2; }
.doc-card ul { margin: 6px 0 0; padding-inline-start: 16px; color: var(--doc-muted); font-size: 9.8px; line-height: 2; }
.doc-card li { margin: 1px 0; }
.doc-card.strong { background: var(--doc-brand-soft); border-color: #c7f0dd; }

.doc-numbered { counter-reset: item; list-style: none; padding: 0; margin: 10px 0; }
.doc-numbered li { counter-increment: item; position: relative; padding-inline-start: 30px; margin: 8px 0; color: var(--doc-ink-2); font-size: 10.5px; line-height: 2; }
.doc-numbered li::before { content: counter(item); position: absolute; inset-inline-start: 0; top: 3px; width: 20px; height: 20px; border-radius: 7px; background: var(--doc-brand-soft); color: var(--doc-brand-deep); font-size: 9px; font-weight: 800; display: grid; place-items: center; border: 1px solid #c7f0dd; }

.doc-bullets { margin: 8px 0; padding-inline-start: 18px; color: var(--doc-ink-2); font-size: 10.5px; line-height: 2.05; }
.doc-bullets li { margin: 3px 0; }
.doc-bullets li::marker { color: var(--doc-brand); }

/* ---------- comparison emphasis ---------- */
.doc-compare-head th:first-child { width: 34px; }
.doc-compare-head th:nth-child(2) { width: 29%; }
.doc-compare-head th:nth-child(3) { background: #e6f8f0; color: #065f46; }
.doc-compare-head th:nth-child(4) { background: #f5f3ff; color: #5b21b6; }
.doc-compare-head th:nth-child(5) { background: #f8fafc; color: #334155; }
.doc-compare-head th:nth-child(6) { background: #f8fafc; color: #334155; }
.doc-compare .own-cell { background: #f4fcf8; }
.doc-compare .own-cell .pill { margin-inline-start: 3px; }

.doc-quote {
  margin: 16px 0;
  border: 1px solid #c7f0dd;
  background: linear-gradient(135deg, #f0fdf8, #f7fefb);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--doc-ink-2);
  font-size: 11px;
  line-height: 2.1;
}
.doc-quote b { color: var(--doc-brand-deep); }

.doc-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 38px;
  padding-top: 12px;
  border-top: 1px solid var(--doc-line);
  color: var(--doc-muted);
  font-size: 8.8px;
  line-height: 1.9;
}
.doc-footer code { direction: ltr; text-align: left; overflow-wrap: anywhere; color: var(--doc-brand-deep); }

.doc-source-list { margin: 8px 0; padding-inline-start: 18px; color: var(--doc-muted); font-size: 9.5px; line-height: 2; }
.doc-source-list li { margin: 2px 0; }
.doc-source-list code { direction: ltr; color: var(--doc-brand-deep); }

.doc-screen-only { display: initial; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .doc-toolbar { position: static; flex-wrap: wrap; }
  .doc-toolbar-nav { width: 100%; margin-inline-start: 0; }
  .doc-toolbar-nav a, .doc-toolbar-nav button { flex: 1; justify-content: center; }
  .doc-shell { width: calc(100% - 20px); margin-top: 12px; }
  .doc-paper { border-radius: 16px; }
  .doc-cover { min-height: 0; }
  .doc-cover-bottom { grid-template-columns: 1fr; }
  .doc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-grid-2, .doc-grid-3 { grid-template-columns: 1fr; }
  .doc-toc { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .doc-toolbar-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .doc-toolbar-nav .doc-primary { grid-column: 1 / -1; order: -1; min-height: 36px; }
  .doc-toolbar-nav a { min-height: 34px; }
}

@media (max-width: 520px) {
  .doc-paper { padding: 18px 13px; }
  .doc-meta { width: 100%; grid-template-columns: 1fr; }
  .doc-kpis { grid-template-columns: 1fr 1fr; }
  .doc-kpi b { font-size: 19px; }
  .doc-table { font-size: 9px; }
  .doc-table th, .doc-table td { padding: 5px 6px; }
  .doc-cover h1 { letter-spacing: -.6px; }
  .doc-toolbar-title small { display: none; }
}

/* ---------- print ---------- */
@page {
  size: A4;
  margin: 11mm 10mm 13mm;
}

@media print {
  html, body.doc-page {
    background: #fff !important;
    color: #111 !important;
    font-size: 10pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .doc-toolbar,
  .no-print,
  .doc-screen-only { display: none !important; }

  .doc-shell { width: auto; margin: 0; }
  .doc-paper { border: 0; border-radius: 0; box-shadow: none; padding: 0; overflow: visible; }
  .doc-cover { min-height: 0; gap: 18px; padding-top: 8mm; padding-bottom: 6mm; break-after: page; }
  .doc-cover::before { display: none; }
  .doc-toc { margin-top: 10px; }
  .doc-section { margin-top: 20px; break-before: page; }
  .doc-cover + .doc-section { break-before: auto; }

  .doc-section-head h2,
  h3.doc-subhead,
  h4.doc-minihead { break-after: avoid; }

  .doc-kpis, .doc-grid-2, .doc-grid-3, .doc-quote, .doc-callout,
  .doc-card, .doc-numbered li, .doc-bullets li { break-inside: avoid; }

  .doc-table-wrap { overflow: visible; border-color: #bbb; }
  .doc-table { font-size: 8.2pt; line-height: 1.55; }
  .doc-table th, .doc-table td { padding: 3.5pt 4pt; border-color: #c9d4cf; }
  .doc-table thead { display: table-header-group; }
  .doc-table tr { break-inside: avoid; }
  .doc-table thead th { background: #eaf6f0 !important; color: #064e3b !important; }
  .doc-table tbody tr:nth-child(even) { background: #f8fbf9 !important; }
  .doc-compare-head th:nth-child(3) { background: #e0f5eb !important; }
  .doc-compare-head th:nth-child(4) { background: #f2efff !important; }
  .doc-compare-head th:nth-child(5),
  .doc-compare-head th:nth-child(6) { background: #f4f6f8 !important; }
  .doc-compare .own-cell { background: #f3fbf7 !important; }

  .pill { border-color: #aaa !important; }
  .pill.ok { background: #d1fae5 !important; }
  .pill.demo { background: #fef3c7 !important; }
  .pill.partial { background: #dbeafe !important; }
  .pill.no { background: #fee2e2 !important; }

  a { color: inherit !important; text-decoration: none !important; }

  .doc-footer { break-inside: avoid; }
}
