/* =========================================================
   الألوان والخطوط — أسود + ذهبي
   ========================================================= */
:root {
  --bg: #050505;
  --bg-2: #0d0c0a;
  --gold: #d4af37;
  --gold-light: #f6dc8a;
  --gold-dark: #7a5c14;
  --text: #f3efe6;
  --muted: #9a9486;
  --danger: #ff6b5b;
  --radius: 18px;
  --font: "Cairo", system-ui, sans-serif;
  --display: "Bebas Neue", "Cairo", sans-serif;
  --gold-gradient: linear-gradient(180deg, #fff3c4 0%, #e9c55a 40%, #b8902a 70%, #7a5c14 100%);
}

* { box-sizing: border-box; }
/* hidden للمتصفحات القديمة (Safari 15) التي لا تعرف clip */
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, #1a160d 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- الخلفية: دخان + تظليل الأطراف ---------- */
.smoke-bg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  transition: opacity .8s;
}
/* في صفحة المدربين: ضباب خلفي أخف حتى يبرز الدخان الحقيقي */
body[data-screen="coaches"] .smoke-bg { opacity: .2; }
.vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse 75% 70% at 50% 45%, transparent 40%, rgba(0,0,0,.85) 100%);
}

/* ---------- الشريط العلوي ---------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 0;
}
.brand {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: .14em;
  color: var(--text);
  text-decoration: none;
  direction: ltr;
}
.brand span { color: var(--gold); }

main {
  position: relative; z-index: 2;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 16px 40px;
}

/* ---------- انتقال الصفحات ---------- */
.screen.is-entering { animation: screen-in .7s cubic-bezier(.2,.8,.2,1) both; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(18px) scale(.985); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* ---------- العناوين ---------- */
.eyebrow {
  margin: 0 0 6px;
  font-family: var(--display);
  letter-spacing: .3em;
  font-size: 14px;
  color: var(--gold);
  direction: ltr;
}
.title {
  margin: 0;
  font-weight: 900;
  font-size: clamp(34px, 8vw, 64px);
  line-height: 1.15;
}
.title--sm { font-size: clamp(28px, 6.5vw, 44px); }
.subtitle { margin: 10px 0 0; color: var(--muted); font-size: 16px; }

.home-head { text-align: center; padding: 6vh 0 32px; }

.screen-head {
  display: flex; align-items: center; gap: 14px;
  padding: 22px 0 10px;
}
/* زر الرجوع: على اليسار، السهم يشير لليسار، ومعه كلمة "رجوع" */
.back {
  order: 2;
  margin-inline-start: auto;
  flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.55);
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  background: rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .2s, box-shadow .2s;
}
.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.back:hover { background: rgba(212,175,55,.14); box-shadow: 0 0 20px rgba(212,175,55,.25); }
.back:hover svg { transform: translateX(-4px); }

/* =========================================================
   1) الخانتان
   ========================================================= */
@property --angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }

.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 340px));
  justify-content: center;
  gap: 28px;
  perspective: 1200px;
}
.choice {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transform-style: preserve-3d;
  transition: transform .25s ease-out;
  text-align: center;
}
.choice:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 6px; }

/* إطار ذهبي متحرك */
.choice-border {
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--angle), #3a2c08, var(--gold), #fff3c4, var(--gold), #3a2c08 40%, #3a2c08 60%, var(--gold) 80%, #3a2c08);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spin-border 6s linear infinite;
}
@keyframes spin-border { to { --angle: 360deg; } }

