/* ============================================================
   تحدي اليوم الوطني 96 — Modern Light Design
   موبايل-فيرست | أخضر + أبيض | 2026
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap');

:root {
  /* ألوان اليوم الوطني */
  --green:      #0d6e3f;
  --green2:     #0a5530;
  --green-lt:   #e8f5ee;
  --green-mid:  rgba(13,110,63,0.12);
  --green-bdr:  rgba(13,110,63,0.18);

  /* خلفيات */
  --bg:         #ffffff;
  --bg2:        #f7faf8;
  --bg3:        #eef6f1;
  --surface:    #ffffff;

  /* نصوص */
  --text:       #0f1f16;
  --text2:      #3d5a47;
  --muted:      #7a9485;
  --muted2:     #b0c9bb;

  /* ذهبي — للكود والخصم */
  --gold:       #c49a1a;
  --gold-lt:    rgba(196,154,26,0.1);
  --gold-bdr:   rgba(196,154,26,0.22);

  /* حدود */
  --border:     rgba(13,110,63,0.13);
  --border2:    #e5ede8;

  /* حالات */
  --correct-bg: #dcfce7;
  --correct:    #16a34a;
  --wrong-bg:   #fee2e2;
  --wrong:      #dc2626;

  /* شكل */
  --r:    24px;
  --r2:   16px;
  --r3:   12px;
  --r4:   8px;

  /* ظلال */
  --shadow-sm:  0 1px 4px rgba(13,110,63,0.08);
  --shadow-md:  0 4px 16px rgba(13,110,63,0.12);
  --shadow-lg:  0 8px 32px rgba(13,110,63,0.16);
}

/* ═══════════════════════════════════════
   OVERLAY
   يغطي الشاشة كاملاً دائماً — بما فيها
   المنطقة خلف الكيبورد
═══════════════════════════════════════ */
#ndQuizOverlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  background: rgba(10,40,22,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-end;
  justify-content: center;
  touch-action: none;
  overflow: hidden;
  /* تحسين أداء الـ transform على iOS */
  will-change: transform;
  -webkit-transform: translateZ(0);
}
#ndQuizOverlay.active { display: flex; }

@media (min-width: 600px) {
  #ndQuizOverlay { align-items: center; padding: 20px; }
  #ndQuizModal   { border-radius: var(--r) !important; max-height: 92vh; min-height: unset; }
}

/* ═══════════════════════════════════════
   MODAL
   يتكيف مع الكيبورد عبر --ndq-modal-h
   التي تُحدَّث من JS بـ visualViewport
═══════════════════════════════════════ */
#ndQuizModal {
  position: relative;
  width: 100%;
  max-width: 460px;
  /* الارتفاع الأقصى: visualViewport.height من JS (يتقلص مع الكيبورد) */
  max-height: var(--ndq-modal-h, 92dvh);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg);
  border-radius: var(--r) var(--r) 0 0;
  border-top: 3px solid var(--green);
  font-family: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
  direction: rtl;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 0 -4px 40px rgba(13,110,63,0.18);
  transition: max-height 0.12s ease;
}
#ndQuizModal::-webkit-scrollbar { width: 0; }

/* handle bar فوق الـ Modal للجوال */
#ndQuizModal::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: var(--border2);
  border-radius: 4px;
  margin: 8px auto 0;
}

/* ═══════════════════════════════════════
   HEADER — أبيض نظيف
═══════════════════════════════════════ */
.ndq-header {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #ffffff;
  border-bottom: 1px solid var(--border2);
  overflow: hidden;
  gap: 8px;
}

/* عناصر الهيدر */
.ndq-logo-area,
.ndq-close { position: relative; z-index: 1; }

.ndq-logo-area {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

/* شعار المجمع */
.ndq-clinic-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}

/* شعار عزنا بطبعنا */
.ndq-nd96-slogan {
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}

