@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Medium.ttf) format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: Vazirmatn; src: url(fonts/Vazirmatn-Bold.ttf) format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --gold: #C9971C; --gold-soft: #F3E6C4; --brown: #6B4A22; --ink: #2B2118; --muted: #7A6A55;
  --bg: #FBF7EF; --surface: #FFFFFF; --line: #EADCC0; --error: #B42318; --ok: #2E7D32;
  --radius: 14px;
  --ring: 0 0 0 3px rgba(201, 151, 28, .45);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.9 Vazirmatn, Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--brown); text-underline-offset: 4px; }
a:focus-visible, button:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only, .hp { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: 760px; margin: 0 auto; padding: 16px 16px 56px; }
.wrap-wide { max-width: 1040px; }

/* cards */
.card {
  position: relative; overflow: hidden; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 18px 22px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(107, 74, 34, .05), 0 10px 28px rgba(107, 74, 34, .05);
}
.card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--gold); }
.card h2 { font-size: 20px; font-weight: 700; color: var(--brown); line-height: 1.7; }
.eyebrow { font-size: 13px; color: var(--gold); font-weight: 500; letter-spacing: 0; margin-bottom: 2px; }
.help { color: var(--muted); font-size: 14.5px; line-height: 1.95; margin-top: 8px; }

/* hero */
.hero { text-align: center; padding: 28px 18px 26px; }
.hero-logo { display: block; width: 132px; height: auto; margin: 0 auto 8px; }
.hero-title { font-size: 22px; line-height: 1.6; font-weight: 700; color: var(--brown); }
.hero-org { color: var(--muted); font-size: 15px; margin-top: 2px; }
.hero-intro { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15.5px; }
.hero--compact { padding: 14px 18px; display: flex; align-items: center; gap: 14px; text-align: right; }
.hero--compact .hero-logo { width: 52px; margin: 0; flex: none; }
.hero--compact .hero-title { font-size: 16px; line-height: 1.5; }
.hero--compact .hero-org { font-size: 13px; line-height: 1.5; margin: 0; }
.hero--compact .hero-intro { display: none; }
.hero--compact .hero-text { min-width: 0; }

/* progress */
.progress { margin: 0 2px 16px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.bar { height: 8px; background: var(--gold-soft); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--gold); border-radius: 99px; transition: width .35s ease; }

/* questions */
.step-title:focus { outline: none; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; width: 100%; font-weight: 500; line-height: 1.9; margin-bottom: 10px; }