.choice-inner {
  position: absolute; inset: 1.5px;
  border-radius: calc(var(--radius) - 1px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px;
  padding: 24px;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(212,175,55,.18), transparent 55%),
    linear-gradient(160deg, #15130e 0%, #070707 100%);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05);
  overflow: hidden;
}
.choice:hover .choice-inner { box-shadow: 0 30px 80px -10px rgba(212,175,55,.25), inset 0 1px 0 rgba(255,255,255,.06); }

.choice-icon {
  width: 64px; height: 64px;
  fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 0 12px rgba(212,175,55,.45));
  transform: translateZ(40px);
}
.choice-title {
  font-family: var(--display);
  font-size: clamp(30px, 4.5vw, 42px);
  line-height: .95;
  letter-spacing: .06em;
  direction: ltr;
  background: var(--gold-gradient);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.choice-sub { color: var(--muted); font-size: 14px; }
.choice-cta {
  margin-top: 6px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.5);
  color: var(--gold-light);
  font-weight: 700;
  font-size: 14px;
  transition: background .2s, color .2s;
}
.choice-cta i { font-style: normal; display: inline-block; transition: transform .2s; }
.choice:hover .choice-cta { background: var(--gold); color: #120e03; }
.choice:hover .choice-cta i { transform: translateX(4px); }

/* الخانة المقفلة */
.choice.is-locked .choice-border { animation: none; background: linear-gradient(160deg, #5a4614, #1d1708 50%, #5a4614); }
.choice.is-locked .choice-inner > :not(.lock-overlay) { filter: blur(3px) grayscale(.6); opacity: .12; }
.lock-overlay {
  position: absolute; inset: 1.5px;
  border-radius: calc(var(--radius) - 1px);
  display: grid; place-items: center; align-content: center; gap: 14px;
  background:
    repeating-linear-gradient(135deg, rgba(212,175,55,.035) 0 10px, transparent 10px 20px),
    radial-gradient(circle at 50% 45%, rgba(0,0,0,.2), rgba(0,0,0,.75));
  overflow: hidden;
}
/* سلسلتان حديديتان متقاطعتان */
.chain {
  position: absolute;
  left: 50%; top: 52%;
  width: 165%; height: 24px;
  filter: drop-shadow(0 8px 6px rgba(0,0,0,.9)) brightness(.9);
}
.chain--a { transform: translate(-50%, -50%) rotate(34deg); }
.chain--b { transform: translate(-50%, -50%) rotate(-34deg); }
.lock-title {
  position: relative;
  font-family: var(--display);
  font-size: clamp(26px, 3.6vw, 34px);
  letter-spacing: .08em;
  direction: ltr;
  color: #8c7a4a;
  text-shadow: 0 2px 10px #000;
}
.padlock {
  position: relative;
  width: 104px; height: 130px;
  margin: -6px 0 -4px;
  transform: rotate(-5deg);
  transform-origin: 50% 8%;
  filter: drop-shadow(0 14px 14px rgba(0,0,0,.9)) drop-shadow(0 0 1px rgba(0,0,0,.9));
}
.soon-badge {
  position: relative;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(212,175,55,.45);
  color: var(--gold-light);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: .05em;
}
.choice.is-shaking .padlock { animation: lock-shake .5s; }
@keyframes lock-shake {
  0%,100% { transform: rotate(-5deg); }
  20% { transform: rotate(-18deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-12deg); }
  80% { transform: rotate(2deg); }
}

/* =========================================================
   2) الكاروسيل
   ========================================================= */
.stage {
  position: relative;
  height: min(62vh, 580px);
  min-height: 420px;
  /* الكاروسيل بعرض الشاشة كاملة، وما يخرج عنها يُقص بدون شريط تمرير أفقي */
  width: 100vw;
  margin-inline: calc(50% - 50vw);
  overflow-x: clip;
  perspective: 1100px;
  touch-action: pan-y;
  user-select: none;
}
.carousel {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
}
.c-item {
  --w: min(52vw, 290px);
  position: absolute;
  left: 50%; bottom: 6%;
  width: var(--w);
  height: 88%;
  margin-left: calc(var(--w) / -2);
  transition: transform .8s cubic-bezier(.2,.8,.2,1), opacity .6s, filter .6s;
  filter: brightness(.38) saturate(.6);
  cursor: pointer;
}
.c-item.is-locked { filter: brightness(.75); }
.c-item.is-active { filter: none; cursor: default; }
.c-item:not(.is-locked).is-active { cursor: pointer; }

/* التوهج الذهبي حول الجسم يوضع هنا وليس على الصورة نفسها:
   القناع (mask) على الصورة يقص كل ما يخرج عن إطارها، فيظهر التوهج كمربع */
.c-figure {
  position: relative;
  width: 100%; height: 100%;
  filter:
    drop-shadow(0 0 1px rgba(246,220,138,.45))
    drop-shadow(0 0 26px rgba(212,175,55,.22));
}
.c-item.is-locked .c-figure {
  filter:
    drop-shadow(0 0 1px rgba(212,175,55,.5))
    drop-shadow(0 0 18px rgba(212,175,55,.12));
}

/* الصورة بخلفية شفافة: المدرب وحده واقف في الدخان */
.c-figure img {
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  /* ذوبان أسفل الجسم في الدخان */
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  filter: contrast(1.08) saturate(.92);
  pointer-events: none;
}

/* فيديو الحركة: فوق الصورة الثابتة بنفس المقاس والتأثيرات، ويظهر عندما يبدأ فقط */
.c-figure .c-intro {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  filter: contrast(1.08) saturate(.92);
  opacity: 0;
  pointer-events: none;
}
.c-figure.is-playing .c-intro { opacity: 1; }
.c-figure.is-playing img { opacity: 0; }

/* المدربون المقفلون: جسم رياضي أسود */
.silhouette {
  display: block;
  width: 100%; height: 100%;
  -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.sil-glow { opacity: .35; }
.c-item.is-active .sil-glow { animation: lock-glow 2.4s ease-in-out infinite; }
@keyframes lock-glow { 50% { opacity: 1; } }

.spotlight {
  position: absolute;
  left: 50%; top: -10%;
  width: min(90vw, 560px); height: 115%;
  transform: translateX(-50%);
  /* ضوء ناعم من الأعلى بدون حواف، حتى لا يظهر كعمود أو مربع خلف المدرب */
  background: radial-gradient(ellipse 42% 62% at 50% 0%, rgba(246,220,138,.13), rgba(246,220,138,.04) 45%, transparent 75%);
  filter: blur(14px);
  pointer-events: none;
}
.floor {
  position: absolute;
  left: 50%; bottom: 0;
  width: min(80vw, 520px); height: 22%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 40% at 50% 60%, rgba(212,175,55,.22), transparent 70%);
  pointer-events: none;
}
.smoke-fg {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 20;
}
/* الدخان البسيط (للأجهزة بدون WebGL): التلاشي في الأسفل والأعلى بـ mask.
   أما الضباب الفيزيائي فيرسم تلاشيه بنفسه داخل الشيدر */
.smoke-fg.is-2d {
  -webkit-mask-image: linear-gradient(to top, transparent 0%, #000 14%, #000 42%, transparent 96%);
  mask-image: linear-gradient(to top, transparent 0%, #000 14%, #000 42%, transparent 96%);
}

.arrow {
  position: absolute; z-index: 30;
  top: 46%;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(212,175,55,.5);
  background: rgba(5,5,5,.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform .2s, background .2s, box-shadow .2s;
}
.arrow svg { width: 22px; height: 22px; fill: none; stroke: var(--gold-light); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.arrow:hover { background: rgba(212,175,55,.15); box-shadow: 0 0 24px rgba(212,175,55,.35); transform: scale(1.08); }
.arrow:active { transform: scale(.95); }
.arrow--left  { left: 16px; }
.arrow--right { right: 16px; }

/* معلومات المدرب تحت الكاروسيل */
.coach-info {
  position: relative; z-index: 3;
  text-align: center;
  margin-top: -8px;
}
.coach-info.is-in > * { animation: info-in .6s cubic-bezier(.2,.8,.2,1) both; }
.coach-info.is-in > :nth-child(2) { animation-delay: .06s; }
.coach-info.is-in > :nth-child(3) { animation-delay: .12s; }
.coach-info.is-in > :nth-child(4) { animation-delay: .18s; }
@keyframes info-in { from { opacity: 0; transform: translateY(12px); } }

.coach-name {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(48px, 11vw, 76px);
  line-height: 1;
  letter-spacing: .06em;
  direction: ltr;
}
.coach-name--locked { color: #3a362c; }
.coach-title { margin: 6px 0 14px; color: var(--muted); font-size: 14px; letter-spacing: .08em; }
.achievements {
  list-style: none; margin: 0 auto 22px; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  max-width: 640px;
}
.achievements li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(212,175,55,.12), rgba(212,175,55,.04));
  border: 1px solid rgba(212,175,55,.3);
  font-size: 14px; font-weight: 600;
}
.ach-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

/* =========================================================
   الأزرار
   ========================================================= */
.btn-gold {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-width: 220px;
  padding: 15px 34px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #f9e39a 0%, #d4af37 50%, #a37f1f 100%);
  color: #140f02;
  font-weight: 900;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 10px 30px -8px rgba(212,175,55,.6), inset 0 1px 0 rgba(255,255,255,.6);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.btn-gold::after {
  /* لمعة تمر على الزر */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shine 3.2s ease-in-out infinite;
}
@keyframes shine { 60%, 100% { transform: translateX(120%); } }
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(212,175,55,.75), inset 0 1px 0 rgba(255,255,255,.6); }
.btn-gold:active { transform: translateY(0) scale(.98); }
.btn-gold:disabled { cursor: not-allowed; }
.btn-gold svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }

.btn-locked {
  background: linear-gradient(180deg, #2a261c, #15130e);
  color: #6f6858;
  box-shadow: inset 0 0 0 1px rgba(212,175,55,.18);
}
.btn-locked::after { display: none; }
.btn-locked:hover { transform: none; box-shadow: inset 0 0 0 1px rgba(212,175,55,.18); }

.btn-block { width: 100%; }

.btn-ghost {
  display: inline-block;
  margin-top: 26px;
  padding: 12px 28px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.5);
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 700;
  transition: background .2s;
}
.btn-ghost:hover { background: rgba(212,175,55,.12); }

/* =========================================================
   3) ما هو هدفك؟
   ========================================================= */
.goals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 26px;
}
.goal {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 34px 20px 28px;
  border-radius: var(--radius);
  border: 1px solid rgba(212,175,55,.22);
  background: linear-gradient(170deg, #15130e, #070707);
  cursor: pointer;
  text-align: center;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), border-color .3s, box-shadow .3s;
}
.goal::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(212,175,55,.2), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}
.goal:hover, .goal:focus-visible, .goal.is-picked {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 20px 50px -15px rgba(212,175,55,.4);
  outline: none;
}
.goal:hover::before, .goal.is-picked::before { opacity: 1; }
.goal svg {
  position: relative;
  width: 58px; height: 58px;
  fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(212,175,55,.45));
}
.goal-title { position: relative; font-size: 21px; font-weight: 800; }
.goal-sub { position: relative; color: var(--muted); font-size: 14px; }

/* المدرب يراقب الزائر من أسفل الصفحة: يملأ المساحة المتبقية حتى أسفل الشاشة */
#screen-goal {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 86px);
  min-height: calc(100dvh - 86px);
}
.watch {
  position: relative;
  flex: 1 1 auto;
  min-height: 140px;
  margin: 16px 0 -40px; /* يصل إلى أسفل الشاشة رغم الهامش السفلي للصفحة */
  pointer-events: none;
  /* التوهج هنا وليس على الصورة، حتى لا يقصه القناع (mask) فيظهر كمربع */
  filter: drop-shadow(0 0 1px rgba(246,220,138,.4)) drop-shadow(0 0 26px rgba(212,175,55,.2));
  animation: watch-in 1s .25s cubic-bezier(.2,.8,.2,1) both;
}
.watch::before {
  content: "";
  position: absolute;
  left: 50%; bottom: 0;
  width: min(80vw, 440px); height: 100%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse 50% 55% at 50% 45%, rgba(212,175,55,.14), transparent 70%);
}
.watch img {
  position: absolute;
  left: 50%; bottom: 0;
  height: 100%;
  max-height: 460px;
  transform: translateX(-50%);
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 80%, transparent 100%);
  filter: contrast(1.08) saturate(.92);
}
@keyframes watch-in { from { opacity: 0; transform: translateY(30px); } }

