@font-face {
  font-family: "Vazirmatn";
  src: url("/assets/fonts/Vazirmatn-wght.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #16213a;
  --ink-soft: #4a5672;
  --brand: #1f3a68;
  --brand-dark: #142849;
  --accent: #e0803a;
  --accent-dark: #c4692a;
  --bg: #f6f7fb;
  --card: #ffffff;
  --line: #e2e6ef;
  --ok: #1f7a4d;
  --warn: #9a5b00;
  --bad: #a3322c;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--brand); }
a:hover { color: var(--accent-dark); }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.5; margin: 0 0 .6em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
h4 { font-size: 1rem; margin-top: 1em; }
p { margin: 0 0 1em; }
small { font-weight: 400; color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
[dir="ltr"] { unicode-bidi: isolate; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.section { padding: 48px 0; }
.band { background: #eef1f8; }

.skip { position: absolute; inset-inline-start: -9999px; }
.skip:focus { inset-inline-start: 16px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand-dark); }
.logo { width: 34px; height: 34px; fill: var(--accent); }
.brand-name { font-size: 1.5rem; font-weight: 800; }
.brand-sub { font-size: .85rem; color: var(--ink-soft); font-weight: 500; }
.nav-desktop ul, .nav-mobile ul { list-style: none; margin: 0; padding: 0; }
.nav-desktop ul { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-desktop a, .nav-mobile a {
  display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: .95rem;
}
.nav-desktop a:hover, .nav-mobile a:hover { background: var(--bg); color: var(--brand); }
.nav-desktop a[aria-current="page"], .nav-mobile a[aria-current="page"] { color: var(--brand); font-weight: 700; }
.nav-mobile { display: none; position: relative; }
.nav-mobile summary {
  cursor: pointer; list-style: none; padding: 6px 14px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600;
}
.nav-mobile summary::-webkit-details-marker { display: none; }
.nav-mobile nav {
  position: absolute; inset-inline-end: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 8px; min-width: 220px; box-shadow: 0 12px 30px rgba(22, 33, 58, .12);
}
@media (max-width: 980px) {
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
}

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--brand-dark), var(--brand) 60%, #2c5491);
  color: #fff; padding: 72px 0 64px;
}
.hero h1 { font-size: 2.3rem; }
.hero .lead { font-size: 1.15rem; max-width: 760px; color: #dfe6f5; }
.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: 40px 0 24px; }
.page-head p { color: var(--ink-soft); max-width: 820px; }

/* Buttons */
.btn {
  display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 700;
  padding: 10px 22px; border-radius: 10px; border: 0; font: inherit; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); color: #fff; }
.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { background: #f1f3f9; color: var(--brand-dark); }
.btn-outline { background: transparent; border: 1px solid rgba(255, 255, 255, .7); color: #fff; }
.btn-outline:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); color: var(--brand); }
.btn-small { padding: 6px 14px; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }

/* Grids and cards */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column;
}
.card > .actions { margin-top: auto; }
.exam h3 { font-size: 1.3rem; }
.price-rows { list-style: none; padding: 0; margin: 0 0 16px; }
.price-rows li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.service .tag { color: var(--accent-dark); font-size: .85rem; font-weight: 700; margin-bottom: .3em; }
.price { font-size: 1.05rem; margin: 12px 0; }
.price strong { font-size: 1.35rem; color: var(--brand-dark); }
.meta { color: var(--ink-soft); font-size: .95rem; margin-bottom: .4em; }
.meta span { font-weight: 700; color: var(--ink); }
.checks { padding-inline-start: 1.2em; margin: 0 0 1em; }
.checks li { margin-bottom: .25em; }
.note { color: var(--ink-soft); font-size: .92rem; margin-top: 24px; }
.features h3 { color: var(--brand-dark); }
.features p { color: var(--ink-soft); }

.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: step; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.steps li::before {
  content: counter(step, persian); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 8px;
}
.steps strong { display: block; }
.steps span { color: var(--ink-soft); font-size: .95rem; }

.prose { max-width: 860px; }
.prose h2 { margin-top: 1.6em; font-size: 1.2rem; }
.prose ul { padding-inline-start: 1.3em; }
.qa { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 4px 18px; margin-bottom: 10px; }
.qa summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.qa p { color: var(--ink-soft); }

table.info, table.lines { width: 100%; border-collapse: collapse; margin: 0 0 1em; }
table.info th, table.info td, table.lines th, table.lines td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.info th { width: 32%; color: var(--ink-soft); font-weight: 600; }
table.lines th { background: #f1f3f9; font-weight: 700; }
table.lines td.num, table.lines th.num { text-align: end; white-space: nowrap; }
table.lines tfoot td { font-weight: 800; }

/* Forms */
form .field { margin-bottom: 14px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.hint { color: var(--ink-soft); font-size: .88rem; font-weight: 400; }
input[type="text"], input[type="tel"], input[type="email"], select, textarea {
  width: 100%; font: inherit; padding: 9px 12px; border: 1px solid #c9d0de; border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid #9db7e6; border-color: var(--brand); }
textarea { min-height: 84px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 8px; }
.errors { background: #fdeeee; color: var(--bad); border: 1px solid #f3c9c6; border-radius: 10px; padding: 10px 16px; margin-bottom: 16px; }
.errors ul { margin: 0; padding-inline-start: 1.2em; }
.okbox { background: #eaf6ef; color: var(--ok); border: 1px solid #c4e6d2; border-radius: 10px; padding: 10px 16px; margin-bottom: 16px; }

.status { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: .9rem; font-weight: 700; background: #eef1f8; color: var(--brand); }
.status-awaiting_payment { background: #fff4e5; color: var(--warn); }
.status-payment_reported { background: #e9f1ff; color: var(--brand); }
.status-paid, .status-completed { background: #eaf6ef; color: var(--ok); }
.status-cancelled, .status-refunded { background: #f4f4f6; color: #59607a; }

.paybox { background: #fffaf3; border: 1px solid #f1d9bd; border-radius: var(--radius); padding: 18px 20px; margin: 16px 0; }
.card-number { font-size: 1.45rem; font-weight: 800; letter-spacing: .04em; direction: ltr; unicode-bidi: isolate; display: inline-block; }
.invoice-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: baseline; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 16px 0; }
@media (max-width: 680px) { .parties { grid-template-columns: 1fr; } }
.parties div { background: #f8f9fc; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.parties h3 { font-size: 1rem; color: var(--ink-soft); }

/* Footer */
.site-footer { background: #101a2e; color: #c9d1e3; margin-top: 48px; padding-top: 40px; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer h2 { color: #fff; font-size: 1.05rem; margin-top: 4px; }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 16px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 28px; }
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr; } }
.brand-footer { color: #fff; margin-bottom: 8px; }
.contact-list { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.contact-list dt { color: #8f9bb8; }
.contact-list dd { margin: 0; color: #fff; }
.enamad-slot:empty { display: none; }
.footer-bottom { border-top: 1px solid #22304d; margin-top: 24px; padding: 16px 0 24px; font-size: .85rem; color: #8f9bb8; }
.footer-bottom p { margin: 0 0 6px; }

/* Admin */
.admin table.lines td, .admin table.lines th { font-size: .92rem; }
.admin .filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

@media print {
  .site-header, .site-footer, .no-print, .skip { display: none !important; }
  body { background: #fff; }
  .card { border: 0; padding: 0; }
  .section { padding: 0; }
}

.parties.single { grid-template-columns: 1fr; }
.narrow { max-width: 560px; }
.scroll-x { overflow-x: auto; }
.mt { margin-top: 20px; }

/* footer bottom bar: notes on the right, e-Namad logo bottom-left (RTL end) */
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.footer-notes { flex: 1 1 420px; }
.enamad-slot img { display: block; max-height: 110px; width: auto; }
.msg { white-space: pre-wrap; min-width: 220px; }
