/* Markit discovery: premium charcoal surfaces, gold as the one accent, a faint AI aura behind.
   Signature: the gold dot from the "MarKit." wordmark. It leads the progress line, marks every chosen card and
   grows into the confirmation ring. */

:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #1b1b1e;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .16);
  --ink: #f4f2ec;
  --ink-2: #b9b6ad;
  --ink-3: #85827a;
  --gold: #eab320;
  --gold-ink: #101010;
  --gold-soft: color-mix(in oklab, var(--gold) 14%, transparent);
  --err: #ff8a7a;
  --radius: 16px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: 'Poppins', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  color-scheme: dark;
}
:lang(ar), [dir="rtl"] { --font: 'IBM Plex Sans Arabic', 'Poppins', system-ui, sans-serif; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-bottom: 120px; } /* keep focused cards clear of the fixed action bar */
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
.skip { position: fixed; top: 10px; inset-inline-start: 10px; z-index: 20; padding: 10px 16px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); text-decoration: none; transform: translateY(-160%); }
.skip:focus { transform: none; outline: 2px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- aura: Gemini-style light, kept faint ---------- */
.aura { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aura i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; will-change: transform; }
.aura .a1 { width: 60vmax; height: 60vmax; top: -30vmax; inset-inline-end: -18vmax;
  background: radial-gradient(circle, rgba(234, 179, 32, .30), transparent 62%); }
.aura .a2 { width: 46vmax; height: 46vmax; bottom: -26vmax; inset-inline-start: -14vmax;
  background: radial-gradient(circle, rgba(120, 132, 255, .20), transparent 64%); }
.aura .a3 { width: 34vmax; height: 34vmax; top: 38%; inset-inline-start: 46%;
  background: radial-gradient(circle, rgba(255, 128, 92, .12), transparent 66%); }
body::after { /* fine grain so the gradients never band */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("/discovery/grain.svg");
}
@media (prefers-reduced-motion: no-preference) {
  .aura .a1 { animation: drift1 26s var(--ease) infinite alternate; }
  .aura .a2 { animation: drift2 32s var(--ease) infinite alternate; }
  .aura .a3 { animation: drift1 38s var(--ease) infinite alternate-reverse; }
}
@keyframes drift1 { to { transform: translate3d(-6vmax, 5vmax, 0) scale(1.08); } }
@keyframes drift2 { to { transform: translate3d(7vmax, -4vmax, 0) scale(1.1); } }
.app[data-mood="done"] ~ .aura, body[data-mood="done"] .aura i { opacity: .75; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(18px, env(safe-area-inset-top)) clamp(18px, 5vw, 48px) 10px;
}
.mark { display: inline-flex; align-items: center; min-height: 44px; font: 600 22px/1 'Poppins', sans-serif; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.mark b { color: var(--gold); font-weight: 600; }
.mark .dot { color: var(--gold); }
.lang {
  min-height: 38px;
  border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); border-radius: 999px;
  padding: 7px 16px; font-size: 14px; cursor: pointer; transition: border-color .2s, background .2s;
}
.lang:hover { border-color: var(--gold); }
.lang:focus-visible, .btn:focus-visible, .opt input:focus-visible + .card, .field input:focus-visible,
.field select:focus-visible, .field textarea:focus-visible, .consent input:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- progress: a hairline led by the gold dot ---------- */
.progress { padding: 4px clamp(18px, 5vw, 48px) 0; max-width: 760px; width: 100%; margin: 0 auto; }
.track { position: relative; height: 2px; background: var(--line); border-radius: 2px; }
.fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; border-radius: 2px;
  background: linear-gradient(90deg, rgba(234, 179, 32, .15), var(--gold)); transition: width .6s var(--ease); }
[dir="rtl"] .fill { background: linear-gradient(270deg, rgba(234, 179, 32, .15), var(--gold)); }
.bead { position: absolute; inset-inline-end: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 4px rgba(234, 179, 32, .16), 0 0 18px rgba(234, 179, 32, .7); }
.count { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); letter-spacing: .02em; }

