/* ==========================================================================
   EduResource ZA - Seven-Step Onboarding Modal & Personalization Funnel
   Modern SaaS / Neo-Glassmorphic UI Design
   ========================================================================== */

/* Dialog & Backdrop Reset */
dialog.edu-onboarding-modal,
.edu-onboarding-modal {
  border: none;
  outline: none;
  margin: auto;
  padding: 0;
  background: transparent;
  width: 92vw;
  max-width: 580px;
  max-height: 90vh;
  border-radius: 28px;
  box-shadow: 0 35px 90px -10px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.12);
  overflow-y: auto;
  overflow-x: hidden;
  color: #f8fafc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", sans-serif;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.edu-onboarding-modal::backdrop {
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: eduBackdropFade 0.3s ease-out;
}

@keyframes eduBackdropFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes eduModalPop {
  0% {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes eduStepFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Modal Inner Container */
.onboarding-dialog-card,
.onboarding-view-wrapper {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border-radius: 28px;
  padding: 32px 36px 36px 36px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  position: relative;
  animation: eduModalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Header & Progress Indicator */
.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.onboarding-step-indicator {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.step-num {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.step-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.step-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #e11d48, #f43f5e);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.6);
}

.onboarding-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  flex-shrink: 0;
}

.onboarding-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: scale(1.08);
}
.onboarding-close-btn svg{display:block;width:18px;height:18px;flex:none;pointer-events:none}

/* Step Views & Typography */
.onboarding-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  animation: eduStepFade 0.25s ease-out;
}

.onboarding-view .aplus-mascot-wrapper,
.onboarding-view .niko-mascot-wrapper {
  margin: 0 auto 16px auto;
}

.onboarding-title {
  font-size: 23px;
  font-weight: 700;
  color: #ffffff;
  margin: 6px 0 6px 0;
  letter-spacing: -0.025em;
  text-align: center;
  line-height: 1.25;
}

.onboarding-subtitle {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 22px 0;
  text-align: center;
  line-height: 1.45;
}

/* ==========================================================================
   Step 1: Role Selection Cards
   ========================================================================== */
.onboarding-role-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.onboarding-role-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  user-select: none;
}

.onboarding-role-card:hover {
  border-color: rgba(225, 29, 72, 0.45);
  background: rgba(225, 29, 72, 0.06);
  transform: translateY(-2px);
}

.onboarding-role-card.selected {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.14);
  box-shadow: 0 4px 20px rgba(225, 29, 72, 0.18);
}

.role-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f43f5e;
  flex-shrink: 0;
}

.role-info strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 3px;
}

.role-info small {
  display: block;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.4;
}

/* ==========================================================================
   Step 2: Region & Curriculum
   ========================================================================== */
.onboarding-region-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 22px;
}

.region-pill {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.region-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.region-pill.active {
  background: #e11d48;
  border-color: #f43f5e;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(225, 29, 72, 0.45);
  font-weight: 600;
}

.onboarding-field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 10px;
}

.curriculum-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.curriculum-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.curriculum-card:hover {
  border-color: rgba(225, 29, 72, 0.4);
  background: rgba(225, 29, 72, 0.06);
}

.curriculum-card.selected {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.14);
}

.curriculum-name {
  font-size: 14.5px;
  font-weight: 600;
  color: #f8fafc;
}

.curriculum-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: transparent;
  transition: all 0.2s;
}

.curriculum-card.selected .curriculum-check {
  background: #e11d48;
  color: #ffffff;
}

/* ==========================================================================
   Step 3: Grade Selection
   ========================================================================== */
.grade-segmented-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin: 12px 0 24px 0;
}

.grade-segment-btn {
  padding: 18px 12px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.grade-segment-btn:hover {
  border-color: rgba(225, 29, 72, 0.45);
  transform: translateY(-2px);
  color: #ffffff;
}

.grade-segment-btn.active {
  background: rgba(225, 29, 72, 0.15);
  border-color: #e11d48;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(225, 29, 72, 0.25);
}

.grade-segment-btn strong {
  font-size: 15px;
  display: block;
}

/* ==========================================================================
   Step 4: Subject Enrollment Grid
   ========================================================================== */
.subject-category-filter {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}

.subject-cat-btn {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.subject-cat-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.subject-cat-btn.active {
  background: #e11d48;
  border-color: #f43f5e;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(225, 29, 72, 0.4);
}

.subject-enrollment-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
  margin-bottom: 22px;
}

.subject-enroll-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.subject-enroll-card:hover {
  border-color: rgba(225, 29, 72, 0.4);
  background: rgba(225, 29, 72, 0.06);
}

.subject-enroll-card.selected {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.14);
}

.subject-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f43f5e;
  flex-shrink: 0;
}

.subject-enroll-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #f1f5f9;
  flex: 1;
  text-align: left;
  line-height: 1.3;
}

