/* خُطى | KHUTA — site styles */
:root {
  --purple: #41406C;
  --purple-ink: #2E2D52;
  --sage: #81988D;
  --sage-deep: #647A6F;
  --ivory: #F7F8F3;
  --sage-light: #DCE4DE;
  --white: #FFFFFF;
  --text: #2E2D52;
  --muted: #66746D;
  --line: #E4EAE5;
  --danger: #B5475B;
  --danger-bg: #FBEEF0;
  --ok-bg: #EDF3EF;
  --shadow-sm: 0 1px 2px rgba(65, 64, 108, .06), 0 4px 14px rgba(65, 64, 108, .06);
  --shadow-md: 0 2px 6px rgba(65, 64, 108, .06), 0 18px 40px rgba(65, 64, 108, .10);
  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 12px;
  --font-ar: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
  --font-en: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ivory); color: var(--text);
  font-family: var(--font-ar); font-size: 17px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
html[lang="en"] body { font-family: var(--font-en); font-size: 16px; line-height: 1.65; }
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--purple); }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 3px; border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--sage); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: .7em 1.6em; border: 0; border-radius: 999px;
  background: var(--bg); color: var(--fg); font-weight: 600; font-size: 1rem; text-decoration: none;
  cursor: pointer; transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 6px 18px rgba(100, 122, 111, .28);
}
.btn:hover { background: var(--sage-deep); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-quiet { --bg: transparent; --fg: var(--purple); box-shadow: none; border: 1.5px solid var(--sage-light); }
.btn-quiet:hover { background: var(--white); border-color: var(--sage); }
.btn-small { min-height: 40px; padding: .4em 1.1em; font-size: .92rem; box-shadow: none; }
.btn .ico { width: 20px; height: 20px; flex: none; }
html[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247, 248, 243, .88); backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { max-width: 1180px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; text-decoration: none; flex: none; }
.brand img { height: 62px; width: auto; mix-blend-mode: multiply; }
.nav { display: flex; gap: 6px; margin-inline-start: 12px; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: .95rem; }
.nav a:hover { color: var(--purple); background: var(--white); }
.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.lang-switch {
  border: 1.5px solid var(--sage-light); background: transparent; border-radius: 999px;
  padding: 6px 14px; min-height: 40px; cursor: pointer; color: var(--purple); font-weight: 600; font-size: .9rem;
}
.lang-switch:hover { border-color: var(--sage); background: var(--white); }
html[lang="ar"] .lang-switch { font-family: var(--font-en); }
html[lang="en"] .lang-switch { font-family: var(--font-ar); }

/* ---------- language picker ---------- */
.lang-screen { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; position: relative; overflow: hidden; }
.lang-box { width: 100%; max-width: 560px; text-align: center; position: relative; z-index: 1; }
.lang-logo { width: 230px; margin: 0 auto 18px; mix-blend-mode: multiply; }
.lang-title { margin: 0; color: var(--purple); font-size: 1.6rem; font-weight: 700; font-family: var(--font-ar); line-height: 1.5; }
.lang-title-en { margin: 2px 0 28px; color: var(--muted); font-family: var(--font-en); font-weight: 500; font-size: 1.05rem; }
.lang-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.lang-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--white); border: 2px solid transparent; border-radius: var(--r-lg);
  padding: 26px 16px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s, box-shadow .2s;
}
.lang-card:hover { border-color: var(--sage); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.lang-card .flag { font-size: 2.2rem; line-height: 1; }
.lang-card .name { font-size: 1.25rem; font-weight: 700; color: var(--purple); }
.lang-card[data-lang="ar"] .name { font-family: var(--font-ar); }
.lang-card[data-lang="en"] .name { font-family: var(--font-en); }
.trace { position: absolute; pointer-events: none; color: var(--sage); opacity: .35; }

/* ---------- hero ---------- */
.hero { max-width: 1180px; margin: 0 auto; padding: 40px 24px 72px; display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.hero-copy { max-width: 33rem; }
.hero-name {
  margin: 0; color: var(--purple); font-weight: 700; line-height: 1;
  font-size: clamp(4.2rem, 9vw, 7.2rem); letter-spacing: -.01em;
}
html[lang="en"] .hero-name { letter-spacing: -.04em; }
.hero-tagline { margin: 14px 0 0; color: var(--sage-deep); font-weight: 600; font-size: clamp(1.35rem, 2.6vw, 1.85rem); line-height: 1.45; }
.hero-lede { margin: 22px 0 0; color: var(--text); font-size: 1.08rem; max-width: 31rem; }
.hero-cta { margin-top: 30px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.hero-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .95rem; }
.hero-meta svg { width: 18px; height: 18px; color: var(--sage); }

.hero-visual { position: relative; }
.hero-frame {
  position: relative; border-radius: 36px; overflow: hidden; background: #FAF6F0;
  box-shadow: var(--shadow-md); aspect-ratio: 1 / 1;
}
.hero-frame img { width: 100%; height: 100%; object-fit: cover; }
.hero-badge {
  position: absolute; inset-block-end: -22px; inset-inline-start: -22px;
  background: var(--white); border-radius: 22px; padding: 10px 14px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px;
}
.hero-badge img { height: 62px; width: auto; mix-blend-mode: multiply; }
.hero-chip {
  position: absolute; inset-block-start: 26px; inset-inline-end: -16px;
  background: var(--white); border-radius: 16px; padding: 10px 14px; box-shadow: var(--shadow-md);
  display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--purple); font-weight: 600;
}
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--sage); position: relative; flex: none; }
.pulse::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--sage); opacity: 0; animation: ping 2.4s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.5); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- about & features ---------- */
.band { background: var(--white); border-radius: 40px 40px 0 0; }
.section { max-width: 1180px; margin: 0 auto; padding: 72px 24px; }
.section-head { max-width: 40rem; }
.section-head h2 { margin: 0; color: var(--purple); font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.35; }
.section-head p { margin: 14px 0 0; color: var(--muted); font-size: 1.05rem; }
.about-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: start; margin-top: 8px; }
.about-text { font-size: 1.12rem; max-width: 38rem; }
.about-text p { margin: 0 0 1em; }
.about-note {
  background: var(--ivory); border-radius: var(--r-lg); padding: 28px; color: var(--purple);
  border: 1px solid var(--sage-light);
}
.about-note p { margin: 0 0 18px; font-weight: 600; font-size: 1.08rem; }
.feature-list { list-style: none; margin: 36px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 1px solid var(--line); }
.feature-list li { display: flex; gap: 16px; padding: 24px 4px; border-bottom: 1px solid var(--line); }
.feature-list li:nth-child(odd) { padding-inline-end: 28px; }
.feature-list li:nth-child(even) { padding-inline-start: 28px; border-inline-start: 1px solid var(--line); }
.feature-list h3 { margin: 0 0 4px; font-size: 1.08rem; color: var(--purple); }
.feature-list p { margin: 0; color: var(--muted); font-size: .97rem; }
.f-ico { width: 46px; height: 46px; flex: none; border-radius: 14px; background: var(--sage-light); color: var(--purple); display: grid; place-items: center; }
.f-ico svg { width: 24px; height: 24px; }
.cta-strip { text-align: center; padding: 64px 24px 80px; }
.cta-strip h2 { margin: 0 0 8px; color: var(--purple); font-size: clamp(1.5rem, 3vw, 2rem); }
.cta-strip p { margin: 0 0 24px; color: var(--muted); }
.site-footer { text-align: center; color: var(--muted); font-size: .88rem; padding: 26px 20px 34px; border-top: 1px solid var(--line); background: var(--white); }

