:root {
  --yellow: #ffd600;
  --ink: #101010;
  --paper: #fffdf3;
  --white: #fff;
  --muted: #55524a;
  --line: rgba(16, 16, 16, .16);
  --err: #b3261e;
  --err-bg: #fff0ee;
  --gutter: 16px;
  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-ar: "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, "Inter Tight", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--yellow); -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--yellow);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; }
ul { list-style: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
#stage:focus { outline: none; }
.title:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 20; background: var(--ink); color: var(--yellow); padding: 10px 16px; border-radius: 999px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.hp { position: absolute; inset-inline-start: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Arabic (right-to-left) ----------
   Letter spacing breaks Arabic letter joining, so it is reset. Arabic has no capitals. */
:lang(ar) { font-family: var(--font-ar); }
html[dir="rtl"] body { line-height: 1.6; }
html[dir="rtl"] .title,
html[dir="rtl"] .title--xl,
html[dir="rtl"] .opt__t,
html[dir="rtl"] .lbl,
html[dir="rtl"] .btn,
html[dir="rtl"] .progress__label,
html[dir="rtl"] .rv__head h2,
html[dir="rtl"] .resume__t,
html[dir="rtl"] .eyebrow { letter-spacing: 0; text-transform: none; }
html[dir="rtl"] .opt__t, html[dir="rtl"] .lbl, html[dir="rtl"] .check__txt { line-height: 1.55; }
html[dir="rtl"] .opt__d, html[dir="rtl"] .help, html[dir="rtl"] .sub, html[dir="rtl"] .err, html[dir="rtl"] .alert, html[dir="rtl"] .rv dt, html[dir="rtl"] .rv dd { line-height: 1.65; }
html[dir="rtl"] .title { line-height: 1.25; }
html[dir="rtl"] .title--xl { line-height: 1.2; }
html[dir="rtl"] .eyebrow { font-size: 14px; }
/* Brand name and the EN | AR switch keep their own direction and font. */
.brand, .lang { direction: ltr; }
.brand__word { font-family: var(--font); }
.lang button[lang="ar"] { font-family: var(--font-ar); }

/* ---------- header ---------- */
.top {
  max-width: 720px; margin: 0 auto;
  padding: 18px var(--gutter) 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; border-radius: 10px; }
.brand__mark { display: block; flex: none; }
.brand__word { font-weight: 700; font-size: 17px; letter-spacing: -.03em; }
.lang { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; padding: 2px; }
.lang button {
  min-width: 44px; height: 34px; padding: 0 12px; border-radius: 999px;
  font-size: 14px; font-weight: 700; letter-spacing: .02em;
  transition: background .2s, color .2s;
}
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
.lang button:focus-visible { outline-offset: 1px; }

/* ---------- card ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 var(--gutter) 48px; }
.card {
  background: var(--paper);
  border-radius: 28px;
  padding: clamp(22px, 5vw, 48px);
  padding-bottom: clamp(8px, 2vw, 20px);
  box-shadow: 0 24px 60px -28px rgba(16, 16, 16, .35);
}

/* ---------- step chrome ---------- */
.step--in { animation: stepIn .38s var(--ease) both; }
html[dir="rtl"] .step--in { animation-name: stepInRtl; }
@keyframes stepIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes stepInRtl { from { opacity: 0; transform: translateX(-18px); } to { opacity: 1; transform: none; } }

.progress { margin-bottom: 26px; }
.progress__label { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: -.01em; }
/* The fill grows from the inline start edge, so it fills from the right in Arabic. */
.progress__bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress__bar i { display: block; height: 100%; background: var(--ink); border-radius: 4px; transition: width .4s var(--ease); }

.eyebrow {
  display: inline-block; margin-bottom: 18px; padding: 6px 12px;
  background: var(--yellow); border-radius: 999px;
  font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.title {
  font-weight: 700; text-transform: uppercase;
  font-size: clamp(27px, 7vw, 40px); line-height: 1.02; letter-spacing: -.035em;
  margin-bottom: 10px; text-wrap: balance;
}
.title--xl { font-size: clamp(34px, 9.5vw, 56px); line-height: .98; letter-spacing: -.045em; }
.sub { color: var(--muted); font-size: 17px; max-width: 56ch; }
.sub--lg { font-size: 18px; margin-top: 4px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 8px; }
.facts li {
  padding: 8px 14px; border: 2px solid var(--ink); border-radius: 999px;
  font-size: 14px; font-weight: 600;
}
.resume { margin-top: 22px; padding: 18px; border-radius: 18px; background: var(--white); border: 2px solid var(--ink); }
.resume__t { font-size: 18px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 4px; }

/* ---------- fields ---------- */
.field { margin-top: 30px; }
.field[hidden] { display: none; }
.lbl { display: block; font-size: 17px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; margin-bottom: 8px; padding: 0; }
.req { color: var(--ink); font-weight: 700; margin-inline-start: 3px; }
.help { font-size: 15px; color: var(--muted); margin: -2px 0 10px; }
.help--check { margin: 4px 0 0; margin-inline-start: 42px; }
fieldset { border: 0; min-width: 0; }

.input {
  display: block; width: 100%; min-height: 54px;
  padding: 14px 16px;
  font: inherit; font-size: 17px; font-weight: 500; color: var(--ink);
  background: var(--white); border: 2px solid var(--ink); border-radius: 14px;
  -webkit-appearance: none; appearance: none;
}
textarea.input { min-height: 104px; resize: vertical; line-height: 1.4; }
.input::placeholder { color: #6f6b61; opacity: 1; }
.input:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
.input:disabled { background: #ece9dc; color: #6f6b61; border-color: var(--line); }
/* Emails, links, handles and numbers stay left-to-right, but sit on the reading side in Arabic. */
html[dir="rtl"] .input[dir="ltr"] { text-align: right; }
.select {
  padding-inline-end: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.5l6 6 6-6' fill='none' stroke='%23101010' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 18px center;
}
html[dir="rtl"] .select { background-position: left 18px center; }
.field .input + .input { margin-top: 10px; }

/* single checkbox (consent, free profile review) */
.check { position: relative; display: flex; align-items: flex-start; gap: 14px; cursor: pointer; padding: 6px 0; min-height: 44px; }
.check input { position: absolute; inset-inline-start: 0; opacity: 0; width: 28px; height: 28px; margin: 0; cursor: pointer; }
.check__box {
  flex: none; width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 8px; background: var(--white);
  display: grid; place-items: center; transition: background .15s;
}
.check__box::after {
  content: ""; width: 14px; height: 8px; border-left: 3px solid var(--yellow); border-bottom: 3px solid var(--yellow);
  transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform .15s var(--ease);
}
.check input:checked + .check__box { background: var(--ink); }
.check input:checked + .check__box::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.check input:focus-visible + .check__box { outline: 3px solid var(--ink); outline-offset: 3px; }
.check__txt { font-size: 17px; font-weight: 600; line-height: 1.35; padding-top: 2px; }
.field--check { margin-top: 12px; }
.field--consent { margin-top: 34px; padding: 18px; background: var(--white); border: 2px solid var(--ink); border-radius: 18px; }
.field--consent .err { margin-inline-start: 0; }

/* ---------- option cards & chips ---------- */
.opts { display: grid; gap: 10px; }
.opts--cards { grid-template-columns: 1fr; }
.opts--chips { display: flex; flex-wrap: wrap; gap: 8px; }

.opt { position: relative; display: block; }
.opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.opt input:disabled { cursor: not-allowed; }
.opt__body {
  display: flex; align-items: center; gap: 14px; min-height: 56px; height: 100%;
  padding: 14px 16px; background: var(--white); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 16px;
  transition: background .18s, color .18s, transform .18s var(--ease);
}
@media (hover: hover) { .opt input:not(:disabled):not(:checked):hover + .opt__body { transform: translateY(-1px); background: #fff9d6; } }
.opt input:checked + .opt__body { background: var(--ink); color: var(--yellow); }
.opt input:focus-visible + .opt__body { outline: 3px solid var(--ink); outline-offset: 3px; }
.opt input:disabled + .opt__body { opacity: .42; }
.opt__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt__t { font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.opt__d { font-size: 15px; font-weight: 500; line-height: 1.35; color: var(--muted); }
.opt input:checked + .opt__body .opt__d { color: #ffe55c; }

.mark {
  flex: none; width: 24px; height: 24px; border: 2px solid currentColor; border-radius: 50%;
  display: grid; place-items: center;
}
.mark--sq { border-radius: 7px; }
.mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--yellow); transform: scale(0); transition: transform .15s var(--ease); }
.mark--sq::after { width: 12px; height: 7px; border-radius: 0; background: none; border-left: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: rotate(-45deg) translate(1px, -1px) scale(0); }
.opt input:checked + .opt__body .mark { background: var(--yellow); border-color: var(--yellow); }
.opt input:checked + .opt__body .mark::after { transform: scale(1); background: var(--ink); }
.opt input:checked + .opt__body .mark--sq::after { background: none; transform: rotate(-45deg) translate(1px, -1px) scale(1); }

.opt--chips .opt__body { min-height: 46px; padding: 9px 18px; border-radius: 999px; }
.opt--chips .opt__t { font-size: 16px; }

/* ---------- errors ---------- */
.err { color: var(--err); font-size: 15px; font-weight: 600; margin-top: 8px; }
.err::before { content: "! "; font-weight: 700; }
.has-error .input { border-color: var(--err); }
.has-error .opt__body, .has-error .check__box { border-color: var(--err); }
.has-error .lbl { color: var(--err); }
.alert {
  margin-top: 20px; padding: 12px 16px; border-radius: 14px;
  background: var(--err-bg); border: 2px solid var(--err); color: #7a1912; font-weight: 600; font-size: 16px;
}
.alert[hidden] { display: none; }
.alert a { display: inline-block; font-weight: 700; overflow-wrap: anywhere; unicode-bidi: isolate; }

/* ---------- navigation ---------- */
.nav {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; justify-content: space-between; gap: 12px;
  margin: 34px calc(-1 * clamp(22px, 5vw, 48px)) 0;
  padding: 16px clamp(22px, 5vw, 48px) calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--paper) 72%, rgba(255, 253, 243, 0));
  border-radius: 0 0 28px 28px;
}
.nav--stack { position: static; flex-direction: column; margin: 28px 0 0; padding: 0 0 12px; background: none; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 0 30px; border: 2px solid var(--ink); border-radius: 999px;
  font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1;
  transition: background .2s, color .2s, transform .2s var(--ease);
}
.btn--solid { background: var(--ink); color: var(--yellow); }
.btn--ghost { background: transparent; color: var(--ink); }
@media (hover: hover) {
  .btn--solid:not(:disabled):hover { background: #2a2a2a; }
  .btn--ghost:not(:disabled):hover { background: var(--yellow); }
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .7; }
/* Back sits at the start edge and Continue at the end edge, so the order mirrors in Arabic. */
.nav .btn--solid { flex: 1 1 auto; max-width: 280px; margin-inline-start: auto; }
.nav--stack .btn { width: 100%; max-width: none; margin: 0; }
.spin { display: none; width: 18px; height: 18px; border: 3px solid rgba(255, 214, 0, .35); border-top-color: var(--yellow); border-radius: 50%; animation: spin .7s linear infinite; }
.is-loading .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { text-decoration: underline; text-underline-offset: 4px; font-weight: 700; padding: 8px 4px; min-height: 40px; border-radius: 8px; }
@media (hover: hover) { .link:hover { background: var(--yellow); } }

/* ---------- review ---------- */
.rv { margin-top: 22px; padding: 16px 18px; background: var(--white); border: 2px solid var(--line); border-radius: 18px; }
.rv__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.rv__head h2 { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; }
.rv__row { padding: 10px 0; border-top: 1px solid var(--line); }
.rv__row:first-child { border-top: 0; }
.rv dt { font-size: 14px; color: var(--muted); font-weight: 600; }
.rv dd { font-size: 16px; font-weight: 600; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Answers typed in English still line up with the Arabic labels above them. */
html[dir="rtl"] .rv dd { text-align: right; }
.rv__none { color: var(--muted); font-size: 15px; padding: 6px 0; }

/* ---------- thanks / cal ---------- */
.step--thanks .sub + .sub { margin-top: 10px; }
.book { margin-top: 22px; color: var(--ink); font-weight: 600; }
.cal {
  margin-top: 16px; min-height: 480px; overflow: auto;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--white);
}
.cal__load { padding: 24px; color: var(--muted); }
html[dir="rtl"] .cal__load { text-align: right; direction: rtl; }
.calink { margin: 16px 0 28px; font-weight: 600; }

/* ---------- larger screens ---------- */
@media (min-width: 560px) {
  .opts--cards.opts--compact { grid-template-columns: 1fr 1fr; }
  .nav--stack { flex-direction: row; }
  .nav--stack .btn { width: auto; min-width: 200px; }
}
@media (min-width: 720px) {
  .top { padding-top: 28px; }
  .wrap { padding-bottom: 72px; }
  .nav { position: static; margin: 38px 0 0; padding: 0 0 16px; background: none; }
}
@media (max-width: 400px) {
  body { font-size: 16px; }
  .btn { padding: 0 20px; }
  .brand__word { font-size: 15px; }
}

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