/* زر الإغلاق */
.ndq-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}
.ndq-close:hover { background: var(--green-lt); color: var(--green); border-color: var(--green-bdr); }

/* ═══════════════════════════════════════
   BODY
═══════════════════════════════════════ */
.ndq-body {
  padding: 18px 16px 80px;
  position: relative;
}

/* إزالة العلامة المائية بالإيموجي */
.ndq-body::before {
  content: none;
}

/* ═══════════════════════════════════════
   PROGRESS DOTS
═══════════════════════════════════════ */
.ndq-progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 18px;
  padding-top: 2px;
}
.ndq-ps-dot {
  height: 5px;
  width: 22px;
  border-radius: 5px;
  background: var(--border2);
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
}
.ndq-ps-dot.active {
  width: 40px;
  background: var(--green);
}
.ndq-ps-dot.done {
  background: var(--green);
  opacity: 0.5;
}

/* ═══════════════════════════════════════
   WELCOME
═══════════════════════════════════════ */
.ndq-welcome-hero {
  text-align: center;
  padding: 4px 0 18px;
}

/* badge اليوم الوطني */
.ndq-nd96-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--green-lt);
  border: 1.5px solid var(--green-bdr);
  border-radius: 50px;
  padding: 6px 16px;
  margin-bottom: 14px;
}
.ndq-nd96-badge-flag  { font-size: 1rem; }
.ndq-nd96-badge-text  {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--green);
  letter-spacing: 0.3px;
}

.ndq-welcome-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.2;
}

.ndq-welcome-sub {
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 0;
}
.ndq-welcome-sub strong { color: var(--green); font-weight: 800; }

/* بطاقة القواعد */
.ndq-rules-box {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--r2);
  padding: 14px 16px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ndq-rule-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
/* أيقونات قواعد اللعبة — نصية (بدون إيموجي) */
.ndq-rule-icon {
  font-size: 0.72rem;
  flex-shrink: 0;
  margin-top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  line-height: 1;
}
.ndq-ri-q { background: var(--green-lt); color: var(--green); border: 1.5px solid var(--green-bdr); font-size: 0.9rem; }
.ndq-ri-r { background: #fef9c3; color: #854d0e; border: 1.5px solid #fde68a; }
.ndq-ri-p { background: var(--green-lt); color: var(--green); border: 1.5px solid var(--green-bdr); }
.ndq-ri-w { background: #dcfce7; color: #15803d; border: 1.5px solid #86efac; font-size: 0.65rem; }
.ndq-rule-text {
  font-size: 0.79rem;
  color: var(--text2);
  line-height: 1.55;
}
.ndq-rule-text strong { color: var(--green); font-weight: 800; }

/* Slogan */
.ndq-slogan {
  text-align: center;
  font-size: 0.72rem;
  color: var(--green);
  letter-spacing: 2px;
  font-weight: 800;
  margin: 14px 0;
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.ndq-slogan::before,
.ndq-slogan::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--green-bdr), transparent);
}

/* ═══════════════════════════════════════
   FORM
═══════════════════════════════════════ */
.ndq-step-head {
  text-align: center;
  margin-bottom: 16px;
}
.ndq-step-head h2 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
}
.ndq-step-head p {
  font-size: 0.79rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.ndq-field { margin-bottom: 13px; }
.ndq-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 6px;
  letter-spacing: 0.2px;
}
.ndq-input {
  width: 100%;
  padding: 13px 14px;
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  border-radius: var(--r3);
  color: var(--text);
  font-size: 0.92rem;
  font-family: 'Tajawal', inherit;
  direction: rtl;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
.ndq-input::placeholder { color: var(--muted2); font-size: 0.83rem; }
.ndq-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(13,110,63,0.08);
  background: #fff;
}
.ndq-input.err { border-color: var(--wrong) !important; }
.ndq-err-msg {
  display: none;
  font-size: 0.7rem;
  color: var(--wrong);
  margin-top: 4px;
}

