/* =============================================
   مدرسك — تجربة الترحيب والتعريف (Onboarding) — v2.0.0
   مستقلة تمامًا: كل الشرح جوا الكروت، مش بتعتمد على أي عنصر في الصفحة
   ============================================= */

#mdrsk-onb, #mdrsk-onb * { box-sizing: border-box; margin: 0; padding: 0; }

#mdrsk-onb {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important;
  width: 100% !important; height: 100% !important;
  z-index: 200000 !important;
  font-family: 'Tajawal', sans-serif;
  direction: rtl;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  background: linear-gradient(150deg, #0F172A 0%, #16305C 55%, #1D4ED8 120%);
  color: #fff;
  overflow: hidden;
  margin: 0 !important;
}
#mdrsk-onb[data-leaving="1"] { opacity: 0; transition: opacity .35s ease; }

/* توهج خلفي */
.onb-aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.onb-aurora span {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .34;
  animation: onbDrift 16s ease-in-out infinite;
}
.onb-aurora span:nth-child(1){ width:380px;height:380px;background:#3B82F6;top:-12%;right:-8%; }
.onb-aurora span:nth-child(2){ width:320px;height:320px;background:#0EA5E9;bottom:-14%;left:-8%;animation-delay:-6s; }
.onb-aurora span:nth-child(3){ width:240px;height:240px;background:#22C55E;top:40%;left:44%;opacity:.16;animation-delay:-10s; }
@keyframes onbDrift { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(-26px,28px) scale(1.09);} }

/* منطقة التمرير */
.onb-scroll {
  position: relative; z-index: 2;
  flex: 1 1 auto !important; width: 100% !important; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex !important; flex-direction: column !important;
  justify-content: center !important; align-items: center !important;
}
.onb-inner {
  width: 100% !important; max-width: 900px;
  margin: 0 auto !important;
  padding: 64px 22px 44px;
  display: flex !important; flex-direction: column !important; align-items: center !important; text-align: center;
}

/* زر تخطي ثابت أعلى اليسار */
.onb-skip {
  position: absolute; top: 16px; left: 16px; z-index: 5;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.9); font-family: 'Tajawal', sans-serif;
  font-size: .85rem; font-weight: 600; padding: 8px 16px;
  border-radius: 50px; cursor: pointer; transition: all .2s ease; backdrop-filter: blur(4px);
}
.onb-skip:hover { background: rgba(255,255,255,.2); }

/* الشاشات */
#mdrsk-onb .onb-view { display: none; width: 100%; flex-direction: column; align-items: center; }
#mdrsk-onb .onb-view.active { display: flex !important; animation: onbFade .4s ease; }
@keyframes onbFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* الشعار */
.onb-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.onb-logo img { width: 42px; height: 42px; object-fit: contain; }
.onb-logo b { font-family: 'Cairo', sans-serif; font-weight: 800; font-size: 1.35rem; }

/* الهيرو */
.onb-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  padding: 6px 16px; border-radius: 50px; font-size: .82rem; color: #BFDBFE; margin-bottom: 18px;
}
.onb-h1 {
  font-family: 'Cairo', sans-serif; font-weight: 800;
  font-size: clamp(1.6rem, 5vw, 2.6rem); line-height: 1.35; margin-bottom: 14px; max-width: 660px;
}
.onb-h1 em { font-style: normal; color: #7DB2FF; }
.onb-lead {
  font-size: clamp(.95rem, 2.4vw, 1.1rem); color: rgba(255,255,255,.8);
  max-width: 560px; line-height: 1.9; margin-bottom: 34px;
}

.onb-benefits { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; width: 100%; max-width: 740px; margin-bottom: 36px; }
.onb-benefit {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px; padding: 20px 15px; text-align: center; backdrop-filter: blur(6px);
}
.onb-benefit .ic { font-size: 1.7rem; display: block; margin-bottom: 10px; }
.onb-benefit p { font-size: .86rem; line-height: 1.65; color: rgba(255,255,255,.92); }
.onb-benefit strong { color: #fff; }

#mdrsk-onb .onb-actions { display: flex !important; gap: 14px; flex-wrap: wrap; justify-content: center; width: auto; position: static !important; }
#mdrsk-onb .onb-btn {
  border: none; cursor: pointer; font-family: 'Tajawal', sans-serif; font-weight: 700;
  font-size: 1rem; padding: 14px 34px; border-radius: 50px; transition: all .2s ease;
  position: static !important; float: none !important; margin: 0;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; line-height: 1;
}
.onb-btn-primary { background: #fff !important; color: #1D4ED8 !important; box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.onb-btn-primary:hover { transform: translateY(-2px); }
.onb-btn-ghost { background: transparent !important; color: #fff !important; border: 1.5px solid rgba(255,255,255,.4) !important; }
.onb-btn-ghost:hover { background: rgba(255,255,255,.1) !important; border-color: #fff !important; }

/* اختيار النوع */
.onb-h2 { font-family: 'Cairo', sans-serif; font-weight: 800; font-size: clamp(1.5rem,4.5vw,2.1rem); margin-bottom: 8px; }
.onb-sub { color: rgba(255,255,255,.75); font-size: .95rem; margin-bottom: 34px; }
.onb-types { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; width: 100%; max-width: 760px; }
.onb-type {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px; padding: 30px 18px; cursor: pointer; transition: all .22s ease;
  display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff;
  font-family: 'Tajawal', sans-serif;
}
.onb-type:hover, .onb-type:focus-visible {
  background: #fff; color: #0F172A; transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,.28); outline: none;
}
.onb-type .tic {
  width: 60px; height: 60px; border-radius: 50%;
  background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; transition: all .22s ease;
}
.onb-type:hover .tic, .onb-type:focus-visible .tic { background: #EFF6FF; }
.onb-type .tic svg { width: 28px; height: 28px; stroke: #fff; transition: stroke .22s ease; }
.onb-type:hover .tic svg, .onb-type:focus-visible .tic svg { stroke: #2563EB; }
.onb-type .tt { font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 1.1rem; }
.onb-type .td { font-size: .82rem; color: rgba(255,255,255,.7); line-height: 1.6; }
.onb-type:hover .td, .onb-type:focus-visible .td { color: #475569; }

.onb-back { margin-top: 30px; background: none; border: none; color: rgba(255,255,255,.65); font-size: .88rem; cursor: pointer; text-decoration: underline; font-family: 'Tajawal', sans-serif; }
.onb-back:hover { color: #fff; }

/* ═══════ الجولة التعريفية — كروت شرح مستقلة ═══════ */
.onb-tour-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px; padding: 34px 26px; width: 100%; max-width: 460px;
  margin: 0 auto; text-align: center;
  backdrop-filter: blur(8px); box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.onb-tour-visual {
  width: 96px; height: 96px; margin: 0 auto 20px; border-radius: 24px;
  background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-size: 3rem;
}
.onb-tour-step { font-size: .78rem; color: #93C5FD; font-weight: 700; margin-bottom: 8px; }
.onb-tour-title { font-family: 'Cairo', sans-serif; font-weight: 800; font-size: 1.4rem; margin-bottom: 12px; }
.onb-tour-desc { font-size: .98rem; line-height: 1.9; color: rgba(255,255,255,.85); margin-bottom: 26px; }

.onb-progress { display: flex; gap: 6px; justify-content: center; margin-bottom: 26px; }
.onb-progress span { width: 30px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.2); transition: background .3s ease; }
.onb-progress span.on { background: #fff; }

#mdrsk-onb .onb-tour-nav { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
#mdrsk-onb .onb-tour-nav > div { display: flex !important; gap: 8px; }
#mdrsk-onb .onb-tbtn {
  border: none; cursor: pointer; font-family: 'Tajawal', sans-serif; font-weight: 700;
  font-size: .92rem; padding: 11px 22px; border-radius: 50px; transition: all .2s ease;
  position: static !important; float: none !important; margin: 0;
  display: inline-flex; align-items: center; justify-content: center; white-space: nowrap; line-height: 1;
}
.onb-tbtn-next { background: #fff !important; color: #1D4ED8 !important; }
.onb-tbtn-next:hover { transform: translateY(-1px); }
.onb-tbtn-prev { background: rgba(255,255,255,.1) !important; color: #fff !important; border: 1px solid rgba(255,255,255,.25) !important; }
.onb-tbtn-prev:disabled { opacity: .35; cursor: not-allowed; }
.onb-tour-skip { background: none; border: none; color: rgba(255,255,255,.6); font-size: .82rem; cursor: pointer; text-decoration: underline; font-family: 'Tajawal', sans-serif; }
.onb-tour-skip:hover { color: #fff; }

/* قريبًا — الطلاب */
.onb-illus { width: 210px; height: 150px; margin-bottom: 20px; }
.onb-illus .f1 { animation: onbFloat 3.4s ease-in-out infinite; }
.onb-illus .f2 { animation: onbFloat 4s ease-in-out infinite -1.3s; }
.onb-illus .f3 { animation: onbFloat 3.7s ease-in-out infinite -2.1s; }
@keyframes onbFloat { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-9px);} }

.onb-form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.onb-form input, .onb-form select {
  width: 100%; padding: 13px 16px; border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08);
  color: #fff; font-family: 'Tajawal', sans-serif; font-size: .95rem;
}
.onb-form input::placeholder { color: rgba(255,255,255,.5); }
.onb-form input:focus, .onb-form select:focus { outline: none; border-color: #fff; background: rgba(255,255,255,.14); }
.onb-form select option { color: #0F172A; }
.onb-err { color: #FCA5A5; font-size: .8rem; min-height: 1em; text-align: center; }
.onb-success { background: rgba(34,197,94,.16); border: 1px solid rgba(34,197,94,.4); border-radius: 16px; padding: 24px; max-width: 380px; width: 100%; }
.onb-success .ic { font-size: 2rem; margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) { #mdrsk-onb *{ animation-duration:.001s!important; transition-duration:.001s!important; } }

/* الموبايل */
@media (max-width: 640px) {
  .onb-inner { padding: 46px 16px 30px; }
  .onb-benefits, .onb-types { grid-template-columns: 1fr; }
  .onb-actions { flex-direction: column; width: 100%; max-width: 320px; }
  .onb-btn { width: 100%; }
  .onb-tour-card { padding: 28px 20px; }
  .onb-tour-nav { flex-wrap: wrap; }
}