.q-body { margin-top: 0; }
.opts { display: grid; gap: 10px; }
.opt { position: relative; }
.opt input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1;
}
.opt label {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  min-height: 52px; padding: 11px 14px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; line-height: 1.85;
  transition: background .15s, border-color .15s;
}
.opt label::before {
  content: ''; flex: none; width: 22px; height: 22px; margin-top: 4px;
  border: 1.5px solid var(--muted); border-radius: 50%; background: #fff;
}
.opt--check label::before { border-radius: 6px; }
.opt label::after { content: ''; position: absolute; opacity: 0; }
.opt input:checked + label { background: var(--gold-soft); border-color: var(--gold); }
.opt input:checked + label::before { background: var(--gold); border-color: var(--gold); box-shadow: inset 0 0 0 4px var(--gold-soft); }
.opt--check input:checked + label::before { box-shadow: none; }
.opt--check input:checked + label::after {
  opacity: 1; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0;
  inset-inline-start: 21px; top: 17px; transform: rotate(45deg);
}
.opt input:focus-visible + label { box-shadow: var(--ring); border-color: var(--gold); }
.opt input:disabled { cursor: not-allowed; }
.opt input:disabled + label { opacity: .5; background: #FAF6EC; }
.opt--group label { padding: 14px; }
.opt-body { display: grid; gap: 0; }
.opt-title { font-weight: 700; color: var(--brown); }
.opt-desc { font-size: 14.5px; color: var(--muted); line-height: 1.8; }

.hint { margin-top: 8px; font-size: 14px; color: var(--brown); font-weight: 500; }
.err { margin-top: 6px; font-size: 14px; color: var(--error); line-height: 1.7; }
.err:empty { display: none; }
.has-err > legend, .has-err > label:first-child { color: var(--error); }

/* text fields */
.field { display: grid; gap: 6px; margin-top: 18px; }
.field:first-of-type { margin-top: 18px; }
.field > label { font-weight: 500; }
.opt-tag { color: var(--muted); font-weight: 400; font-size: 13.5px; }
.field .help { margin-top: -2px; }
.input {
  width: 100%; min-height: 50px; padding: 10px 14px; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 12px;
}
textarea.input { min-height: 160px; resize: vertical; line-height: 1.95; }
.input::placeholder { color: #B5A68C; }
.input:focus { outline: none; border-color: var(--gold); box-shadow: var(--ring); }
.input[aria-invalid="true"] { border-color: var(--error); }
.input.ltr { direction: ltr; text-align: right; }
.count { font-size: 13.5px; color: var(--muted); text-align: left; }
.count.is-limit { color: var(--error); font-weight: 500; }

/* files */
.file-pick { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-input:focus-visible + label { box-shadow: var(--ring); }
.file-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.file-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; font-size: 14.5px;
}
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }
.file-size { color: var(--muted); white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; font: inherit; font-weight: 500; line-height: 1;
  border: 1.5px solid transparent; border-radius: 12px; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, opacity .15s;
}
.btn-primary { background: var(--brown); color: var(--bg); }
.btn-primary:hover { background: #583b19; }
.btn-secondary { background: transparent; color: var(--brown); border-color: var(--brown); }
.btn-secondary:hover { background: var(--gold-soft); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14.5px; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 12px; }
.btn[disabled] { opacity: .65; cursor: not-allowed; }
.btn.is-loading::after {
  content: ''; width: 16px; height: 16px; border: 2px solid currentColor; border-inline-end-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.nav { display: flex; gap: 12px; margin-top: 26px; }
.nav .btn-primary { flex: 1; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brown); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.draft-row { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; margin-top: 18px; font-size: 13.5px; color: var(--muted); }

.banner { margin-top: 18px; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.8; }
.banner-error { background: #FDECEA; color: var(--error); border: 1px solid #F3C4BF; }
.banner-note { background: var(--gold-soft); color: var(--brown); }

/* success */
.done { text-align: center; padding-top: 30px; }
.done-mark {
  width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--ok);
  position: relative;
}
.done-mark::after {
  content: ''; position: absolute; width: 14px; height: 28px; border: solid #fff; border-width: 0 4px 4px 0;
  left: 25px; top: 10px; transform: rotate(45deg);
}
.code {
  display: inline-block; margin: 16px 0 8px; padding: 8px 26px; direction: ltr;
  font-size: 32px; font-weight: 700; letter-spacing: 3px; color: var(--brown);
  background: var(--gold-soft); border: 1.5px dashed var(--gold); border-radius: 14px; line-height: 1.7;
}

/* admin */
.adm-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.adm-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--brown); font-weight: 700; }
.adm-nav { display: flex; gap: 10px; align-items: center; }
.adm-nav form { margin: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 6px 16px; border: 1.5px solid var(--line); border-radius: 99px; background: var(--surface); text-decoration: none; color: var(--ink); font-size: 15px; }
.tab.is-on { background: var(--brown); border-color: var(--brown); color: var(--bg); }
.tab .n { display: inline-block; min-width: 22px; padding: 0 6px; margin-inline-start: 4px; border-radius: 99px; background: var(--gold-soft); color: var(--brown); font-size: 13px; text-align: center; line-height: 1.6; }
.tab.is-on .n { background: rgba(251, 247, 239, .2); color: var(--bg); }
.adm-search { display: flex; gap: 10px; flex-wrap: wrap; }
.adm-search .input { flex: 1 1 240px; }
.table-wrap { overflow-x: auto; margin-top: 16px; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 640px; }
.tbl th { text-align: right; font-weight: 500; color: var(--muted); padding: 8px 10px; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: #FDFAF3; }
.num { white-space: nowrap; }
.empty { color: var(--muted); padding: 18px 0 4px; text-align: center; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; color: var(--muted); }
.login { max-width: 420px; margin: 40px auto; }
.login h1 { font-size: 20px; color: var(--brown); }
.login .btn { margin-top: 8px; }
.adm h1 { font-size: 22px; color: var(--brown); line-height: 1.6; }
.adm h2 { margin-bottom: 4px; }
.kvs { margin: 14px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 24px; }
.kv { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.kv dt { color: var(--muted); flex: none; min-width: 96px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.qa { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.qa:last-child { border-bottom: 0; padding-bottom: 0; }
.qa-q { color: var(--muted); font-size: 14.5px; }
.qa-a { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.files { margin: 8px 0 0; padding-inline-start: 20px; }
.muted { color: var(--muted); font-size: 14px; }
.pill { display: inline-block; padding: 0 10px; border-radius: 99px; background: var(--gold-soft); color: var(--brown); font-size: 13px; line-height: 1.9; white-space: nowrap; }
.pill-ok { background: #E3F1E4; color: var(--ok); }
.flash { margin: 0 0 14px; padding: 10px 16px; border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--surface); }
.flash-ok { border-color: var(--ok); color: var(--ok); }
.flash-err { border-color: var(--error); color: var(--error); }
.adm h3 { font-size: 16px; color: var(--brown); margin: 20px 0 4px; }
.sms-box { margin-top: 12px; }
.sms-box summary { cursor: pointer; color: var(--brown); }
.sms-text { min-height: 140px; }
.sms-preview { white-space: pre-line; margin: 4px 0; }
.check { display: flex; align-items: center; gap: 8px; }
.meta { font-size: 14px; }

@media (min-width: 640px) {
  .wrap { padding-top: 32px; }
  .card { padding: 30px 32px 28px; }
  .hero { padding: 36px 32px 32px; }
  .hero-logo { width: 156px; }
  .hero-title { font-size: 26px; }
  .hero--compact { padding: 16px 32px; }
  .opts--2 { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* layout helpers */
.q-wrap { margin-top: 22px; }
.q-wrap:first-of-type { margin-top: 18px; }
.q-wrap > .field { margin-top: 0; }
.q-label { font-weight: 500; }
.legend-lg { font-size: 19px; font-weight: 700; color: var(--brown); margin-bottom: 14px; }
.card > .help + .q-wrap, .card > .eyebrow + h2 + .q-wrap { margin-top: 20px; }

/* start page */
.hero-title { font-size: 24px; }
@media (min-width: 640px) { .hero-title { font-size: 30px; } }
.start-title { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.facts { display: grid; gap: 10px; margin: 0; }
.fact { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; }
.fact dt { color: var(--muted); font-size: 14px; flex: none; min-width: 92px; }
.fact dd { margin: 0; font-weight: 700; color: var(--brown); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.actions .btn { flex: 1 1 200px; text-decoration: none; }
.insta { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); }
.insta:hover { background: #FDFAF3; }
.insta-icon { position: relative; flex: none; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(45deg, #F9CE34, #EE2A7B 55%, #6228D7); }
.insta-icon::before { content: ''; position: absolute; inset: 9px; border: 2.5px solid #fff; border-radius: 9px; }
.insta-icon::after { content: ''; position: absolute; width: 10px; height: 10px; top: 15px; left: 15px; border: 2.5px solid #fff; border-radius: 50%; box-sizing: border-box; }
.insta-text { display: grid; line-height: 1.7; }
.insta-text strong { font-weight: 500; color: var(--brown); }
.insta-handle { color: var(--muted); font-size: 14px; text-align: right; }
.badge { display: inline-block; margin-inline-start: 8px; padding: 0 8px; border-radius: 99px; background: var(--gold-soft); color: var(--brown); font-size: 12.5px; font-weight: 500; line-height: 1.9; vertical-align: 1px; }
.opt input:checked + label .badge { background: #fff; }

/* questions: extras */
.q-note { font-size: 16px; font-weight: 700; color: var(--brown); padding-top: 14px; border-top: 1px dashed var(--line); }
.q-wrap:first-of-type .q-note { border-top: 0; padding-top: 0; }
.date-row { display: grid; grid-template-columns: 1fr 1.5fr 1.2fr; gap: 8px; }
select.input { appearance: none; -webkit-appearance: none; padding-inline-end: 34px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237A6A55' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat left 12px center; cursor: pointer; }
.req { color: var(--error); margin-inline-start: 4px; font-weight: 700; }
.req-note { margin: 0 0 14px; }
