body {
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(1200px 600px at 85% -10%, #efe0fa 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 10%, #f7eefc 0%, transparent 55%),
    var(--lavender-50);
}
.glow {
  position: fixed; inset: auto -20% 60% auto; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 116, 198, .18), transparent 70%);
  pointer-events: none; z-index: 0;
}

.topbar { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 22px 16px 0; }
.wrap { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 8px 16px 40px; }

.hero { text-align: center; padding: 34px 0 26px; }
.hero h1 {
  margin: 14px 0 8px; font-size: clamp(34px, 7vw, 54px); line-height: 1.2; font-weight: 900; letter-spacing: -.01em;
}
.hero .accent {
  background: linear-gradient(90deg, var(--purple) 0%, #9b4cc7 55%, var(--gold-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { margin: 0 auto; max-width: 540px; color: var(--muted); font-size: 16.5px; }
.topbar .logo { height: 40px; }

/* تقييم الطلاب العام */
.score {
  margin: 22px auto 0; display: inline-grid; gap: 10px; max-width: 100%;
  background: rgba(255, 255, 255, .85); border: 1px solid var(--line); border-radius: 22px; padding: 14px 22px; box-shadow: var(--shadow);
}
.score-main { display: flex; align-items: center; justify-content: center; gap: 14px; }
.score-num { font-size: 46px; font-weight: 900; line-height: 1; color: var(--ink); }
.score-side { display: grid; justify-items: start; gap: 4px; }
.score-stars { position: relative; display: inline-block; font-size: 23px; letter-spacing: 3px; line-height: 1; color: #e4daee; font-family: system-ui, sans-serif; }
.score-stars::before { content: '★★★★★'; }
.score-fill { position: absolute; top: 0; right: 0; height: 100%; overflow: hidden; white-space: nowrap; color: var(--star); width: 0; transition: width .6s ease; }
.score-fill::before { content: '★★★★★'; }
.score-sub { font-size: 13.5px; color: var(--muted); font-weight: 700; }
.score-courses { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.score-courses:empty { display: none; }
.score-chip { font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--lavender-50); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; }
.score-chip b { color: var(--gold); font-weight: 800; }

.card {
  background: var(--paper); border-radius: 26px; box-shadow: var(--shadow-lg);
  padding: clamp(20px, 4.5vw, 38px); border: 1px solid rgba(233, 226, 240, .8);
}

.field { border: 0; margin: 0 0 26px; padding: 0; min-width: 0; }
.label { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; margin-bottom: 12px; padding: 0; }
.label em { font-style: normal; font-weight: 500; color: var(--muted-2); font-size: 14px; }
.step {
  width: 28px; height: 28px; border-radius: 50%; flex: none; display: inline-grid; place-items: center;
  background: var(--lavender-100); color: var(--purple); font-size: 14px; font-weight: 800;
}
.hint { margin: 6px 4px 0; font-size: 13px; color: var(--muted-2); }
.err { margin: 6px 4px 0; font-size: 13.5px; color: var(--danger); font-weight: 600; min-height: 0; }
.err:empty { display: none; }

input[type=text], textarea {
  width: 100%; border: 1.5px solid var(--line); background: #fdfcff; border-radius: 14px;
  padding: 13px 16px; font-size: 16px; line-height: 1.7; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; min-height: 96px; }
input[type=text]::placeholder, textarea::placeholder { color: #a7a1b0; }
input[type=text]:focus, textarea:focus { outline: none; border-color: var(--purple-400); background: #fff; box-shadow: 0 0 0 4px rgba(168, 116, 198, .15); }
.invalid input[type=text], .invalid textarea, textarea.invalid, input.invalid { border-color: #e3a19c; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-2 > div > .label { min-height: 28px; }

/* الكورسات */
.courses { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.course {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px; border-radius: 16px;
  border: 1.5px solid var(--line); background: #fff; cursor: pointer; font-weight: 700; line-height: 1.5;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.course:hover { border-color: var(--line-2); background: var(--lavender-50); }
.course input { position: absolute; opacity: 0; pointer-events: none; }
.course .dot {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center;
  transition: border-color .15s, background .15s;
}
.course .dot::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .15s; }
.course:has(input:checked) { border-color: var(--purple); background: var(--lavender-100); box-shadow: 0 6px 18px rgba(103, 23, 139, .12); }
.course:has(input:checked) .dot { border-color: var(--purple); background: var(--purple); }
.course:has(input:checked) .dot::after { transform: scale(1); }
.course:has(input:focus-visible) { outline: 3px solid rgba(103, 23, 139, .35); outline-offset: 2px; }
.skeleton { height: 60px; border-radius: 16px; background: linear-gradient(90deg, #f3eef8, #faf7fd, #f3eef8); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* النجوم */
.stars-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.stars { display: inline-flex; gap: 6px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label {
  width: 50px; height: 50px; cursor: pointer; border-radius: 14px; display: grid; place-items: center;
  background: var(--lavender-50); border: 1.5px solid var(--line); transition: transform .12s ease, background .15s, border-color .15s;
}
.stars label::before {
  content: ''; width: 30px; height: 30px;
  background: #d9d0e3;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.83 5.73 6.32.92-4.57 4.46 1.08 6.29L12 17.03 6.34 20l1.08-6.29L2.85 9.25l6.32-.92z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.83 5.73 6.32.92-4.57 4.46 1.08 6.29L12 17.03 6.34 20l1.08-6.29L2.85 9.25l6.32-.92z'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: background .15s;
}
.stars label:hover { transform: translateY(-2px) scale(1.04); }
.stars label.on { background: #fff8e8; border-color: #f0d79a; }
.stars label.on::before { background: var(--star); }
.stars input:focus-visible + label { outline: 3px solid rgba(103, 23, 139, .35); outline-offset: 2px; }
.rating-word { font-weight: 800; color: var(--gold); font-size: 16px; min-height: 1em; }

/* الموافقة */
.consent { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-radius: 14px; border: 1.5px solid var(--line);
  cursor: pointer; transition: border-color .15s, background .15s;
}
.opt:hover { background: var(--lavender-50); }
.opt input { margin: 5px 0 0; accent-color: var(--purple); width: 18px; height: 18px; flex: none; }
.opt span { display: grid; line-height: 1.5; }
.opt b { font-weight: 800; }
.opt small { color: var(--muted); font-size: 13.5px; }
.opt:has(input:checked) { border-color: var(--purple); background: var(--lavender-100); }

.hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }

.form-error { color: var(--danger); font-weight: 700; text-align: center; margin: 0 0 12px; }
.form-error:empty { display: none; }
.submit { width: 100%; padding: 16px 22px; font-size: 17px; }
.submit svg { transition: transform .2s; }
.submit:hover svg { transform: translateX(-4px); }

/* الشكر */
.thanks { text-align: center; padding-block: 48px; animation: pop .4s ease; }
.thanks:focus { outline: none; }
.thanks-icon {
  width: 72px; height: 72px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #8f3fc0, #4a1268); box-shadow: 0 12px 30px rgba(103, 23, 139, .3);
}
.thanks h2 { font-size: 28px; margin: 10px 0 6px; font-weight: 900; }
.thanks p { color: var(--muted); max-width: 460px; margin: 0 auto 24px; }
.thanks-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.foot { position: relative; z-index: 1; text-align: center; color: var(--muted-2); font-size: 13px; padding: 0 16px 32px; }
.foot a { color: inherit; }

@media (max-width: 560px) {
  .grid-2 { grid-template-columns: 1fr; }
  .stars label { width: 46px; height: 46px; }
  .stars label::before { width: 27px; height: 27px; }
  .hero { padding-top: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
