/* Modern, responsive, accessible form UI (no frameworks) */

:root {
  --bg0: #070a12;
  --bg1: #0a1021;
  --card: rgba(255, 255, 255, 0.06);
  --card2: rgba(0, 0, 0, 0.22);
  --text: rgba(255, 255, 255, 0.9);
  --muted: rgba(255, 255, 255, 0.65);
  --muted2: rgba(255, 255, 255, 0.45);
  --border: rgba(255, 255, 255, 0.12);
  --border2: rgba(255, 255, 255, 0.18);
  --shadow: rgba(0, 0, 0, 0.45);
  --accentA: #f472b6;
  /* pink */
  --accentB: #22d3ee;
  /* cyan */
  --good: #34d399;
  --bad: #fb7185;

  --r-lg: 18px;
  --r-md: 14px;

  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: 'Comic Neue', cursive;
  margin: 0;
  min-height: 100vh;

  background: linear-gradient(160deg,
      #2A1A47 0%,
      #4B2E83 40%,
      #744CBD 75%,
      #A084E8 100%);

  color: var(--text);
  position: relative;
  overflow-x: hidden;
}

/* ✨ النجوم */
body::before {
  content: "";
  position: absolute;
  width: 200%;
  height: 200%;
  top: -50%;
  left: -50%;

  background-image:
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(1.5px 1.5px at 70% 40%, #FFF6CC, transparent),
    radial-gradient(2px 2px at 50% 80%, white, transparent),
    radial-gradient(1px 1px at 80% 70%, #FFF6CC, transparent),
    radial-gradient(1.5px 1.5px at 30% 60%, white, transparent);

  background-size: 300px 300px;
  animation: starsMove 80s linear infinite, twinkle 3s infinite alternate;
  opacity: 0.8;
}

/* حركة النجوم */
@keyframes starsMove {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(200px);
  }
}

/* ✨ وميض النجوم */
@keyframes twinkle {
  0% {
    opacity: 0.6;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.7;
  }
}

/* ☁️ سحب كرتونية */
.cloud {
  position: absolute;
  background: #ffffff;
  border-radius: 50px;
  opacity: 0.8;
  filter: blur(1px);
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
}

/* شكل السحابة */
.cloud::before {
  width: 60px;
  height: 60px;
  top: -20px;
  left: 10px;
}

.cloud::after {
  width: 80px;
  height: 80px;
  top: -30px;
  right: 10px;
}

/* حركة السحب */
@keyframes moveClouds {
  from {
    transform: translateX(-200px);
  }

  to {
    transform: translateX(120vw);
  }
}

/* سحابة 1 */
.cloud1 {
  width: 120px;
  height: 50px;
  top: 100px;
  left: -150px;
  animation: moveClouds 60s linear infinite;
}

/* سحابة 2 */
.cloud2 {
  width: 150px;
  height: 60px;
  top: 200px;
  left: -200px;
  animation: moveClouds 90s linear infinite;
}

/* 🌙 هلال */
body::after {
  content: "";
  position: absolute;
  top: 100px;
  right: 40px;

  width: 70px;
  height: 70px;

  background: radial-gradient(circle at 30% 30%, #FFF6CC, #F7D774);
  border-radius: 50%;

  /* 👈 صنع شكل الهلال */
  box-shadow: -18px 0 0 8px #2A1A47;

  opacity: 0.9;
  pointer-events: none;
}

body::after {
  animation: floatMoon 4s ease-in-out infinite alternate;
}

@keyframes floatMoon {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(-8px);
  }
}

/* 🕌 زخرفة إسلامية خفيفة */
.islamic-pattern {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 120px;

  background: repeating-linear-gradient(45deg,
      rgba(255, 255, 255, 0.05),
      rgba(255, 255, 255, 0.05) 10px,
      transparent 10px,
      transparent 20px);

  opacity: 0.3;
}

@media (max-width: 768px) {

  body::after {
    display: none;
    /* width: 40px;
    height: 40px;

    top: 100px;
    right: 15px;

    box-shadow: -10px 0 0 5px #2A1A47;
    opacity: 0.8; */

  }

}


/* =========================
   🌟 NAVBAR
========================= */

.navbar {
  width: 100%;
  background: rgba(42, 26, 71, 0.95);
  backdrop-filter: blur(10px);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.navbar__container {
  width: min(1200px, 92%);
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.navbar__logo img {
  height: 55px;
  width: auto;
  display: block;
}

.navbar__actions {
  display: flex;
  align-items: center;
}

.nav-btn {
  text-decoration: none;
  background: linear-gradient(135deg, #9b5cff, #6f42c1);
  color: white;
  padding: 12px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  transition: 0.3s;
  box-shadow: 0 8px 20px rgba(111, 66, 193, 0.25);
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(111, 66, 193, 0.35);
}

/* =========================
   📱 Responsive
========================= */

@media (max-width: 768px) {
  .navbar__container {
    flex-direction: row;
    gap: 12px;
  }

  .navbar__logo img {
    height: 42px;
  }

  .nav-btn {
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 12px;
  }
}

@media (max-width: 480px) {
  .navbar__container {
    width: 95%;
  }

  .nav-btn {
    padding: 8px 14px;
    font-size: 13px;
  }

  .navbar__logo img {
    height: 38px;
  }
}

.popup {
  background: linear-gradient(160deg,
      #2A1A47 0%,
      #4B2E83 40%,
      #744CBD 75%,
      #A084E8 100%);
  padding: 30px;
  border-radius: 16px;
  text-align: center;
}

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(42, 26, 71, 0.9);
  display: none;

  align-items: center;
  justify-content: center;
  flex-direction: column;

  z-index: 9999;
}

.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #fff;
  border-top: 5px solid #F7D774;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.bg__blob {
  position: absolute;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  filter: blur(52px);
  opacity: 0.55;
  transform: translateZ(0);
}

.bg__blob--a {
  top: -10rem;
  left: 50%;
  margin-left: -17rem;
  background: rgba(244, 114, 182, 0.22);
}

.bg__blob--b {
  bottom: -12rem;
  right: -10rem;
  background: rgba(34, 211, 238, 0.18);
}

.bg__blob--c {
  bottom: -14rem;
  left: -12rem;
  background: rgba(129, 140, 248, 0.18);
}

.page {
  width: min(980px, 92vw);
  margin: 0 auto;
  padding: 48px 0 56px;
}

.hero {
  text-align: center;
  margin-bottom: 18px;
}

.pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.25);
}

.hero__title {
  margin: 14px 0 8px;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.hero__subtitle {
  margin: 0 auto;
  max-width: 58ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.card {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.035));
  border-radius: var(--r-lg);
  padding: 18px;
  box-shadow: 0 18px 60px var(--shadow);
  backdrop-filter: blur(10px);
}

.form {
  padding: 6px;
}

.form__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.form__title {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.form__hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.req {
  color: rgba(244, 114, 182, 0.95);
  font-weight: 700;
}

.status {
  min-height: 1.2rem;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
}

.status--ok {
  color: rgba(52, 211, 153, 0.95);
}

.status--bad {
  color: rgba(251, 113, 133, 0.95);
}

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 720px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid .field:nth-child(3) {
    grid-column: span 2;
  }
}

.field {
  text-align: left;
}

.label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 600;
}

.input,
.textarea {
  width: 100%;
  margin-top: 8px;
  padding: 12px 13px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease,
    background 160ms ease;
}

.input::placeholder,
.textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.input:hover,
.textarea:hover {
  border-color: var(--border2);
  background: rgba(255, 255, 255, 0.065);
}

.input:focus,
.textarea:focus {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.input[aria-invalid="true"],
.textarea[aria-invalid="true"] {
  border-color: rgba(251, 113, 133, 0.45);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.12);
}

.error {
  margin: 8px 0 0;
  min-height: 1.1rem;
  color: rgba(251, 113, 133, 0.95);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 18px 0;
}

.qhead {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.question {
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 25px;
}

.question__title {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.question__meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* خيارات الإجابة */
.option {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
  margin-bottom: 12px;
  /* 👈 يجعل الخيارات تحت بعض */

  padding: 12px 14px;
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);

  cursor: pointer;
  transition: 0.2s;
}

/* Hover */
.option:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #F7D774;
}

/* شكل radio */
.option input[type="radio"] {
  flex-shrink: 0;
  transform: scale(1.2);
  accent-color: #F7D774;
}

.choices {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.success-box {
  margin-top: 20px;
  padding: 20px;
  background: #e6fffa;
  border-radius: 10px;
  text-align: center;
}

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.popup {
  background: linear-gradient(160deg,
      #2A1A47 0%,
      #4B2E83 40%,
      #744CBD 75%,
      #A084E8 100%);

  padding: 30px;
  border-radius: 16px;
  text-align: center;
  color: #fff;
  max-width: 400px;
  width: 90%;
  animation: fadeIn 0.4s ease;
}

.popup h2 {
  margin-bottom: 15px;
}

.popup p {
  margin-bottom: 20px;
}

@media (min-width: 720px) {
  .choices {
    grid-template-columns: 1fr 1fr;
  }
}

.choice {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 160ms ease, transform 140ms ease,
    background 160ms ease;
  cursor: pointer;
  user-select: none;
}

.choice:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.choice input {
  margin-top: 3px;
  accent-color: #22d3ee;
}

.choice__text {
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  line-height: 1.35;
}

.answer {
  margin-top: 14px;
}

.helperRow {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: baseline;
}

.counter {
  color: var(--muted2);
  font-size: 12px;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

@media (min-width: 520px) {
  .actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: #0a1021;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 16px 40px rgba(255, 255, 255, 0.08);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.86);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0px);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18),
    0 16px 40px rgba(255, 255, 255, 0.08);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.12);
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

.footer {
  text-align: center;
  color: var(--muted2);
  font-size: 12px;
  margin-top: 18px;
}

.dialog {
  border: none;
  padding: 0;
  width: min(720px, 92vw);
  background: transparent;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
}

.dialog__card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 22, 39, 0.96), rgba(10, 16, 33, 0.96));
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.6);
  padding: 16px;
}