.subject-check-indicator {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.subject-enroll-card.selected .subject-check-indicator {
  background: #e11d48;
  color: #ffffff;
}

/* ==========================================================================
   Step 5: School Search & Attribution
   ========================================================================== */
.school-search-box {
  margin-bottom: 24px;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 18px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  margin: 8px 0 18px 0;
  transition: border-color 0.2s;
}

.search-input-wrap:focus-within {
  border-color: #e11d48;
  box-shadow: 0 0 16px rgba(225, 29, 72, 0.25);
}

.search-icon {
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.search-input-wrap input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 14.5px;
  width: 100%;
}

.search-input-wrap input::placeholder {
  color: #64748b;
}

.popular-schools-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
  margin-bottom: 18px;
  scrollbar-width: thin;
}

.popular-schools-list .section-label {
  width: 100%;
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 6px;
  position: sticky;
  top: 0;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  padding: 4px 0;
  z-index: 2;
}

.school-pill-item {
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.popular-schools-list .school-pill-item{width:100%}
.popular-schools-list .school-pill-item small{display:block;margin-top:3px;color:#94a3b8;font-size:11px;font-weight:500}
.school-pill-item.active small{color:#ffe4e8}
.school-source-note{color:#94a3b8;font-size:11px;line-height:1.45;margin:-8px 0 15px}
.school-source-note a{color:#7dd3fc;text-decoration:underline}

.school-pill-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.school-pill-item.active {
  background: #e11d48;
  border-color: #f43f5e;
  color: #ffffff;
  box-shadow: 0 0 14px rgba(225, 29, 72, 0.35);
  font-weight: 600;
}

.school-pill-item.custom-match {
  background: rgba(14, 165, 233, 0.18);
  border-color: #0ea5e9;
  color: #38bdf8;
  font-weight: 600;
  width: 100%;
  text-align: center;
  padding: 10px 14px;
  margin-bottom: 4px;
}

.school-pill-item.custom-match:hover {
  background: rgba(14, 165, 233, 0.32);
  color: #ffffff;
}

.custom-school-fallback {
  text-align: center;
  margin-top: 14px;
  font-size: 13px;
  color: #94a3b8;
}

.btn-text-link {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  margin-left: 6px;
  transition: color 0.2s;
}

.btn-text-link:hover {
  color: #7dd3fc;
}

/* ==========================================================================
   Step 6: Diagnostic Goal Setting
   ========================================================================== */
.goals-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.goal-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  user-select: none;
}

.goal-card:hover {
  border-color: rgba(225, 29, 72, 0.45);
  background: rgba(225, 29, 72, 0.06);
  transform: translateY(-2px);
}

.goal-card.selected {
  border-color: #e11d48;
  background: rgba(225, 29, 72, 0.14);
  box-shadow: 0 4px 20px rgba(225, 29, 72, 0.18);
}

.goal-icon-box {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  flex-shrink: 0;
}

.goal-info strong {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: #f8fafc;
  margin-bottom: 3px;
}

.goal-info small {
  display: block;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.4;
}

/* ==========================================================================
   Step 7: Frictionless Auth (+50 XP Reward)
   ========================================================================== */
.xp-welcome-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(225, 29, 72, 0.12) 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.38);
  margin: 6px 0 20px 0;
  text-align: left;
}

.badge-gem {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
  flex-shrink: 0;
}

.xp-welcome-badge strong {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
  color: #fef08a;
  letter-spacing: -0.01em;
}

.xp-welcome-badge small {
  display: block;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.35;
}

/* Clean, Stacked Full-Width Auth Action Buttons */
.auth-buttons-group {
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 18px;
  width: 100%;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
  text-decoration: none;
}

.auth-btn.google-auth {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.auth-btn.google-auth:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.auth-btn.apple-auth {
  background: #000000;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.auth-btn.apple-auth:hover {
  background: #111827;
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.35);
}

.auth-btn.magic-auth {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border: 1.5px solid rgba(255, 255, 255, 0.14);
}

.auth-btn.magic-auth:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.28);
}

.anonymous-continue {
  text-align: center;
  margin: 6px 0 14px 0;
}

#skip-auth-guest {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

#skip-auth-guest:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ==========================================================================
   Navigation Controls (Bottom Bar)
   ========================================================================== */
.onboarding-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.onboarding-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-back:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.onboarding-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  border: none;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 18px rgba(225, 29, 72, 0.4);
  margin-left: auto;
}

.onboarding-next:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(225, 29, 72, 0.55);
  filter: brightness(1.08);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  dialog.edu-onboarding-modal,
  .edu-onboarding-modal {
    width: 96vw;
    border-radius: 22px;
  }

  .onboarding-dialog-card {
    padding: 24px 20px 24px 20px;
    border-radius: 22px;
  }

  .onboarding-title {
    font-size: 20px;
  }

  .subject-enrollment-grid {
    grid-template-columns: 1fr;
    max-height: 260px;
  }

  .grade-segmented-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