/* ---------- survey ---------- */
.survey { max-width: 760px; margin: 0 auto; padding: 18px 20px 48px; }
.trail { display: flex; align-items: center; justify-content: center; gap: clamp(6px, 2.4vw, 18px); margin: 8px 0 6px; }
.trail .step { width: 26px; height: 34px; color: var(--sage-light); transition: color .35s, transform .35s; }
.trail .step:nth-child(even) { transform: translateY(-7px); }
.trail .step.done { color: var(--sage); }
.trail .step.current { color: var(--purple); }
.trail .step svg { width: 100%; height: 100%; }
.progress-text { text-align: center; color: var(--muted); font-size: .92rem; margin: 0 0 18px; }
.progress-bar { height: 4px; background: var(--sage-light); border-radius: 4px; overflow: hidden; max-width: 320px; margin: 0 auto 6px; }
.progress-bar span { display: block; height: 100%; width: 0; background: var(--sage); border-radius: inherit; transition: width .4s ease; }

.q-card { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: clamp(22px, 4vw, 40px); }
.q-card.enter { animation: enter .35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.q-num { color: var(--sage-deep); font-weight: 600; font-size: .95rem; margin: 0 0 6px; }
.q-title { margin: 0; color: var(--purple); font-size: clamp(1.3rem, 2.8vw, 1.65rem); line-height: 1.45; }
.q-sub { margin: 8px 0 0; color: var(--muted); }
.req { color: var(--muted); font-size: .85rem; font-weight: 500; }
.q-body { margin-top: 26px; }

.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.options.features { grid-template-columns: 1fr; }
.option {
  position: relative; display: flex; align-items: center; gap: 14px; text-align: start;
  background: var(--ivory); border: 2px solid transparent; border-radius: var(--r-md);
  padding: 16px; cursor: pointer; transition: border-color .2s, background .2s; width: 100%;
}
.option:hover { border-color: var(--sage-light); background: #F1F4EF; }
.option[aria-checked="true"] { border-color: var(--sage); background: var(--white); box-shadow: var(--shadow-sm); }
.option .o-ico { width: 44px; height: 44px; flex: none; border-radius: 13px; background: var(--white); color: var(--purple); display: grid; place-items: center; transition: background .2s, color .2s; }
.option[aria-checked="true"] .o-ico { background: var(--purple); color: #fff; }
.option .o-ico svg { width: 22px; height: 22px; }
.option .o-text { flex: 1; min-width: 0; }
.option .o-label { font-weight: 600; color: var(--purple); line-height: 1.45; display: block; }
.option .o-desc { color: var(--muted); font-size: .93rem; line-height: 1.6; display: block; margin-top: 3px; }
.option .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--sage-light); flex: none; display: grid; place-items: center; color: #fff; transition: background .2s, border-color .2s; }
.option[aria-checked="true"] .tick { background: var(--sage); border-color: var(--sage); }
.option .tick svg { width: 14px; height: 14px; opacity: 0; }
.option[aria-checked="true"] .tick svg { opacity: 1; }

/* rating */
.rating { padding: 8px 0 4px; }
.emoji-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 4px; height: 92px; }
.emoji-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; cursor: pointer;
  padding: 4px 0; border-radius: 14px;
}
.emoji-btn .e { font-size: 2.1rem; line-height: 1; transition: transform .25s cubic-bezier(.3, 1.5, .5, 1), filter .25s; filter: grayscale(.55); opacity: .75; }
.emoji-btn .n { font-size: .85rem; color: var(--muted); font-weight: 600; font-family: var(--font-en); }
.emoji-btn:hover .e { filter: none; opacity: 1; }
.emoji-btn[aria-pressed="true"] .e { transform: scale(1.65) translateY(-6px); filter: none; opacity: 1; }
.emoji-btn[aria-pressed="true"] .n { color: var(--purple); }
.range-wrap { position: relative; margin: 14px 0 0; }
input[type="range"].rate { -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"].rate::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(to var(--fill-dir, right), var(--sage) var(--fill, 0%), var(--sage-light) var(--fill, 0%)); }
input[type="range"].rate::-moz-range-track { height: 8px; border-radius: 8px; background: var(--sage-light); }
input[type="range"].rate::-moz-range-progress { height: 8px; border-radius: 8px; background: var(--sage); }
input[type="range"].rate::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--white); border: 3px solid var(--purple); box-shadow: var(--shadow-sm); }
input[type="range"].rate::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 3px solid var(--purple); }
.rate.untouched::-webkit-slider-thumb { border-color: var(--sage-light); }
.rate.untouched::-moz-range-thumb { border-color: var(--sage-light); }
.rating-readout { text-align: center; margin-top: 14px; min-height: 2.6em; }
.rating-readout .big { font-size: 2rem; font-weight: 700; color: var(--purple); font-family: var(--font-en); }
.rating-readout .of { color: var(--muted); font-family: var(--font-en); }
.rating-readout .lbl { display: block; color: var(--sage-deep); font-weight: 600; margin-top: -2px; }
.rating-readout .hint { color: var(--muted); font-size: .95rem; }

