:root {
  --ink: #121212;
  --ink-2: #3a3632;
  --muted: #7a726a;
  --gold: #bc9a6c;
  --gold-d: #9c7c50;
  --gold-l: #efe4d4;
  --beige: #f5f1ec;
  --line: #e3dad0;
  --bg: #faf8f5;
  --card: #ffffff;
  --ok: #3f7d5a;
  --ok-l: #e6f1ea;
  --warn: #a86a1c;
  --warn-l: #fbeedd;
  --bad: #b04a3f;
  --bad-l: #f8e5e2;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(18, 18, 18, 0.04), 0 8px 24px rgba(18, 18, 18, 0.06);
  --font: 'IBM Plex Sans Arabic', system-ui, 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ---------- Header (black bar + gold underline, like the PDF) ---------- */
.topbar {
  background: var(--ink);
  border-bottom: 5px solid var(--gold);
  color: #fff;
}
.topbar-in {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.topbar img { height: 52px; width: auto; display: block; }
.topbar h1 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.topbar p { margin: 0; color: var(--gold); font-size: 0.85rem; }
.topbar .spacer { flex: 1; }
.wide .topbar-in { max-width: 1180px; }

/* ---------- Layout ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 40px; }
.wide .wrap { max-width: 1180px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  display: flex;
  align-items: stretch;
  background: var(--beige);
  border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.num {
  flex: 0 0 56px;
  background: var(--gold);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  display: grid;
  place-items: center;
}
.card-head h2, .card-head h3 {
  margin: 0;
  padding: 12px 16px;
  font-size: 1.05rem;
  font-weight: 700;
  align-self: center;
  line-height: 1.6;
}
.card-body { padding: 20px 18px; }

.banner {
  display: flex;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  min-height: 64px;
}
.banner b { background: var(--gold); padding: 0 24px; display: grid; place-items: center; font-size: 1.2rem; }
.banner span { padding: 12px 18px; align-self: center; color: #e9e2d8; font-size: 0.95rem; }

/* ---------- Progress ---------- */
.progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.progress-bar { flex: 1; height: 8px; background: var(--gold-l); border-radius: 99px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 99px; transition: width 0.35s ease; }
.progress small { color: var(--muted); white-space: nowrap; font-size: 0.85rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field > label, .label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.95rem; }
.field .hint { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.field .err { color: var(--bad); font-size: 0.85rem; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(188, 154, 108, 0.2); }
.input.bad { border-color: var(--bad); }
textarea.input { min-height: 150px; resize: vertical; line-height: 1.8; }
.input[dir='ltr'] { text-align: right; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.nudge { font-size: 0.88rem; color: var(--gold-d); margin-top: 6px; min-height: 1.5em; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-opt {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 99px;
  padding: 7px 16px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.95rem;
}
.chip-opt:hover { border-color: var(--gold); }
.chip-opt[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Range */
.range-wrap { display: flex; align-items: center; gap: 14px; }
.range-wrap output {
  min-width: 64px;
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--gold-d);
  background: var(--gold-l);
  border-radius: 8px;
  padding: 4px 8px;
}
input[type='range'] { flex: 1; accent-color: var(--gold); height: 28px; }

/* ---------- Scenario options ---------- */
.options { display: grid; gap: 10px; }
.opt {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  text-align: right;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  line-height: 1.7;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.opt:hover { border-color: var(--gold); background: #fffdf9; }
.opt:active { transform: scale(0.995); }
.opt .dot {
  flex: 0 0 22px;
  height: 22px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  transition: all 0.15s;
}
.opt[aria-checked='true'] { border-color: var(--gold); background: #fbf6ef; }
.opt[aria-checked='true'] .dot { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 4px #fff; }
.opt:focus-visible, .btn:focus-visible, .chip-opt:focus-visible { outline: 3px solid rgba(188, 154, 108, 0.45); outline-offset: 2px; }

.q-text { font-size: 1.15rem; font-weight: 600; margin: 0 0 18px; line-height: 1.8; }
.followup { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 12px 26px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { background: #2a2622; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: var(--gold-d); }
.btn.ghost { background: transparent; color: var(--ink-2); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--gold); background: #fff; }
.btn.sm { padding: 7px 14px; font-size: 0.88rem; }
.btn.danger { background: transparent; color: var(--bad); border: 1.5px solid var(--bad-l); }
.nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; }
.nav .btn.next { min-width: 150px; }

/* ---------- Screens ---------- */
.screen { animation: enter 0.35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
  .progress-bar i { transition: none; }
}

.hero { text-align: center; padding: 34px 20px; }
.hero .logo-box { background: var(--ink); border-radius: 14px; display: inline-block; padding: 16px 22px; margin-bottom: 20px; }
.hero .logo-box img { height: 96px; display: block; }
.hero h2 { font-size: 1.6rem; margin: 0 0 8px; }
.hero p { color: var(--ink-2); margin: 0 auto 10px; max-width: 480px; }
.job-pill {
  display: inline-block;
  background: var(--gold-l);
  color: var(--gold-d);
  font-weight: 700;
  border-radius: 99px;
  padding: 6px 18px;
  margin: 6px 0 16px;
}
.facts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 22px; margin: 18px 0 26px; color: var(--muted); font-size: 0.9rem; }
.facts span::before { content: '•'; color: var(--gold); margin-left: 6px; }

.done-icon {
  width: 76px; height: 76px; border-radius: 50%;
  background: var(--gold); color: #fff; display: grid; place-items: center;
  margin: 0 auto 18px; font-size: 2.2rem;
}

.alert { border-radius: 8px; padding: 12px 14px; font-size: 0.92rem; margin-bottom: 14px; }
.alert.bad { background: var(--bad-l); color: var(--bad); }
.alert.info { background: var(--beige); color: var(--ink-2); }

.footer {
  max-width: 760px; margin: 0 auto; padding: 14px 16px 28px;
  border-top: 2px solid var(--gold);
  display: flex; justify-content: space-between; color: var(--muted); font-size: 0.82rem;
}
.footer b { color: var(--gold-d); }
.wide .footer { max-width: 1180px; }

.muted { color: var(--muted); }
.gold-t { color: var(--gold-d); }
.spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid var(--gold-l); border-top-color: var(--gold);
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center { text-align: center; }