/* مؤشر الخطوات: المدرب ← الهدف ← معلوماتك */
.steps {
  list-style: none;
  display: flex; align-items: center;
  max-width: 480px;
  margin: 4px 0 22px;
  padding: 0;
}
.steps li {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  color: var(--muted);
  font-size: 14px; font-weight: 700;
  white-space: nowrap;
}
.steps li:last-child { flex: none; }
.steps li:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 2px;
  margin-inline: 10px;
  border-radius: 2px;
  background: rgba(212,175,55,.18);
}
.step-dot {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(212,175,55,.3);
  background: rgba(0,0,0,.45);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1;
}
.step-dot svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.steps .is-done { color: var(--gold-light); }
.steps .is-done .step-dot { background: var(--gold); border-color: var(--gold); color: #140f02; }
.steps li.is-done:not(:last-child)::after { background: var(--gold); }
.steps .is-current { color: var(--text); }
.steps .is-current .step-dot {
  border-color: var(--gold);
  color: var(--gold-light);
  box-shadow: 0 0 0 4px rgba(212,175,55,.14), 0 0 18px rgba(212,175,55,.35);
}

/* =========================================================
   4) النموذج
   ========================================================= */
.summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 22px; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.3);
  background: rgba(212,175,55,.07);
  font-size: 14px;
}
.chip b { color: var(--gold); font-weight: 700; }