/* warn */
.ndq-warn-box {
  display: none;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--r3);
  font-size: 0.77rem;
  color: var(--wrong);
  line-height: 1.5;
}
.ndq-warn-box.warn-gold {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

/* ═══════════════════════════════════════
   BUTTONS — Modern Flat
═══════════════════════════════════════ */
.ndq-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 20px;
  border-radius: var(--r2);
  font-size: 0.93rem;
  font-weight: 800;
  font-family: 'Tajawal', inherit;
  cursor: pointer;
  border: none;
  transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
  margin-top: 10px;
  text-decoration: none;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.2px;
  position: relative;
  overflow: hidden;
}
.ndq-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.15s;
}
.ndq-btn:active::after { background: rgba(255,255,255,0.1); }

/* Primary — أخضر */
.ndq-btn-primary {
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(13,110,63,0.3), 0 1px 3px rgba(13,110,63,0.2);
}
.ndq-btn-primary:hover:not(:disabled) {
  background: #0a5530;
  box-shadow: 0 4px 20px rgba(13,110,63,0.35);
  transform: translateY(-1px);
}
.ndq-btn-primary:active:not(:disabled) { transform: scale(0.98); }
.ndq-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* واتساب */
.ndq-btn-wa {
  background: #25d366;
  color: #fff;
  box-shadow: 0 2px 12px rgba(37,211,102,0.3);
  font-size: 0.95rem;
}
.ndq-btn-wa:hover { background: #1dbd5e; transform: translateY(-1px); box-shadow: 0 4px 18px rgba(37,211,102,0.35); }

/* Secondary */
.ndq-btn-secondary {
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  color: var(--muted);
  font-weight: 600;
  box-shadow: none;
}
.ndq-btn-secondary:hover { background: var(--green-lt); border-color: var(--green-bdr); color: var(--green); }

/* ═══════════════════════════════════════
   QUIZ
═══════════════════════════════════════ */
.ndq-quiz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ndq-q-counter {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
}
.ndq-diff-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
}
.ndq-diff-1 { background: #dcfce7; color: #166534; }
.ndq-diff-2 { background: #fef9c3; color: #854d0e; }
.ndq-diff-3 { background: #fee2e2; color: #991b1b; }

/* شريط التقدم */
.ndq-bar-wrap {
  height: 5px;
  background: var(--border2);
  border-radius: 10px;
  margin-bottom: 18px;
  overflow: hidden;
}
.ndq-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 10px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* نص السؤال */
.ndq-q-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 12px;
  text-align: right;
  padding: 12px 14px;
  background: var(--bg2);
  border-radius: var(--r2);
  border-right: 3px solid var(--green);
}

/* ═══ OPTIONS ═══ */
.ndq-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ndq-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: var(--r2);
  color: var(--text2);
  font-size: 0.87rem;
  font-weight: 500;
  font-family: 'Tajawal', inherit;
  cursor: pointer;
  text-align: right;
  direction: rtl;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  width: 100%;
  line-height: 1.42;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}
.ndq-opt:hover:not(:disabled) {
  border-color: var(--green);
  background: var(--green-lt);
  color: var(--green);
}
.ndq-opt:active:not(:disabled) { transform: scale(0.99); }
.ndq-opt:disabled { cursor: default; }
.ndq-opt:disabled:not(.correct):not(.wrong) { opacity: 0.45; }

.ndq-opt-letter {
  min-width: 28px;
  height: 28px;
  border-radius: var(--r4);
  background: var(--bg3);
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
  transition: all 0.2s;
}

/* ✅ صحيح */
.ndq-opt.correct {
  border-color: var(--correct) !important;
  background: var(--correct-bg) !important;
  color: #14532d !important;
}
.ndq-opt.correct .ndq-opt-letter {
  background: var(--correct) !important;
  border-color: var(--correct) !important;
  color: #fff !important;
}

/* ❌ خاطئ */
.ndq-opt.wrong {
  border-color: var(--wrong) !important;
  background: var(--wrong-bg) !important;
  color: #7f1d1d !important;
}
.ndq-opt.wrong .ndq-opt-letter {
  background: var(--wrong) !important;
  border-color: var(--wrong) !important;
  color: #fff !important;
}

/* ═══════════════════════════════════════
   RESULT
═══════════════════════════════════════ */
.ndq-result-top {
  text-align: center;
  padding: 8px 0 18px;
}

.ndq-score-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--green-lt);
  border: 3px solid var(--green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 0 0 6px rgba(13,110,63,0.07);
}
.ndq-score-num {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--green);
  line-height: 1;
  font-family: 'Tajawal', sans-serif;
}
.ndq-score-of {
  font-size: 0.63rem;
  color: var(--muted);
  margin-top: 2px;
}
.ndq-result-msg {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.ndq-stars {
  display: flex;
  justify-content: center;
  gap: 5px;
  font-size: 1.3rem;
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.ndq-star { font-size: 1.3rem; transition: transform 0.2s; }
.ndq-star-on  { color: var(--gold); }
.ndq-star-off { color: var(--border2); }

/* بطاقة الخصم */
.ndq-discount-card {
  background: var(--green-lt);
  border: 1.5px solid var(--green-bdr);
  border-radius: var(--r2);
  padding: 16px 16px;
  text-align: center;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.ndq-discount-pct {
  font-size: 3rem;
  font-weight: 900;
  color: var(--green);
  line-height: 1;
  margin-bottom: 4px;
  font-family: 'Tajawal', sans-serif;
}
.ndq-discount-label {
  font-size: 0.8rem;
  color: var(--text2);
  font-weight: 600;
}
.ndq-discount-detail {
  font-size: 0.69rem;
  color: var(--muted);
  margin-top: 5px;
}

/* ═══════════════════════════════════════
   SERVICES (legacy grid)
═══════════════════════════════════════ */
.ndq-services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.ndq-svc-card {
  padding: 14px 10px;
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  border-radius: var(--r2);
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}
.ndq-svc-card:hover { border-color: var(--green); background: var(--green-lt); }
.ndq-svc-card.selected {
  border-color: var(--green) !important;
  background: var(--green-lt) !important;
  box-shadow: 0 0 0 3px rgba(13,110,63,0.12);
}
.ndq-svc-card.selected .ndq-svc-name { color: var(--green); }
.ndq-svc-icon { font-size: 1.5rem; margin-bottom: 6px; }
.ndq-svc-name { font-size: 0.73rem; font-weight: 700; color: var(--text2); line-height: 1.3; }

/* كود التحقق */
.ndq-code-box {
  background: var(--green-lt);
  border: 2px dashed var(--green-bdr);
  border-radius: var(--r2);
  padding: 18px 16px;
  text-align: center;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}
.ndq-code-box:hover, .ndq-code-box:active { border-color: var(--green); background: #ddf0e4; }
.ndq-code-title {
  font-size: 0.65rem;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ndq-code-val {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--green);
  letter-spacing: 5px;
  font-family: 'Courier New', monospace;
  margin-bottom: 5px;
}
.ndq-code-hint {
  font-size: 0.62rem;
  color: var(--muted);
}

/* ═══════════════════════════════════════
   SPINNER
═══════════════════════════════════════ */
.ndq-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border2);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: ndqSpin 0.7s linear infinite;
}
@keyframes ndqSpin { to { transform: rotate(360deg); } }


/* ═══════════════════════════════════════
   SERVICE STEP — Footer ثابت
═══════════════════════════════════════ */
.ndq-body-service { padding-bottom: 0; }

.ndq-service-footer {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px max(20px, env(safe-area-inset-bottom, 20px));
  border-top: 1px solid var(--border2);
  margin: 0 -16px;
  box-shadow: 0 -4px 16px rgba(13,110,63,0.06);
}
.ndq-service-footer .ndq-btn { margin-top: 8px; }
.ndq-service-footer .ndq-btn:first-child { margin-top: 0; }

/* ═══════════════════════════════════════
   OFFERS LIST
═══════════════════════════════════════ */
.ndq-offers-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}

/* بطاقة العرض */
.ndq-offer-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px;
  background: var(--bg);
  border: 1.5px solid var(--border2);
  border-radius: var(--r2);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  direction: rtl;
  box-shadow: var(--shadow-sm);
}
.ndq-offer-card:hover {
  border-color: var(--green);
  background: var(--green-lt);
  box-shadow: var(--shadow-md);
}
.ndq-offer-card.selected {
  border-color: var(--green) !important;
  background: var(--green-lt) !important;
  box-shadow: 0 0 0 3px rgba(13,110,63,0.12) !important;
}