.dialog__top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.dialog__title {
  margin: 0;
  font-size: 16px;
}

.dialog__hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.code {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  overflow: auto;
  max-height: min(52vh, 520px);
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  line-height: 1.55;
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.iconBtn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  border-radius: 12px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: background 140ms ease, transform 140ms ease;
}

.iconBtn:hover {
  background: rgba(255, 255, 255, 0.085);
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}


/* =========================
   📱 Phone Input تحسينات
========================= */

/* يخلي حقل الهاتف بعرض كامل */
.field {
  max-width: 400px;
}

.iti {
  width: 100%;
}

.iti input {
  width: 100% !important;
  padding-left: 90px !important;
}

/* لون القائمة أبيض + النص غامق */
.iti__country-list {
  width: 100% !important;
  /* نفس عرض الحقل */
  max-width: 400px;
  /* حد أقصى مثل الصورة */
  max-height: 250px;
  /* ارتفاع مع Scroll */
  overflow-y: auto;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-size: 14px;
}

/* أسماء الدول */
.iti__country {
  color: #000;
  padding: 8px 10px;
  display: flex;
  align-items: center;
}

/* Hover */
.iti__country:hover {
  background-color: #f5f5f5;
}

/* العلم */
.iti__flag {
  margin-right: 10px;
}