.form {
  max-width: 560px;
  padding: 26px 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(212,175,55,.2);
  background: linear-gradient(170deg, rgba(21,19,14,.9), rgba(7,7,7,.92));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.9);
}
.field { display: block; margin: 0 0 18px; border: 0; padding: 0; min-width: 0; }
.field > span, .field legend {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 15px;
  padding: 0;
}
.field input:not([type="radio"]), .field select {
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid #2c2820;
  background: #0b0a08;
  color: var(--text);
  font: inherit;
  font-size: 16px; /* يمنع التكبير التلقائي في iPhone */
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: 18px 50%, 24px 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}
.field input::placeholder { color: #5b564b; }
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,.18);
}
.field input[dir="ltr"] { text-align: right; }
.field-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 14px; }

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.level { position: relative; }
.level input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.level span {
  display: block;
  padding: 12px 8px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid #2c2820;
  background: #0b0a08;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.level input:checked + span {
  border-color: var(--gold);
  background: rgba(212,175,55,.14);
  color: var(--gold-light);
  box-shadow: 0 0 18px -4px rgba(212,175,55,.5);
}
.level input:focus-visible + span { outline: 2px solid var(--gold-light); outline-offset: 2px; }

.error { display: block; min-height: 0; margin-top: 6px; color: var(--danger); font-size: 13px; }
.error:empty { display: none; }
.field.has-error input, .field.has-error select, .field.has-error .level span { border-color: var(--danger); }


.spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(20,15,2,.3);
  border-top-color: #140f02;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.is-loading .spinner { display: inline-block; }
.is-loading .btn-label { opacity: .7; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-msg { margin: 12px 0 0; color: var(--danger); text-align: center; font-size: 14px; }
.form-msg:empty { display: none; }

/* =========================================================
   5) تم التسجيل
   ========================================================= */
.done { text-align: center; padding: 12vh 0 40px; }
.done-badge {
  width: 110px; height: 110px;
  margin: 0 auto 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle, rgba(212,175,55,.25), transparent 70%);
  border: 2px solid var(--gold);
  box-shadow: 0 0 50px rgba(212,175,55,.4);
  animation: pop .6s cubic-bezier(.2,1.4,.4,1) both;
}
.done-badge svg { width: 56px; fill: none; stroke: var(--gold-light); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .6s .35s forwards; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 50;
  left: 50%; bottom: max(28px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  padding: 12px 26px;
  border-radius: 999px;
  background: rgba(10,9,6,.92);
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-weight: 800;
  box-shadow: 0 10px 40px rgba(0,0,0,.6), 0 0 30px rgba(212,175,55,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   الهاتف
   ========================================================= */
@media (max-width: 700px) {
  .home-head { padding: 4vh 0 24px; }
  .choices { grid-template-columns: minmax(0, 340px); gap: 18px; }
  .choice { aspect-ratio: 1.25; }
  .choice-icon { width: 48px; height: 48px; }
  .goals { grid-template-columns: 1fr; gap: 12px; }
  .goal { flex-direction: row; flex-wrap: wrap; text-align: right; padding: 18px; column-gap: 14px; row-gap: 2px; }
  .goal svg { width: 44px; height: 44px; grid-row: span 2; }
  .goal-title { font-size: 18px; }
  .goal-sub { flex-basis: 100%; padding-right: 58px; margin-top: -6px; }
  .arrow { width: 44px; height: 44px; top: 42%; }
  .arrow--left { left: 8px; }
  .arrow--right { right: 8px; }
  .form { padding: 22px 16px; }
}

/* الهاتف في الوضع الأفقي: الشاشة قصيرة، فنصغّر الكاروسيل والعناوين حتى يتسع */
@media (max-height: 500px) and (orientation: landscape) {
  .stage { height: 80vh; min-height: 260px; }
  .home-head { padding: 2vh 0 16px; }
  .screen-head { padding: 10px 0 4px; }
  .choice { aspect-ratio: 1.6; }
}

/* الهواتف الصغيرة جداً (عرض 360 أو أقل): نصغّر مؤشر الخطوات حتى يتسع */
@media (max-width: 360px) {
  .steps li { gap: 6px; font-size: 13px; }
  .steps li:not(:last-child)::after { margin-inline: 6px; }
  .step-dot { width: 26px; height: 26px; font-size: 15px; }
  .step-dot svg { width: 14px; height: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