/* ---------- step frame ---------- */
.app { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 18px clamp(18px, 5vw, 48px) 120px; outline: none; }
.step { animation: enter .55s var(--ease) both; }
.step.back { animation-name: enterBack; }
.step.still, [dir="rtl"] .step.still { animation: none; } /* first paint and language switch: no entrance */
.step.leaving { animation: leave .22s ease-in both; }
@keyframes enter { from { opacity: 0; transform: translate3d(28px, 0, 0); filter: blur(4px); } }
@keyframes enterBack { from { opacity: 0; transform: translate3d(-28px, 0, 0); filter: blur(4px); } }
[dir="rtl"] .step { animation-name: enterBack; }
[dir="rtl"] .step.back { animation-name: enter; }
@keyframes leave { to { opacity: 0; transform: translate3d(0, -8px, 0); } }

.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin: 0 0 14px; letter-spacing: .02em; }
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
h1:focus { outline: none; } /* focus moves to the heading for screen readers; no ring on a non-control */
h1 { font-weight: 600; font-size: clamp(28px, 6vw, 44px); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 10px; text-wrap: balance; }
[dir="rtl"] h1 { letter-spacing: 0; line-height: 1.35; }
.lead { color: var(--ink-2); margin: 0 0 26px; max-width: 52ch; }
.group + .group { margin-top: 26px; }
.glabel { font-weight: 500; margin: 0 0 4px; font-size: 16px; }
.ghint { color: var(--ink-3); font-size: 13px; margin: 0 0 12px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }

/* ---------- option cards ---------- */
.opts { display: grid; gap: 10px; grid-template-columns: 1fr; }
.opts.grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.opts.row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .opts.grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .opts.row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.opt { position: relative; display: block; cursor: pointer; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 10px, 0); } }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.card {
  position: relative; display: flex; align-items: center; min-height: 58px; height: 100%;
  padding: 14px 18px; padding-inline-end: 40px; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .015));
  box-shadow: inset 0 0 0 1px var(--line); line-height: 1.35; font-size: 15px;
  transition: box-shadow .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}