.iti__dial-code {
  color: #888;
  margin-left: auto;
}

/* الدولة المختارة */
.iti__highlight {
  background: #f0f0f0 !important;
}

/* مربع البحث */
.iti__search-input {
  width: 100%;
  padding: 8px;
  border: none;
  border-bottom: 1px solid #ddd;
  outline: none;
}

/* placeholder */
.iti__search-input::placeholder {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
}


.error-box {
  background: #fff5f5;
  border: 2px solid #ff4d4f;
  color: #b42318;
  padding: 18px;
  border-radius: 14px;
  margin-bottom: 20px;
  text-align: center;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(255, 77, 79, 0.08);
}

.error-box h3 {
  margin: 0;
  font-size: 18px;
}

/* =========================
   ANSWER OPTIONS
========================= */

.option {
  display: block;
  padding: 14px 18px;
  margin-bottom: 12px;
  border: 1px solid #f3e22f;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  color: #ffffff;
}

.option:hover {
  border-color: #7c4dff;
  transform: translateY(-2px);
}

.option input[type="radio"] {
  margin-right: 10px;
}

/* الإجابة الصحيحة */
.option.correct {
  border: 2px solid #22c55e !important;

  color: #166534;
}

/* الإجابة الخاطئة */
.option.wrong {
  border: 2px solid #ef4444 !important;
  color: #991b1b;
}

/* تغيير خلفية الـ label عندما يكون الـ input بداخله مختاراً */
.option:has(input[type="radio"]:checked) {
  background-color: #d1e7dd;
  /* اللون الذي تريده */

}