/* fields */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; color: var(--purple); margin-bottom: 6px; font-size: .97rem; }
.input, .textarea {
  width: 100%; background: var(--ivory); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  padding: 13px 15px; transition: border-color .2s, background .2s; font-size: 1rem;
}
.textarea { min-height: 160px; resize: vertical; line-height: 1.7; }
.input:focus, .textarea:focus { outline: none; border-color: var(--sage); background: var(--white); box-shadow: 0 0 0 4px rgba(129, 152, 141, .18); }
.input.invalid { border-color: var(--danger); background: var(--danger-bg); }
.input[type="tel"], .input[type="email"] { direction: ltr; }
html[dir="rtl"] .input[type="tel"], html[dir="rtl"] .input[type="email"] { text-align: right; }
.field-error { color: var(--danger); font-size: .88rem; margin-top: 5px; display: block; }
.counter { text-align: end; color: var(--muted); font-size: .82rem; margin-top: 4px; font-family: var(--font-en); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.consent { display: flex; gap: 12px; align-items: flex-start; background: var(--ivory); border-radius: var(--r-sm); padding: 14px; cursor: pointer; margin-top: 4px; }
.consent input { width: 22px; height: 22px; accent-color: var(--sage); flex: none; margin-top: 3px; }
.privacy { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); font-size: .9rem; margin-top: 16px; }
.privacy svg { width: 18px; height: 18px; flex: none; margin-top: 4px; color: var(--sage); }