.card::after { /* the gold dot that marks a choice */
  content: ""; position: absolute; inset-inline-end: 16px; top: 50%; width: 10px; height: 10px; margin-top: -5px;
  border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-2); transition: transform .35s var(--ease), background .2s, box-shadow .2s;
}
.opt:hover .card { box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(255, 255, 255, .05); }
.opt input:checked + .card {
  box-shadow: inset 0 0 0 1.5px var(--gold), 0 10px 30px -12px rgba(234, 179, 32, .45);
  background: linear-gradient(180deg, rgba(234, 179, 32, .10), rgba(234, 179, 32, .03));
}
.opt input:checked + .card::after { background: var(--gold); box-shadow: 0 0 0 4px rgba(234, 179, 32, .18), 0 0 14px rgba(234, 179, 32, .8); animation: pop .4s var(--ease); }
@keyframes pop { 0% { transform: scale(.2); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
.opt input:disabled + .card { opacity: .45; cursor: not-allowed; }

/* ---------- inputs ---------- */
.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 8px; }
.opt-tag { color: var(--ink-3); font-size: 12px; font-weight: 400; margin-inline-start: 8px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 54px; padding: 14px 16px; border-radius: 14px; border: 0; background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; transition: box-shadow .2s;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:hover, .field select:hover, .field textarea:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: inset 0 0 0 1.5px var(--gold); outline: none; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
[dir="rtl"] .field select { background-position: 16px 50%, 22px 50%; }
.phone { display: grid; grid-template-columns: 118px 1fr; gap: 8px; direction: ltr; }
.other { margin-top: 12px; animation: rise .35s var(--ease) both; }
.invalid input, .invalid select, .invalid textarea { box-shadow: inset 0 0 0 1.5px var(--err); }
.err { color: var(--err); font-size: 13px; margin: 8px 0 0; display: flex; gap: 6px; align-items: baseline; animation: rise .25s var(--ease) both; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; margin-top: 6px; }
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--gold); flex: none; }
.hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- actions ---------- */
.actions {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 5;
  padding: 14px clamp(18px, 5vw, 48px) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(11, 11, 12, 0), rgba(11, 11, 12, .92) 34%);
}
.actions .in { max-width: 664px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; padding: 0 26px;
  border-radius: 999px; border: 0; cursor: pointer; font-weight: 500; font-size: 16px;
  transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s, opacity .2s;
}
.btn.primary { flex: 1; background: var(--gold); color: var(--gold-ink); box-shadow: 0 12px 30px -10px rgba(234, 179, 32, .55); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 16px 36px -10px rgba(234, 179, 32, .7); }
.btn.primary:active { transform: translateY(0) scale(.99); }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { color: var(--ink); }
.btn[aria-busy="true"] { opacity: .85; cursor: progress; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(16, 16, 16, .25); border-top-color: var(--gold-ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .arrow { transition: transform .25s var(--ease); }
.btn.primary:hover .arrow { transform: translateX(3px); }
[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
[dir="rtl"] .btn.primary:hover .arrow { transform: scaleX(-1) translateX(3px); }
.alert { margin: 18px 0 0; padding: 14px 16px; border-radius: 14px; background: rgba(255, 138, 122, .08); box-shadow: inset 0 0 0 1px rgba(255, 138, 122, .35); color: #ffd2cb; font-size: 14px; }
.note { margin: 0 0 18px; padding: 10px 14px; border-radius: 12px; background: var(--gold-soft); color: var(--ink); font-size: 14px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.note button { background: none; border: 0; color: var(--gold); cursor: pointer; text-decoration: underline; font-size: 14px; }

/* ---------- welcome ---------- */
.welcome { padding-top: clamp(24px, 10vh, 90px); }
.welcome h1 { font-size: clamp(36px, 8vw, 64px); max-width: 14ch; }
.welcome .lead { font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 30px; }
.chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-2); }
.langpick { display: inline-grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 28px; }
.langpick button { border: 0; background: none; padding: 9px 22px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.langpick button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- done: the dot grows into a ring ---------- */
.done { text-align: center; padding-top: clamp(30px, 12vh, 110px); }
.ring { position: relative; width: 132px; height: 132px; margin: 0 auto 34px; }
.ring .core { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; background: var(--gold);
  box-shadow: 0 0 30px rgba(234, 179, 32, .9); animation: core 1s var(--ease) both; }
.ring .wave { position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--gold); opacity: 0; animation: wave 2.6s var(--ease) infinite; }
.ring .wave:nth-child(2) { animation-delay: .9s; }
.ring svg { position: absolute; inset: 0; }
.ring circle { fill: none; stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 390; stroke-dashoffset: 390; animation: draw 1.4s .35s var(--ease) forwards; transform: rotate(-90deg); transform-origin: center; }
@keyframes core { from { transform: scale(0); } 70% { transform: scale(1.6); } }
@keyframes wave { 0% { transform: scale(.2); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.done h1 { margin-inline: auto; }
.done .lead { margin-inline: auto; }
.ref { display: inline-flex; gap: 10px; align-items: center; margin-top: 8px; padding: 10px 18px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; color: var(--ink-2); }
.ref b { color: var(--ink); font-family: 'Poppins', monospace; letter-spacing: .04em; direction: ltr; }
.tagline { margin-top: 48px; color: var(--ink-3); font-size: 13px; }
.nojs { padding: 40px 0; }

@media (min-width: 900px) {
  .actions { position: static; background: none; padding: 34px 0 0; }
  .actions .in { margin: 0; max-width: none; }
  .btn.primary { flex: 0 0 auto; min-width: 220px; }
  .app { padding-bottom: 80px; }
  html { scroll-padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .step, .step.back, .step.leaving, .opt, .other, .err, .ring .core, .ring .wave,
  .opt input:checked + .card::after { animation: none; }
  .ring circle { animation: none; stroke-dashoffset: 0; }
  .ring .wave { opacity: 0; }
  .fill, .card, .card::after, .btn, .btn .arrow { transition: none; }
}
