/* Economy Growth Survey — values from the Figma variables (AlMunawarah DS) */
:root {
  --brand: #003200;
  --brand-800: #001a00;
  --brand-200: #94b094;
  --brand-subtle: #e6ede6;
  --text-brand: #002200;
  --inverse: #001200;
  --focus: #2e5e2e;
  --accent: #bb8e11;
  --accent-icon: #9a750e;
  --accent-text: #785c0b;
  --accent-subtle: #fbf6e8;
  --success: #10b981;
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #71717a;
  --text-disabled: #a1a1aa;
  --bg: #ffffff;
  --bg-2: #f7f7f7;
  --bg-3: #efefef;
  --bg-disabled: #f4f4f5;
  --bg-disabled-subtle: #f9fafb;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --border-input: #d0d5dd;
  --error: #ef4444;
  --error-text: #b91c1c;
  --error-subtle: #fef2f2;
  --warning: #f59e0b;
  --warning-text: #b45309;
  --warning-subtle: #fffbeb;
  --shadow: 0 0 20px rgba(0, 0, 0, .05);
  --f-text: 'Smart Madinah Text', 'Montserrat', system-ui, sans-serif;
  --f-title: 'Smart Madinah Title', 'Spectral', serif;
}
html[lang="en"] {
  --f-text: 'Montserrat', system-ui, sans-serif;
  --f-title: 'Spectral', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--f-text);
  font-size: 16px;
  line-height: 1.2;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