.q-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; }
.q-nav .spacer { flex: 1; }
.alert { border-radius: var(--r-sm); padding: 12px 16px; margin-top: 18px; font-size: .95rem; display: flex; gap: 10px; align-items: flex-start; }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert-info { background: var(--ok-bg); color: var(--sage-deep); }

/* review */
.review-list { margin: 0; padding: 0; list-style: none; }
.review-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.review-list li:last-child { border-bottom: 0; }
.review-q { color: var(--muted); font-size: .9rem; }
.review-a { grid-column: 1; color: var(--purple); font-weight: 600; white-space: pre-wrap; word-break: break-word; }
.review-a.empty { color: var(--muted); font-weight: 400; }
.review-edit { grid-row: 1 / span 2; grid-column: 2; align-self: center; background: none; border: 0; color: var(--sage-deep); font-weight: 600; cursor: pointer; padding: 8px; border-radius: 8px; }
.review-edit:hover { background: var(--ivory); }

/* thanks */
.thanks { max-width: 640px; margin: 0 auto; padding: 32px 20px 64px; text-align: center; }
.thanks-art { width: min(340px, 86%); margin: 0 auto 8px; color: var(--sage); }
.thanks-art .fp { opacity: 0; animation: stepIn .45s ease forwards; }
@keyframes stepIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.thanks h1 { color: var(--purple); font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 10px; line-height: 1.4; }
.thanks p { color: var(--muted); font-size: 1.1rem; margin: 0 auto 26px; max-width: 30rem; }
.thanks .ref { font-size: .9rem; color: var(--muted); margin-bottom: 26px; }
.thanks .ref b { font-family: var(--font-en); color: var(--purple); }

.spinner { width: 18px; height: 18px; border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 20px; }
  .hero-copy { max-width: none; }
  .hero-visual { max-width: 560px; margin: 0 auto; width: 100%; padding: 0 12px; }
  .about-grid { grid-template-columns: 1fr; gap: 28px; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .header-inner { padding: 8px 16px; gap: 10px; }
  .brand img { height: 50px; }
  .header-actions .btn { display: none; }
  .hero { padding: 12px 16px 56px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .hero-badge { inset-inline-start: -4px; inset-block-end: -18px; padding: 8px 10px; }
  .hero-badge img { height: 46px; }
  .hero-chip { inset-inline-end: -4px; inset-block-start: 14px; font-size: .82rem; }
  .section { padding: 52px 16px; }
  .feature-list { grid-template-columns: 1fr; }
  .feature-list li:nth-child(n) { padding-inline: 2px; border-inline-start: 0; }
  .options { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .survey { padding: 10px 14px 40px; }
  .q-nav .btn { flex: 1; }
  .emoji-btn .e { font-size: 1.8rem; }
  .lang-cards { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