/* صورة العرض */
.ndq-offer-img {
  position: relative;
  width: 68px;
  height: 68px;
  border-radius: var(--r3);
  flex-shrink: 0;
  overflow: hidden;
  background: var(--bg3);
}
.ndq-offer-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.18), transparent);
}
.ndq-offer-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13,110,63,0.55);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 900;
}

/* بيانات العرض */
.ndq-offer-info { flex: 1; min-width: 0; }
.ndq-offer-name {
  font-size: 0.87rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ndq-offer-prices {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.ndq-offer-original {
  font-size: 0.74rem;
  color: var(--muted);
  text-decoration: line-through;
}
.ndq-offer-arrow { font-size: 0.7rem; color: var(--muted2); }
.ndq-offer-final {
  font-size: 0.97rem;
  font-weight: 900;
  color: var(--green);
}
.ndq-offer-savings {
  font-size: 0.67rem;
  color: #15803d;
  font-weight: 600;
}

.ndq-no-offers {
  text-align: center;
  color: var(--muted);
  font-size: 0.83rem;
  padding: 30px 0;
}

/* ═══════════════════════════════════════
   CATEGORY GRID — Step 4
═══════════════════════════════════════ */
.ndq-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.ndq-cat-card {
  position: relative;
  height: 115px;
  border-radius: var(--r2);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border2);
  background: var(--bg2);
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}
.ndq-cat-card:hover {
  border-color: var(--green);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.ndq-cat-card.selected {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(13,110,63,0.15) !important;
}

.ndq-cat-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.35s ease;
}
.ndq-cat-card:hover .ndq-cat-card-bg { transform: scale(1.06); }

.ndq-cat-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10,40,22,0.82) 0%,
    rgba(10,40,22,0.35) 55%,
    rgba(10,40,22,0.08) 100%
  );
}

.ndq-cat-card-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.ndq-cat-card-info {
  position: absolute;
  bottom: 0; right: 0; left: 0;
  padding: 8px 10px;
  z-index: 4;
}
.ndq-cat-card-name {
  font-size: 0.83rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.ndq-cat-card-count {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.8);
  font-weight: 600;
}

/* legacy tabs (مخفية الآن) */
.ndq-cat-tabs { display: none; }

/* ═══════════════════════════════════════
   MISC
═══════════════════════════════════════ */
.ndq-body { animation: ndqFadeIn 0.2s ease; }
@keyframes ndqFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════
   SAFE AREA — iPhone home indicator
═══════════════════════════════════════ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  #ndQuizModal {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ─── جوال: تقليص الـ padding للشاشات الصغيرة ─── */
@media (max-width: 390px) {
  .ndq-body { padding: 14px 14px 36px; }
  .ndq-btn  { padding: 13px 18px; font-size: 0.88rem; }
  .ndq-q-text { font-size: 0.95rem; padding: 11px 13px; }
  .ndq-opt    { padding: 11px 12px; font-size: 0.84rem; }
}
