:root {
  --navy: #1b2352;
  --navy-2: #2a3570;
  --ink: #1d2235;
  --muted: #5d6478;
  --line: #d5daea;
  --soft: #f3f5fb;
  --bg: #eef1f8;
  --card: #ffffff;
  --yes: #13795b;
  --yes-soft: #e6f5ef;
  --no: #b3261e;
  --no-soft: #fcebea;
  --focus: #3b5bdb;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Vazirmatn', 'Noto Sans Arabic', Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* Header */
.top {
  background: var(--navy);
  color: #fff;
  padding: 28px 0 56px;
  text-align: center;
}
.top .seal {
  width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%;
  background: rgba(255,255,255,.1); display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.25);
}
.top h1 { margin: 0 0 6px; font-size: clamp(22px, 5.4vw, 32px); font-weight: 800; line-height: 1.4; }
.top p { margin: 0 auto; max-width: 560px; color: #d9def0; font-size: 15px; }

main.wrap { margin-top: -36px; padding-bottom: 32px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(27,35,82,.06), 0 6px 20px rgba(27,35,82,.05);
}
.sec-title {
  margin: 0 0 4px; font-size: 18px; font-weight: 800; color: var(--navy);
  border-inline-start: 4px solid var(--navy); padding-inline-start: 10px; line-height: 1.5;
}
.sec-hint { margin: 0 0 18px; color: var(--muted); font-size: 14px; padding-inline-start: 14px; }

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 15px; }
.label small { font-weight: 400; color: var(--muted); }
input[type=text], input[type=tel], input[type=password], select {
  width: 100%; max-width: 100%;
  font: inherit; color: inherit;
  padding: 11px 14px;
  border: 1px solid #c4cadc; border-radius: 10px; background: #fff;
  min-height: 48px;
}
input[type=tel] { direction: ltr; text-align: right; }
input:focus, select:focus { outline: 3px solid rgba(59,91,219,.25); border-color: var(--focus); }

/* Option chips (radio) */
.opts { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.opts legend { padding: 0; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt span {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; min-height: 44px;
  border: 1px solid #c4cadc; border-radius: 999px; background: #fff;
  cursor: pointer; font-size: 15px; user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.opt span::before {
  content: ''; width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid #9aa2ba; flex: none; background: #fff;
}
.opt input:checked + span { background: var(--navy); border-color: var(--navy); color: #fff; }
.opt input:checked + span::before {
  border-color: #fff; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%231b2352' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}
.opt input:focus-visible + span { outline: 3px solid rgba(59,91,219,.35); outline-offset: 2px; }

/* Question */
.question {
  background: var(--soft); border: 1px solid var(--line); border-inline-start: 4px solid var(--navy);
  border-radius: 10px; padding: 16px 18px; text-align: justify;
}
.question p { margin: 0 0 10px; }
.question ol { margin: 0; padding-inline-start: 22px; font-weight: 700; }
.question li { margin-bottom: 6px; }
.question li::marker { color: var(--navy); }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.ans { position: relative; }
.ans input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ans span {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 64px; border: 2px solid #c4cadc; border-radius: 12px; background: #fff;
  font-size: 22px; font-weight: 800; cursor: pointer; transition: all .15s;
}
.ans span::before {
  content: ''; width: 24px; height: 24px; border: 2px solid #9aa2ba; border-radius: 6px; background: #fff; flex: none;
}
.ans.yes input:checked + span { border-color: var(--yes); background: var(--yes-soft); color: var(--yes); }
.ans.no input:checked + span { border-color: var(--no); background: var(--no-soft); color: var(--no); }
.ans input:checked + span::before {
  border-color: currentColor; background: currentColor url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/16px no-repeat;
}
.ans input:focus-visible + span { outline: 3px solid rgba(59,91,219,.35); outline-offset: 2px; }

.confirm { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 15px; }
.confirm input { width: 22px; height: 22px; margin: 3px 0 0; flex: none; accent-color: var(--navy); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; font-size: 17px;
  padding: 12px 22px; min-height: 52px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--navy); color: #fff; width: 100%;
}
.btn:hover { background: var(--navy-2); }
.btn[disabled] { opacity: .6; cursor: wait; }
.btn.ghost { background: #fff; color: var(--navy); border: 1px solid var(--line); }

.note { color: var(--muted); font-size: 14px; margin: 10px 0 0; text-align: center; }
.error {
  display: none; margin-top: 8px; color: var(--no); font-size: 14px; font-weight: 600;
}
.field.bad .error, .error.show { display: block; }
.field.bad input, .field.bad select { border-color: var(--no); }
.form-error {
  display: none; background: var(--no-soft); color: var(--no); border: 1px solid #f1c3c0;
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600;
}
.form-error.show { display: block; }

/* Done */
.done { text-align: center; padding: 34px 20px; }
.done .tick {
  width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 14px;
  background: var(--yes-soft); display: grid; place-items: center; color: var(--yes);
}
.done h2 { margin: 0 0 6px; color: var(--navy); font-size: 24px; }
.receipt {
  display: inline-grid; grid-template-columns: auto auto; gap: 6px 18px; text-align: start;
  background: var(--soft); border: 1px dashed #b9c1da; border-radius: 10px; padding: 14px 18px; margin: 16px 0 6px;
}
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; font-weight: 800; direction: ltr; text-align: right; }

footer.foot {
  background: var(--navy); color: #d9def0; text-align: center; padding: 22px 0 28px; font-size: 14px;
}
footer.foot strong { color: #fff; display: block; margin-top: 8px; font-size: 15px; }
/* visually hidden (no off-screen offset: on an RTL page that would make the page scroll sideways) */
.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0; }

@media (max-width: 480px) {
  .card { padding: 18px 14px; }
  .answers { gap: 10px; }
  .ans span { font-size: 20px; min-height: 58px; }
  .opt span { font-size: 14px; padding: 8px 12px; }
}