p, h1, h2, h3 { margin: 0; }
img { display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; inset-inline-start: 16px; top: -60px; z-index: 50; background: var(--bg); color: var(--brand); padding: 10px 16px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- ES/Top bar ---------- */
.topbar {
  background: var(--brand);
  display: flex; align-items: center;
  padding: 10px 40px;
}
.topbar__side { flex: 1 0 0; display: flex; align-items: center; height: 100px; }
.topbar__side--lang { justify-content: flex-end; }
.logo { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.logo__in { width: 44.8px; display: flex; flex-direction: column; gap: 2.688px; }
.logo__in img { width: 44.8px; }
.logo__in img:nth-child(1) { height: 22.4px; }
.logo__in img:nth-child(2) { height: 15.68px; }
.logo__in img:nth-child(3) { height: 3.584px; }
.lang {
  height: 36px; padding: 0 16px;
  border: 1px solid #fff; border-radius: 9999px;
  color: #fff; font-family: 'Montserrat', sans-serif; font-weight: 600; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color .15s;
}
.lang:hover { background: rgba(255, 255, 255, .12); }
.lang[lang="ar"] { font-family: 'Smart Madinah Text', 'Montserrat', sans-serif; }

/* ---------- ES/Offline banner ---------- */
.offline {
  background: var(--warning-subtle); color: var(--warning-text);
  padding: 8px 24px; display: flex; gap: 8px; align-items: center; justify-content: center;
  font-size: 14px;
}
.offline img { width: 16px; height: 16px; flex: none; }

/* ---------- hero ---------- */
main { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; overflow: clip; }
.hero {
  position: relative; width: 100%;
  background: var(--inverse) center / cover no-repeat;
  display: flex; flex-direction: column; align-items: center;
}
/* 196px, not 200: the web build of the title font sets the first line ~3px wider than Figma */
.hero--intro { background-image: url(../img/hero-intro.jpg); padding: 120px 196px 200px; margin-bottom: -120px; gap: 12px; text-align: center; justify-content: center; }
.hero--survey { background-image: url(../img/hero-survey.jpg); padding: 72px 200px 160px; margin-bottom: -100px; }
.hero--done { background-image: url(../img/hero-done.jpg); height: 720px; margin-bottom: -100px; }
.hero__track { color: var(--accent); font-weight: 600; font-size: 14px; }
.hero__title {
  color: #fff; font-family: var(--f-title); font-weight: 600; font-size: 48px; letter-spacing: -.2px; line-height: 1.2;
  max-width: 1048px;
}

/* ---------- ES/Stepper ---------- */
.stepper { width: 100%; max-width: 1040px; display: flex; flex-direction: column; gap: 16px; }
.stepper__top { display: flex; justify-content: space-between; align-items: center; padding: 0 24px; white-space: nowrap; }
.stepper__track { color: var(--success); font-weight: 600; font-size: 14px; }
.stepper__progress { color: rgba(255, 255, 255, .9); font-size: 14px; }
.steps { display: flex; align-items: flex-start; list-style: none; margin: 0; padding: 0; }
.step { flex: 1 0 0; min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.step__line { position: absolute; top: 19px; height: 2px; inset-inline-start: -50%; inset-inline-end: 50%; background: rgba(255, 255, 255, .5); }
.step--done .step__line, .step--current .step__line { background: var(--success); }
.step__node {
  position: relative; width: 40px; height: 40px; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid rgba(255, 255, 255, .5);
  color: var(--text-3); font-weight: 600; font-size: 14px;
}
.step__node img { width: 16px; height: 16px; }
.step--current .step__node { background: var(--brand); border-color: #fff; color: #fff; }
.step--done .step__node { background: var(--brand); border-color: var(--focus); }
.step--visited .step__node { border-color: var(--accent); color: var(--text-brand); }
.step__label { color: rgba(255, 255, 255, .8); font-size: 14px; text-align: center; width: 100%; padding: 0 4px; }
.step--current .step__label { color: #fff; font-weight: 600; }
button.step__hit { position: absolute; inset: 0; border-radius: 8px; }
button.step__hit:hover ~ .step__node { box-shadow: 0 0 0 4px rgba(255, 255, 255, .25); }

/* ---------- body + card ---------- */
.body { position: relative; width: 800px; max-width: calc(100% - 48px); display: flex; flex-direction: column; gap: 24px; padding-bottom: 64px; }
.card { background: var(--bg); border-radius: 24px; box-shadow: var(--shadow); padding: 40px 40px 24px; display: flex; flex-direction: column; }
.card--intro { gap: 20px; }
.lead { font-size: 18px; font-weight: 500; }

/* ES/Meta chip */
.meta { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-3); border-radius: 9999px; padding: 8px 12px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip img { width: 20px; height: 20px; }

/* intro sections list */
.sections { border-top: 1px solid var(--border); padding-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.sections__title { font-size: 16px; font-weight: 600; }
.sections__grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.sitem { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; }
.sitem__num { width: 32px; height: 32px; flex: none; border-radius: 9999px; background: var(--brand-subtle); color: var(--text-brand); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.sitem__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sitem__title { font-size: 14px; font-weight: 600; }
.sitem__desc { font-size: 14px; color: var(--text-2); }

/* ES/Alert */
.alert { display: flex; gap: 12px; align-items: flex-start; border: 1px solid; border-radius: 12px; padding: 20px; }
.alert > img { width: 20px; height: 20px; flex: none; }
.alert__content { display: flex; flex-direction: column; gap: 4px; flex: 1 0 0; min-width: 0; }
.alert__title { font-size: 14px; font-weight: 600; color: var(--text); }
.alert__body { font-size: 14px; color: var(--text-2); }
.alert__action { padding-top: 8px; }
.alert--error { background: var(--error-subtle); border-color: var(--error); }
.btn-sm { display: inline-flex; align-items: center; padding: 10px 18px; border: 1px solid var(--brand); border-radius: 8px; color: var(--text-brand); font-size: 12px; font-weight: 700; }
.btn-sm:hover { background: var(--brand-subtle); }

/* ES/Section header */
.shead { display: flex; gap: 16px; align-items: flex-start; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.shead__num { width: 64px; height: 64px; flex: none; border-radius: 9999px; background: var(--brand-subtle); color: var(--text-brand); font-family: var(--f-title); font-weight: 700; font-size: 30px; display: flex; align-items: center; justify-content: center; }
.shead__text { flex: 1 0 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.shead__title { font-family: var(--f-title); font-weight: 600; font-size: 24px; }
.shead__desc { font-size: 14px; color: var(--text-2); }
.badge { flex: none; align-self: flex-start; background: var(--accent-subtle); color: var(--accent-text); border-radius: 9999px; padding: 4px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.shead__text .badge { display: none; }

/* ES/Error summary */
.summary { margin-top: 24px; display: flex; gap: 12px; align-items: flex-start; background: var(--error-subtle); border: 1px solid var(--error); border-radius: 12px; padding: 20px; }
.summary > img { width: 20px; height: 20px; flex: none; }
.summary__content { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.summary__title { font-size: 14px; font-weight: 600; }
.summary ul { list-style: none; margin: 0; padding: 0; }
.summary a { color: var(--error-text); font-size: 14px; text-decoration: none; }
.summary a:hover { text-decoration: underline; }
.alert--submit { margin-top: 24px; }

/* question block */
.q { display: flex; flex-direction: column; gap: 16px; padding: 32px 0; border-bottom: 1px solid var(--border); scroll-margin-top: 24px; }
.q:last-child { border-bottom: 0; }
.qh { display: flex; flex-direction: column; gap: 8px; }
.qh__head { display: flex; gap: 12px; align-items: flex-start; }
.qh__num { width: 28px; height: 28px; flex: none; border-radius: 9999px; background: var(--bg-3); font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.qh__title { flex: 1 0 0; min-width: 0; font-size: 16px; font-weight: 600; }
.qh__req { flex: none; border: 1px solid var(--accent-icon); color: var(--accent-text); border-radius: 9999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.qh__hint { display: flex; gap: 8px; align-items: center; padding-inline-start: 40px; }
.qh__hinttext { font-size: 14px; color: var(--text-2); }
.counter { background: var(--bg-3); border-radius: 9999px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ES/Option */
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opts--rows > .opt:last-child:nth-child(odd) { grid-column: 1 / -1; }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 16px 20px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: background-color .12s, border-color .12s;
}
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.opt__label { flex: 1 0 0; min-width: 0; font-size: 16px; }
.opt__ind { width: 20px; height: 20px; flex: none; border: 1px solid var(--border-input); border-radius: 9999px; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.opt--check .opt__ind { border-radius: 6px; }
.opt:hover { background: var(--bg-2); border-color: var(--border-strong); }
.opt.is-on { background: var(--brand-subtle); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.opt.is-on .opt__ind { background: var(--brand); border-color: var(--brand); }
.opt--radio.is-on .opt__ind::after { content: ''; width: 8px; height: 8px; border-radius: 9999px; background: #fff; }
.opt--check.is-on .opt__ind::after { content: ''; width: 14px; height: 14px; background: url(../img/ic-cb-check.svg) center / 11.33px 8.42px no-repeat; }
.opt.is-off { background: var(--bg-disabled); border-color: var(--border); cursor: not-allowed; }
.opt.is-off .opt__label { color: var(--text-disabled); }
.opt.is-off .opt__ind { background: var(--bg-disabled-subtle); }
.q.has-error .opt:not(.is-on) { border-color: var(--error); }
.opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.maxnote { font-size: 14px; color: var(--accent-text); }

/* inputs */
.input {
  width: 100%; height: 48px; padding: 0 16px;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 16px; color: var(--text); outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 1; }
.input:focus, .textarea:focus { border-color: var(--focus); box-shadow: inset 0 0 0 1px var(--focus); }
.input.is-error, .textarea.is-error { border-color: var(--error); box-shadow: none; }
.input[dir="ltr"] { text-align: left; }
.textarea-wrap { display: flex; flex-direction: column; gap: 4px; }
.textarea {
  width: 100%; height: 140px; resize: vertical; padding: 12px 16px;
  background: var(--bg); border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 16px; line-height: 1.2; color: var(--text); outline: none;
}
.chars { font-size: 14px; color: var(--text-3); }

/* ES/Field error */
.ferr { display: flex; gap: 8px; align-items: center; color: var(--error-text); font-size: 14px; }
.ferr img { width: 16px; height: 16px; flex: none; }

/* ES/Scale button */
.scale { display: flex; flex-direction: column; gap: 8px; align-self: flex-start; }
.scale__row { display: flex; gap: 8px; }
.scale__btn {
  width: 56px; height: 56px; flex: none; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--border);
  font-weight: 600; font-size: 16px; color: var(--text);
  display: flex; align-items: center; justify-content: center;
  transition: background-color .12s, border-color .12s;
}
.scale__btn:hover { background: var(--bg-2); border-color: var(--border-strong); }
.scale__btn[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.q.has-error .scale__btn:not([aria-checked="true"]) { border-color: var(--error); }
.scale__ends { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--text-2); white-space: nowrap; }

/* contact details (Q22 = yes) */
.contact { background: var(--bg-2); border-inline-start: 4px solid var(--accent); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.contact__head { display: flex; flex-direction: column; gap: 4px; }
.contact__title { font-size: 16px; font-weight: 600; }
.contact__note { font-size: 14px; color: var(--text-2); }
.contact__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field__label { display: flex; gap: 4px; font-size: 14px; }
.field__label b { font-weight: 600; }
.field__label span { color: var(--text-3); }
.field__hint { font-size: 14px; color: var(--text-3); }

/* ES/Nav actions */
.nav { display: flex; gap: 24px; align-items: center; }
.btn {
  flex: 1 0 0; display: flex; align-items: center; justify-content: center;
  padding: 14px 16px; border-radius: 8px; border: 1px solid transparent;
  font-size: 18px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-800); }
.btn--secondary { border-color: var(--brand); color: var(--text-brand); background: transparent; }
.btn--secondary:hover { background: var(--brand-subtle); }
.btn:disabled { cursor: default; }
.btn--primary:disabled { background: var(--brand-200); border-color: var(--brand-200); }
.btn--secondary:disabled { border-color: var(--border); color: var(--text-disabled); background: transparent; }

/* ES/Save note */
.save { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 14px; color: var(--text-2); min-height: 20px; }
.save img { width: 20px; height: 20px; }
.save--saved { color: var(--text); }
.save--failed { color: var(--error-text); }

/* thank you */
.card--done { padding: 48px 40px; gap: 16px; align-items: center; text-align: center; }
.seal { width: 80px; height: 80px; border-radius: 9999px; background: var(--brand-subtle); border: 2px solid var(--accent); display: flex; align-items: center; justify-content: center; }
.seal img { width: 32px; height: 32px; }
.done__title { font-family: var(--f-title); font-weight: 700; font-size: 30px; }
.done__body { font-size: 18px; font-weight: 500; color: var(--text-2); }
.pill { display: inline-flex; gap: 8px; align-items: center; background: var(--brand-subtle); border-radius: 9999px; padding: 8px 16px; font-size: 14px; }
.pill img { width: 20px; height: 20px; }

/* footer */
.footer { background: var(--brand); color: #fff; padding: 16px; text-align: center; font-size: 14px; }

.screen-enter { animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---------- tablet ---------- */
@media (max-width: 1200px) {
  .hero--intro, .hero--survey { padding-inline: 48px; }
}

/* ---------- mobile (375 frames) ---------- */
@media (max-width: 767px) {
  .topbar { padding: 8px 16px; }
  .topbar__side { height: 100px; }
  .logo { width: 44px; height: 44px; }
  .logo__in { width: 35.2px; gap: 2.112px; }
  .logo__in img { width: 35.2px; }
  .logo__in img:nth-child(1) { height: 17.6px; }
  .logo__in img:nth-child(2) { height: 12.32px; }
  .logo__in img:nth-child(3) { height: 2.816px; }

  .hero--intro { background-image: url(../img/hero-intro-m.jpg); padding: 48px 16px 120px; margin-bottom: -80px; }
  .hero--survey { background-image: url(../img/hero-survey-m.jpg); padding: 24px 16px 108px; margin-bottom: -80px; align-items: stretch; }
  .hero--done { background-image: url(../img/hero-done-m.jpg); height: 440px; margin-bottom: -80px; }
  .hero__title { font-size: 30px; letter-spacing: 0; }

  .stepper { gap: 12px; }
  .stepper__top { padding: 0; }
  .stepper__track { color: var(--accent); }
  .step__label { display: none; }
  .step__line { top: 15px; }
  .step__node { width: 32px; height: 32px; }
  .step__node img { width: 12px; height: 12px; }

  .body { width: 100%; max-width: none; padding: 0 12px 32px; }
  .card { border-radius: 20px; padding: 20px 16px 12px; }
  .lead { font-size: 16px; font-weight: 400; }
  .chip { font-size: 12px; }
  .sections__grid { grid-template-columns: 1fr; }

  .shead { gap: 12px; padding-bottom: 20px; }
  .shead > .badge { display: none; }
  .shead__text .badge { display: inline-block; margin-top: 4px; }
  .shead__num { width: 48px; height: 48px; font-size: 24px; }
  .shead__text { padding-top: 0; }
  .shead__title { font-size: 20px; }

  .q { padding: 24px 0; }
  .opts { grid-template-columns: 1fr; }
  .opts--rows > .opt:last-child:nth-child(odd) { grid-column: auto; }

  .scale { align-self: stretch; }
  .scale__row { display: grid; grid-template-columns: repeat(5, 1fr); }
  .scale--11 .scale__row { grid-template-columns: repeat(6, 1fr); }
  .scale__btn { width: auto; }

  .contact__row { grid-template-columns: 1fr; }

  .body > .save { order: 2; }
  .nav--sticky {
    order: 3; margin: 0 -12px -32px;
    position: sticky; bottom: 0; z-index: 20;
    background: var(--bg); border-top: 1px solid var(--border); box-shadow: var(--shadow);
    flex-direction: column-reverse; gap: 12px; align-items: stretch;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .nav--sticky .btn { flex: none; padding: 10px 16px; }
  .nav--sticky.is-busy .btn { padding: 14px 16px; }

  .card--done { padding: 32px 16px; }
  .done__title { font-size: 24px; }
  .done__body { font-size: 16px; font-weight: 400; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
