/* ===== اختبار العوامل الخمسة — إضافات فوق تصميم استبيان المخططات ===== */

/* الهبوط: خماسي السمات */
.five { position: relative; z-index: 1; display: block; width: min(300px, 84%); margin: 28px auto 0; overflow: visible; }
.five .ring { fill: none; stroke: rgba(184,145,58,.28); stroke-width: 1; }
.five .ring:last-of-type { stroke: rgba(184,145,58,.5); }
.five .spoke { stroke: rgba(184,145,58,.22); stroke-width: 1; }
.five .shape { fill: rgba(214,178,94,.16); stroke: #B8913A; stroke-width: 1.6; stroke-linejoin: round; }
.five .dot { fill: #B8913A; stroke: #FBF7EE; stroke-width: 2; }
.five .dot:nth-of-type(2n) { fill: #8C6A24; }
.five .lbl { font: 600 12.5px var(--ui); fill: #6B5A36; }
@media (prefers-reduced-motion: no-preference) {
  .five .ring, .five .spoke { stroke-dasharray: 1; stroke-dashoffset: 1; animation: bfDraw 1s cubic-bezier(.4,0,.2,1) forwards; animation-delay: var(--d); }
  .five .shape { transform-origin: 180px 128px; transform: scale(.15); opacity: 0; animation: bfGrow 1.1s cubic-bezier(.2,.8,.2,1) .7s forwards; }
  .five .dot, .five .lbl { opacity: 0; animation: bfFade .5s ease-out forwards; animation-delay: var(--d); }
  @keyframes bfDraw { to { stroke-dashoffset: 0; } }
  @keyframes bfGrow { to { transform: scale(1); opacity: 1; } }
  @keyframes bfFade { to { opacity: 1; } }
}

/* «ماذا يقيس؟» */
.dims-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; counter-reset: d; }
.dims-list li {
  counter-increment: d; position: relative; padding: 12px 52px 12px 14px;
  background: #FBF9F5; border: 1px solid #ECE3D1; border-radius: 14px; line-height: 1.7;
}
.dims-list li::before {
  content: counter(d, arabic-indic); position: absolute; right: 12px; top: 13px;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #F1E6C9; color: #8C6A24; font-weight: 700; font-size: 14px;
}
.dims-list b { display: block; font-size: 16px; color: #1E1A14; }
.dims-list span { display: block; font-size: 14.5px; color: #6B6253; }

/* ===== صفحات العبارات ===== */
.progress-row #countLabel { direction: rtl; font-variant-numeric: tabular-nums; color: #8C6A24; font-weight: 600; }
.stem {
  margin-top: 10px; padding: 13px 16px; border-radius: 15px; text-align: center;
  background: linear-gradient(180deg, #FCF5E3 0%, #F4E7C6 100%); color: #6B4A0E;
  border: 1.5px solid #D6B25E; font-weight: 700; font-size: 18px; line-height: 1.5;
  box-shadow: 0 10px 22px -18px rgba(107,74,14,.55);
}
#quizHint { font-weight: 700; color: #3A3226; }
.stem:empty { display: none; }

.q.bf { padding: 16px 14px 14px; margin: 0 0 12px; scroll-margin-top: 140px; }
.q.bf .q-text { display: block; font-size: 18px; line-height: 1.7; margin: 0 0 14px; text-wrap: balance; }
.q.bf .q-num {
  display: grid; place-items: center; width: fit-content; min-width: 22px; height: 22px; padding: 0 5px;
  margin: 0 auto 8px; font-size: 11.5px;
}
.q.bf .q-text small { display: block; margin-top: 6px; font-size: 13.5px; font-weight: 400; line-height: 1.7; color: #7A6E58; }
.q.bf.missing { box-shadow: 0 0 0 2px #E5A88F, 0 6px 18px -10px rgba(40,30,10,.18); }

.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.likert button {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 7px;
  min-height: 74px; padding: 10px 2px 8px; cursor: pointer;
  font-family: var(--ui); font-size: 12.5px; font-weight: 500; line-height: 1.3; color: #4A4235;
  background: #FAF8F4; border: 1px solid #ECE5D7; border-radius: 13px;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
}
.likert button:active { transform: scale(.96); }
.likert i { position: relative; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%; border: 1.6px solid #CBBF9F; background: #fff; }
.likert button:nth-child(1) i, .likert button:nth-child(5) i { width: 24px; height: 24px; }
.likert button:nth-child(3) i { width: 16px; height: 16px; margin-block: 2px; }
.likert button span { text-wrap: balance; }
.likert button[aria-checked="true"] { background: #15120E; border-color: #15120E; color: #E9C877; }
.likert button[aria-checked="true"] i { border-color: #E9C877; background: transparent; }
.likert button[aria-checked="true"] i::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #E9C877; }
@media (hover: hover) { .likert button:hover { border-color: #D6C59A; } }
@media (max-width: 360px) { .likert button { font-size: 11.5px; min-height: 70px; } }

/* ===== النتيجة ===== */
.sec-h { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 14px; font-size: 18px; font-weight: 700; }
.sec-h .rx-tag { margin: 0; }
.profile { margin-top: 6px; }
.dim {
  background: #FFFDF9; border: 1px solid #ECE3D1; border-radius: 18px; padding: 14px 14px 12px; margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(40,30,10,.04), 0 12px 26px -22px rgba(60,44,14,.45);
}
@media (prefers-reduced-motion: no-preference) {
  .dim { animation: bfUp .55s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i) * 80ms); }
  @keyframes bfUp { from { opacity: 0; transform: translateY(10px); } }
}
.dim-top { display: flex; align-items: center; gap: 12px; }
.dim-ic {
  flex: 0 0 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #8C6A24;
  background: linear-gradient(150deg, #FBF3DF 0%, #EFDFB7 100%); box-shadow: inset 0 0 0 1px rgba(184,145,58,.18);
}
.dim-tx { display: flex; flex-direction: column; min-width: 0; line-height: 1.45; }
.dim-tx small { font-size: 12.5px; color: #8A7E68; font-weight: 500; }
.dim-tx b { font-size: 17.5px; font-weight: 700; color: #1E1A14; text-wrap: balance; }
.dim-tx em { font-style: normal; font-size: 13px; color: #A37F2F; font-weight: 500; }

.meter { margin: 16px 2px 2px; }
.m-track { position: relative; height: 12px; border-radius: 99px; background: #F1EBDF; }
.m-track .z { position: absolute; top: 0; bottom: 0; }
.m-track .z0 { background: #E9DFC9; border-radius: 0 99px 99px 0; }
.m-track .z1 { background: #F0E8D6; }
.m-track .z2 { background: #F7F2E7; }
.m-track .z3 { background: #F0E8D6; }
.m-track .z4 { background: #E9DFC9; border-radius: 99px 0 0 99px; }
.m-track .z + .z { box-shadow: inset -1px 0 0 #fff; }
.m-track .z.on { background: linear-gradient(90deg, #D6B25E, #B8913A); }
.m-track .z0.on, .m-track .z4.on { background: linear-gradient(90deg, #B8913A, #8C6A24); }
.m-pin {
  position: absolute; top: 50%; width: 30px; height: 30px; margin-inline-start: -15px; transform: translateY(-50%);
  border-radius: 50%; background: #15120E; border: 2.5px solid #fff; box-shadow: 0 4px 12px -4px rgba(21,18,14,.6);
  display: grid; place-items: center;
}
.m-pin span { color: #E9C877; font-size: 12.5px; font-weight: 700; line-height: 1; }
.m-poles { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12.5px; color: #8A7E68; font-weight: 500; }
.prof-note { margin: 4px 8px 0; }

/* الشرح المجاني */
.rx-gold { border-color: #E6D5AA; background: linear-gradient(180deg, #FFFCF5 0%, #FFFDF9 100%); }
.ex + .ex { border-top: 1px dashed #E8DFCD; margin-top: 16px; padding-top: 16px; }
.ex h4 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; font-size: 16px; font-weight: 700; color: #1E1A14; }
.ex h4 i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #F6EEDB; color: #8C6A24; }
.ex-lv { font-size: 12px; font-weight: 600; color: #8C6A24; background: #F3E9D0; border: 1px solid #E6D5AA; border-radius: 999px; padding: 2px 9px; }
.ex p { margin: 0; font-family: var(--read); font-size: 17px; line-height: 2; color: #2B261E; }
.ex p.ex-def { font-family: var(--ui); font-size: 14px; line-height: 1.8; color: #7A6E58; margin-bottom: 6px; }

/* المدفوع: قريباً */
.rx-soon { background: linear-gradient(155deg, #221C14 0%, #15120E 70%); border-color: #2E271C; cursor: default; }
.rx-soon .rx-row { display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 12px; min-height: 76px; }
.rx-soon .rx-tx b { color: #F6EEDB; }
.rx-soon .rx-tx small { color: #CBB98F; }
.rx-soon .rx-ic { background: rgba(233,200,119,.12); color: #E9C877; box-shadow: inset 0 0 0 1px rgba(233,200,119,.28); }
.rx-soon .rx-tag { color: #15120E; background: linear-gradient(135deg, #F0D58E, #D6B25E); border-color: transparent; }
.rx-soon .soon {
  flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #E9C877; padding: 5px 11px; border-radius: 999px;
  border: 1px dashed rgba(233,200,119,.55);
}

.rx-soft .hrow { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-top: 1px dashed #ECE5D7; font-size: 14px; }
.rx-soft .hrow a { font-size: 13px; font-weight: 600; color: #A37F2F; text-decoration: none; }
.note.warn .btn { margin-top: 10px; width: 100%; }

/* عنوان الهبوط */
.hero-title .ht-alt { display: block; font-size: .5em; font-weight: 600; color: #B8913A; margin: .18em 0 .1em; letter-spacing: 0; }
.hero-title .ht-tail { display: block; font-size: .62em; margin-top: .12em; }
#pageLabel { display: inline-block; transform-origin: right center; }
html:has(body[data-screen="quiz"]), body[data-screen="quiz"] { overflow-x: clip; }

/* وسم الفئة فوق دائرة الدرجة */
.meter { margin-top: 50px; }
.m-tag {
  position: absolute; bottom: 24px; transform: translateX(50%); white-space: nowrap;
  font-style: normal; font-size: 12.5px; font-weight: 700; line-height: 1; color: #6B4A0E;
  background: #F6ECD3; border: 1px solid #E2CC94; border-radius: 999px; padding: 6px 10px;
}
.m-tag::after {
  content: ""; position: absolute; top: 100%; inset-inline-start: 50%; margin-inline-start: -5px;
  border: 5px solid transparent; border-top-color: #E2CC94;
}
.m-tag.at-s { transform: translateX(15px); }
.m-tag.at-s::after { inset-inline-start: 15px; }
.m-tag.at-e { transform: translateX(calc(100% - 15px)); }
.m-tag.at-e::after { inset-inline-start: auto; inset-inline-end: 10px; margin: 0; }

.m-tag { text-align: center; padding: 6px 11px; }
.m-tag b { display: block; font-weight: 700; }
.m-tag small { display: block; margin-top: 4px; font-size: 11px; font-weight: 500; color: #A37F2F; }
.meter:has(.m-tag small) { margin-top: 66px; }
.m-tag:has(small) { border-radius: 14px; }

/* الدورات المرشحة */
.recs { margin: 4px 0 14px; }
.rec {
  display: flex; gap: 14px; align-items: flex-start; padding: 12px; margin-bottom: 12px; text-decoration: none; color: inherit;
  background: #FFFDF9; border: 1px solid #E6D5AA; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(40,30,10,.04), 0 12px 26px -22px rgba(60,44,14,.45);
  -webkit-tap-highlight-color: transparent; transition: transform .12s ease;
}
.rec:active { transform: scale(.985); }
.rec img { flex: 0 0 84px; width: 84px; height: 100px; object-fit: cover; border-radius: 11px; box-shadow: 0 6px 14px -8px rgba(21,18,14,.5); }
.rec-tx { display: flex; flex-direction: column; gap: 4px; min-width: 0; line-height: 1.55; }
.rec-tx small { font-size: 12px; font-weight: 600; color: #A37F2F; }
.rec-tx b { font-size: 16px; font-weight: 700; color: #1E1A14; text-wrap: balance; }
.rec-tx span { font-size: 13.5px; color: #6B6253; }
.rec-tx em { font-style: normal; font-size: 13.5px; font-weight: 700; color: #8C6A24; margin-top: 2px; }

/* بطاقة دورة السمات البارزة */
.feat {
  display: block; position: relative; overflow: hidden; margin-bottom: 12px; padding: 16px 16px 14px; border-radius: 20px;
  text-decoration: none; color: #F6EEDB; background: linear-gradient(155deg, #2A2218 0%, #15120E 65%);
  border: 1px solid #3A3022; box-shadow: 0 18px 34px -22px rgba(21,18,14,.75);
  -webkit-tap-highlight-color: transparent; transition: transform .12s ease;
}
.feat:active { transform: scale(.985); }
.feat::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 70%; height: 90%;
  background: radial-gradient(closest-side, rgba(214,178,94,.22), transparent); pointer-events: none; }
.feat-eye { display: inline-block; font-size: 12px; font-weight: 700; color: #15120E; background: linear-gradient(135deg, #F0D58E, #D6B25E);
  border-radius: 999px; padding: 3px 11px; margin-bottom: 12px; }
.feat-top { display: flex; gap: 14px; align-items: flex-start; }
.feat-top img { flex: 0 0 92px; width: 92px; height: 110px; object-fit: cover; border-radius: 12px; box-shadow: 0 10px 20px -10px rgba(0,0,0,.7); }
.feat-h { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.feat-h b { font-size: 19px; line-height: 1.45; color: #F6EEDB; text-wrap: balance; }
.feat-h small { font-size: 13.5px; line-height: 1.7; color: #CBB98F; }
.feat-list { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px dashed rgba(233,200,119,.25); display: grid; gap: 8px; }
.feat-list li { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: #F1E6C9; }
.feat-list svg { flex: 0 0 auto; color: #E9C877; }
.feat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.feat-foot > span { font-size: 12px; color: #A89870; line-height: 1.5; }
.feat-foot .btn { flex: 0 0 auto; width: auto; min-height: 0; padding: 10px 18px; font-style: normal; font-size: 15px; }

.feat-vid { position: relative; margin: -4px -4px 14px; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.feat-vid iframe, .feat-vid video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; }
.feat .btn { text-decoration: none; }

/* رابط الدورة تحت شرح كل سمة */
.ex-more {
  display: block; width: 100%; margin-top: 12px; padding: 10px 12px; text-align: start; cursor: pointer;
  font-family: var(--ui); font-size: 13.5px; font-weight: 600; line-height: 1.7; color: #8C6A24;
  background: #FBF4E2; border: 1px dashed #E2CC94; border-radius: 12px; -webkit-tap-highlight-color: transparent;
}
.ex-more span { font-weight: 700; }
#courseBox { scroll-margin-top: 16px; }
.ex + .ex-more { margin-top: 18px; }

/* كل سمة في الشرح داخل مربع مستقل واضح */
.ex { background: #fff; border: 1px solid #E6D5AA; border-radius: 16px; padding: 14px 14px 16px;
  box-shadow: 0 1px 2px rgba(40,30,10,.04), 0 10px 22px -20px rgba(60,44,14,.5); }
.ex + .ex { border-top: 1px solid #E6D5AA; margin-top: 12px; padding-top: 14px; }
.ex h4 { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid #F1E8D4; }
.ex p { font-size: 16.5px; line-height: 1.95; }

/* النتائج المختصرة داخل مربع يُطوى (مفتوح افتراضياً) */
.rx-profile .rx-body { padding: 14px 12px 12px; }
.rx-profile .profile { margin-top: 0; }
.rx-profile .dim:last-of-type { margin-bottom: 8px; }

/* الإحالة إلى الفيديو: وسط، أكبر، بأيقونة تشغيل */
.ex-more {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  margin-top: 18px; padding: 18px 16px 16px; font-size: 16.5px; line-height: 1.75; color: #6B4A0E;
  background: linear-gradient(180deg, #FCF5E3 0%, #F4E7C6 100%); border: 1.5px solid #D6B25E; border-radius: 16px;
}
.ex-more > span { font-weight: 700; text-wrap: balance; }
.ex-more > b { font-size: 15px; font-weight: 700; color: #8C6A24; }
.ex-more > b em { display: inline-block; font-style: normal; }
.ex-play {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  color: #15120E; background: linear-gradient(135deg, #F0D58E, #D6B25E); box-shadow: 0 8px 18px -8px rgba(140,106,36,.8);
}
.ex-play svg { margin-left: 3px; }
@media (prefers-reduced-motion: no-preference) {
  .ex-play { animation: bfPulse 2s ease-out infinite; }
  .ex-more > b em { animation: bfBob 1.4s ease-in-out infinite; }
  @keyframes bfPulse { 0% { box-shadow: 0 0 0 0 rgba(214,178,94,.55), 0 8px 18px -8px rgba(140,106,36,.8); } 70%, 100% { box-shadow: 0 0 0 14px rgba(214,178,94,0), 0 8px 18px -8px rgba(140,106,36,.8); } }
  @keyframes bfBob { 50% { transform: translateY(4px); } }
}

/* مربع الدورة يُفتح ويُغلق */
.feat { padding: 0; }
.feat > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 16px; -webkit-tap-highlight-color: transparent; }
.feat > summary::-webkit-details-marker { display: none; }
.feat-sum { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; flex: 1; min-width: 0; position: relative; }
.feat-sum .feat-eye { margin-bottom: 2px; }
.feat-sum b { font-size: 19px; line-height: 1.4; color: #F6EEDB; }
.feat-sum small { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: #E9C877; }
.feat-play { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #15120E; background: linear-gradient(135deg, #F0D58E, #D6B25E); }
.feat-play svg { margin-left: 2px; }
.feat-chev { flex: 0 0 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #E9C877; background: rgba(233,200,119,.12); transition: transform .25s ease; }
.feat[open] .feat-chev { transform: rotate(180deg); }
.feat[open] > summary { border-bottom: 1px dashed rgba(233,200,119,.25); }
.feat-body { padding: 16px 16px 14px; position: relative; }
.feat-body .feat-vid { margin: 0 0 14px; }
@media (prefers-reduced-motion: no-preference) {
  .feat:not([open]) .feat-play { animation: bfPulse 2s ease-out infinite; }
}

/* بدل زر التشغيل النابض: أيقونة فيديو تطفو بهدوء، وكلمتا زواجك/وظيفتك في قالبين */
.ex-play { display: none; }
.ex-cam { display: block; color: #A37F2F; line-height: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ex-cam { animation: bfFloat 3s ease-in-out infinite; }
  @keyframes bfFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-4deg); } }
}
.ex-chip {
  display: inline-block; font-style: normal; font-weight: 700; color: #15120E; line-height: 1.35;
  background: linear-gradient(135deg, #F0D58E, #D6B25E); border-radius: 9px; padding: 2px 10px; margin: 2px 2px;
  box-shadow: 0 3px 8px -4px rgba(140,106,36,.7);
}
.ex-more .nw { white-space: nowrap; }
.ex-more .ex-chip { display: inline; padding: 3px 10px; margin: 0 1px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.ex-more > span { line-height: 2.1; }
.ex-more .ex-chips { display: block; white-space: nowrap; margin: 6px 0; }

/* المقارنة بالنتيجة السابقة */
.bf-cmp { margin: 0 0 4px; border: 1px solid #E6D5AA; }
.bf-cmp .fr { color: #8C6A24; }
