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

:root {
  --navy: #052457;
  --navy-deep: #03152f;
  --navy-card: #08285c;
  --blue: #1677ff;
  --blue-dark: #0b56ad;
  --blue-light: #e6f4ff;
  --gold: #f5a623;
  --gold-dark: #d97706;
  --white: #ffffff;
  --surface: #f8fafc;
  --surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --success: #10b981;
  --danger: #ef4444;
  --purple: #7c3aed;
  --teal: #0d9488;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 8px rgba(5, 36, 87, 0.04);
  --shadow-md: 0 4px 20px rgba(5, 36, 87, 0.08);
  --shadow-lg: 0 12px 36px rgba(5, 36, 87, 0.16);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background-color: var(--surface);
  color: var(--text-main);
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  transition: all 0.2s ease;
}

input, select, textarea {
  font-family: inherit;
  outline: none;
}

/* ==========================================================================
   GLOBAL UTILITIES & BUTTONS
   ========================================================================== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.btn-gold {
  background: var(--gold);
  color: #03152f;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.35);
}
.btn-gold:hover {
  background: #ffb738;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.5);
}

.btn-blue {
  background: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 14px rgba(22, 119, 255, 0.3);
}
.btn-blue:hover {
  background: var(--blue-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(22, 119, 255, 0.45);
}

.btn-outline-navy {
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
}
.btn-outline-navy:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: #ffffff;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}
.badge-gold { background: #fef3c7; color: #b45309; }
.badge-blue { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: #ecfdf5; color: #047857; }

/* ==========================================================================
   MAIN PUBLIC NAVBAR (MATCHING APPROVED REFERENCE)
   ========================================================================== */
.main-header {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(3, 21, 47, 0.4);
}

.navbar {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  width: 100%;
}

.brand-logo {
  display: flex;
  direction: ltr;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
}

.brand-sigma {
  width: 32px;
  height: 32px;
  display: inline-block;
  vertical-align: middle;
}

.nav-links {
  display: flex;
  direction: rtl;
  align-items: center;
  gap: 22px;
  list-style: none;
}

.nav-links li a {
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  padding: 6px 4px;
  position: relative;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--gold);
}

.nav-links li a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 100%;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  direction: rtl;
  align-items: center;
  gap: 10px;
}

.search-trigger-btn {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
}
.search-trigger-btn:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  padding: 6px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   HERO SECTION (EXACT REFERENCE: TEXT ON LEFT, PORTRAIT ON RIGHT)
   ========================================================================== */
.hero-section {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 60%, #062b66 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
  padding: 40px 0 30px;
}

.hero-pattern-overlay {
  position: absolute;
  inset: 0;
  background-image: url('../img/math-pattern.svg');
  background-repeat: repeat;
  background-size: 480px;
  opacity: 0.14;
  pointer-events: none;
}

.hero-grid {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  position: relative;
  z-index: 2;
  margin-bottom: 25px;
}

.hero-text-col {
  flex: 1;
  max-width: 580px;
  direction: rtl;
  text-align: right;
}

.hero-title {
  font-size: 44px;
  font-weight: 900;
  line-height: 1.28;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
}

.hero-title .highlight-gold {
  color: var(--gold);
  text-shadow: 0 0 25px rgba(245, 166, 35, 0.45);
}

.hero-subtitle {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.8;
  margin-bottom: 30px;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-buttons .btn {
  padding: 12px 28px;
  font-size: 15px;
  border-radius: var(--radius-sm);
}

/* HERO PORTRAIT & GOLDEN HALO (EXACT VISUAL COMPOSITION) */
.hero-portrait-col {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  max-width: 480px;
}

.hero-halo-disc {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, #f5a623 0%, #d97706 72%, rgba(217, 119, 6, 0.1) 100%);
  box-shadow: 0 0 70px rgba(245, 166, 35, 0.55);
  z-index: 1;
}

.hero-halo-rings {
  position: absolute;
  width: 430px;
  height: 430px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.25);
  z-index: 1;
  animation: rotateSlow 40s linear infinite;
}

@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hero-person-img {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 380px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.45));
  -webkit-mask-image: linear-gradient(to bottom, #000 80%, rgba(0, 0, 0, 0.8) 88%, rgba(0, 0, 0, 0.25) 95%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 80%, rgba(0, 0, 0, 0.8) 88%, rgba(0, 0, 0, 0.25) 95%, transparent 100%);
}

/* ==========================================================================
   HERO BOTTOM RIBBON (EXACT 5 PILLS ON DARK NAVY BAR)
   ========================================================================== */
.hero-ribbon-bar {
  position: relative;
  z-index: 3;
  background: rgba(3, 21, 47, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: space-around;
  gap: 12px;
}

.ribbon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: all 0.25s ease;
  flex: 1;
}

.ribbon-item:hover {
  transform: translateY(-3px);
}

.ribbon-icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(22, 119, 255, 0.16);
  border: 1px solid rgba(80, 160, 255, 0.35);
  color: #60a5fa;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ribbon-item:hover .ribbon-icon-circle {
  background: rgba(22, 119, 255, 0.28);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  transform: translateY(-2px);
}

.ribbon-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.ribbon-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
}

.br-mobile {
  display: none;
}

/* ==========================================================================
   COURSES CATALOG (EXACT MATCH TO REFERENCE: 8 DISTINCT CARDS)
   ========================================================================== */
.courses-catalog-section {
  padding: 40px 0 60px;
}

.section-title-center {
  text-align: center;
  font-size: 30px;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 8px;
}

.breadcrumbs-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.search-pills-container {
  max-width: 820px;
  margin: 0 auto 35px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.search-input-pill {
  position: relative;
  width: 100%;
}

.search-input-pill input {
  width: 100%;
  padding: 13px 44px 13px 18px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.search-input-pill input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(22, 119, 255, 0.12);
}

.search-input-pill .search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

.filter-pills-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: var(--white);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.filter-pill:hover {
  background: var(--surface-alt);
  color: var(--navy);
}

.filter-pill.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.25);
}

/* 4-COLUMN CARDS GRID (EXACT REFERENCE LAYOUT) */
.courses-grid-8 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 45px;
}

.course-card-ref {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.course-card-ref:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(22, 119, 255, 0.3);
}

/* Distinct colored banners matching reference */
.card-banner {
  padding: 22px 16px;
  color: var(--white);
  position: relative;
  text-align: right;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.banner-stats { background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%); }
.banner-geom-3 { background: linear-gradient(135deg, #d97706 0%, #b45309 100%); }
.banner-calc { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.banner-alg { background: linear-gradient(135deg, #052457 0%, #03152f 100%); }
.banner-logic { background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%); }
.banner-prob { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.banner-geom-2 { background: linear-gradient(135deg, #047857 0%, #065f46 100%); }
.banner-seq { background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%); }

.card-banner .course-title-main {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.card-banner .course-grade-sub {
  font-size: 12px;
  opacity: 0.92;
  font-weight: 600;
  margin-top: 4px;
}

.card-banner .play-circle-badge {
  position: absolute;
  left: 14px;
  bottom: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--white);
}

.card-banner .teacher-avatar-corner {
  position: absolute;
  right: 14px;
  bottom: -18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--white);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 2;
  background: #ffffff;
}

.card-body-ref {
  padding: 24px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.card-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 12px;
}

.card-lessons-num {
  color: var(--blue);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-rating-star {
  color: #d97706;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 3px;
}

.card-price-centered {
  text-align: center;
  font-size: 19px;
  font-weight: 900;
  color: var(--navy);
  margin-bottom: 14px;
}

/* ==========================================================================
   LESSON WATCH VIEW (EXACT MATCH TO REFERENCE)
   ========================================================================== */
.lesson-page-grid {
  display: flex;
  direction: ltr;
  gap: 24px;
  margin-bottom: 45px;
}
.lesson-page-grid > div:first-child,
.lesson-main-col {
  flex: 1;
  min-width: 0;
  direction: rtl;
}
.lesson-page-grid > div:last-child,
.lesson-page-grid > aside,
.playlist-sidebar-col {
  width: 340px;
  flex-shrink: 0;
  direction: rtl;
}

.video-screen-16-9,
.video-container-ref {
  width: 100% !important;
  max-width: 100% !important;
  aspect-ratio: 16 / 9 !important;
  background: #000000;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chalkboard-visual {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay-circle {
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  box-shadow: 0 0 25px rgba(22, 119, 255, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}
.play-overlay-circle:hover {
  transform: scale(1.08);
}

.video-bottom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--white);
  font-size: 12px;
}

.video-red-track {
  position: absolute;
  bottom: 38px;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
}

.video-red-fill {
  height: 100%;
  width: 44%;
  background: #ef4444;
}

.lesson-details-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border);
  margin-top: 18px;
  box-shadow: var(--shadow-sm);
}

.reactions-pill-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.reaction-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: #eff6ff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #dbeafe;
  transition: all 0.2s ease;
}
.reaction-pill-btn:hover {
  background: #dbeafe;
}

/* SIDEBAR ACCORDION PLAYLIST */
.playlist-card-container {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.playlist-tabs-header {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.playlist-tab {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}

.playlist-tab.active {
  background: var(--blue);
  color: var(--white);
  font-weight: 800;
}

.unit-accordion-item {
  border-bottom: 1px solid var(--border);
}

.unit-accordion-header {
  padding: 12px 16px;
  background: var(--surface-alt);
  font-size: 13px;
  font-weight: 800;
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

.unit-lessons-list {
  list-style: none;
}

.lesson-sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.lesson-sub-row:hover {
  background: #f8fafc;
  color: var(--blue);
}
.lesson-sub-row.active {
  background: #eff6ff;
  color: var(--blue);
  font-weight: 800;
}

/* ==========================================================================
   CLEAN & ELEGANT STUDENT / TEACHER LOGIN
   ========================================================================== */
.login-page-wrapper {
  min-height: calc(100vh - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px 85px;
  background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
  box-sizing: border-box;
}

.login-card-clean {
  width: 100%;
  max-width: 440px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(226, 232, 240, 0.85);
  padding: 36px 32px;
  box-sizing: border-box;
  animation: fadeIn 0.3s ease;
}

.login-card-header {
  text-align: center;
  margin-bottom: 22px;
}

.login-brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
}

.login-brand-icon {
  width: 20px;
  height: 20px;
}

.login-brand-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.3px;
}

.login-main-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--navy);
  margin: 0 0 6px 0;
  letter-spacing: -0.5px;
}

.login-sub-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Role Segmented Switcher */
.login-role-segmented {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
  gap: 4px;
}

.login-role-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 9px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.login-role-tab:hover {
  color: var(--navy);
}

.login-role-tab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  font-weight: 800;
}

.login-alert-banner {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-alert-banner.login-alert-error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* Clean Form */
.login-form-clean .form-field-group {
  margin-bottom: 18px;
}

.login-form-clean .field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 7px;
}

.login-form-clean .field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.login-form-clean .field-label-row .field-label {
  margin-bottom: 0;
}

.login-form-clean .forgot-link {
  font-size: 12px;
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.15s ease;
}

.login-form-clean .forgot-link:hover {
  text-decoration: underline;
  color: #1d4ed8;
}

.login-form-clean .field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-form-clean .field-input {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px 12px 42px;
  font-size: 13.5px;
  color: var(--navy);
  transition: all 0.2s ease;
  box-sizing: border-box;
  font-family: inherit;
}

.login-form-clean .field-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--blue);
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.12);
}

.login-form-clean .field-prefix-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  pointer-events: none;
}

.login-form-clean .toggle-password-btn {
  position: absolute;
  left: 10px;
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s ease;
}

.login-form-clean .toggle-password-btn:hover {
  color: var(--navy);
}

.login-form-clean .form-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 12.5px;
}

.login-form-clean .remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.login-form-clean .remember-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  border-radius: 4px;
  cursor: pointer;
}

.login-submit-btn {
  width: 100%;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 13px 18px;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.login-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.38);
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
}

.login-submit-btn:active {
  transform: translateY(0);
}

.login-card-footer {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}

.login-card-footer .signup-prompt {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 14px 0;
}

.login-card-footer .signup-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
  margin-right: 4px;
}

.login-card-footer .signup-link:hover {
  text-decoration: underline;
}

.preview-direct-links {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.preview-direct-links a {
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.preview-direct-links a:hover {
  color: var(--blue);
}

.preview-direct-links .preview-tag {
  color: #94a3b8;
}

.preview-direct-links .dot-sep {
  color: #cbd5e1;
}

@media (max-width: 480px) {
  .login-card-clean {
    padding: 26px 20px;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  }
  .login-main-title {
    font-size: 21px;
  }
}

/* Fallback split container support */
.login-box-split {
  max-width: 860px;
  margin: 40px auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: flex;
  direction: ltr;
}

.login-left-navy {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: var(--white);
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  flex: 1;
  direction: rtl;
}

.login-left-navy .math-overlay {
  position: absolute;
  inset: 0;
  background-image: url('../img/math-pattern.svg');
  opacity: 0.14;
}

.login-right-form {
  padding: 45px 35px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  direction: rtl;
}

/* ==========================================================================
   DASHBOARDS SHARED (LEFT-ALIGNED NAVY SIDEBAR AS IN REFERENCE)
   ========================================================================== */
.dash-shell {
  display: flex;
  direction: ltr;
  min-height: 100vh;
  background: #f1f5f9;
}

.dash-sidebar-left {
  width: 250px;
  background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: var(--white);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  direction: rtl;
}

.dash-content-area {
  flex: 1;
  padding: 25px 30px;
  overflow-y: auto;
  direction: rtl;
}

.dash-sidebar-left {
  width: 250px;
  background: linear-gradient(180deg, var(--navy-deep) 0%, var(--navy) 100%);
  color: var(--white);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.dash-content-area {
  flex: 1;
  padding: 25px 30px;
  overflow-y: auto;
}

/* ==========================================================================
   PREVIEW SWITCHER TOOLBAR PILL
   ========================================================================== */
.preview-switcher-pill {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 10000;
  background: rgba(3, 21, 47, 0.94);
  backdrop-filter: blur(10px);
  color: var(--white);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(245, 166, 35, 0.4);
  font-size: 12px;
  font-weight: 700;
}

.preview-switcher-pill select {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  cursor: pointer;
}

.preview-switcher-pill select option {
  background: var(--navy);
  color: var(--white);
}

/* ==========================================================================
   MOBILE BOTTOM NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}

.mobile-nav-item.active {
  color: var(--blue);
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   RESPONSIVE QUERIES (DESKTOP, TABLET, MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
  .courses-grid-8 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .lesson-page-grid {
    flex-direction: column !important;
    gap: 20px !important;
  }
  .lesson-page-grid > div:first-child,
  .lesson-page-grid > div:last-child,
  .lesson-page-grid > aside,
  .lesson-main-col,
  .playlist-sidebar-col {
    width: 100% !important;
    max-width: 100% !important;
    flex: none !important;
  }
}

@media (max-width: 768px) {
  .preview-switcher-pill {
    display: none !important;
  }
  .nav-links {
    display: none;
  }
  .nav-actions .btn,
  .search-trigger-btn {
    display: none;
  }
  .mobile-menu-btn {
    display: flex;
    color: var(--white);
    padding: 6px;
  }
  .hero-section {
    padding: 24px 0 20px;
  }
  .hero-grid {
    flex-direction: column-reverse;
    text-align: center;
    gap: 16px;
  }
  .hero-portrait-col {
    max-width: 220px;
    margin: 0 auto;
  }
  .hero-halo-disc {
    width: 210px;
    height: 210px;
  }
  .hero-halo-rings {
    width: 240px;
    height: 240px;
  }
  .hero-person-img {
    max-width: 210px;
  }
  .hero-text-col {
    text-align: center;
  }
  .hero-title {
    font-size: 24px;
    line-height: 1.3;
    margin-bottom: 10px;
  }
  .hero-subtitle {
    margin: 0 auto 16px;
    font-size: 13px;
    max-width: 320px;
  }
  .hero-buttons {
    justify-content: center;
    gap: 10px;
  }
  .hero-buttons .btn {
    padding: 9px 18px;
    font-size: 13.5px;
  }
  .br-mobile {
    display: block !important;
  }
  .hero-ribbon-bar {
    display: flex;
    direction: ltr;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2px !important;
    padding: 10px 4px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 20px;
    overflow: hidden;
  }
  .ribbon-item {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 0 1px;
    text-align: center;
  }
  .ribbon-icon-circle {
    width: 30px;
    height: 30px;
    margin: 0 auto;
    flex-shrink: 0;
  }
  .ribbon-svg {
    width: 14px;
    height: 14px;
  }
  .ribbon-label {
    font-size: 8px;
    line-height: 1.2;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    width: 100%;
    word-break: normal;
  }
  body {
    padding-bottom: 74px !important;
  }
  .courses-catalog-section {
    padding: 24px 0 40px;
  }
  .courses-grid-8 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 25px;
  }
  .course-card-ref {
    border-radius: var(--radius-sm);
  }
  .card-banner {
    padding: 14px 10px;
    min-height: 95px;
  }
  .card-banner .course-title-main {
    font-size: 16px;
    line-height: 1.2;
  }
  .card-banner .course-grade-sub {
    font-size: 10px;
    margin-top: 2px;
  }
  .card-banner .play-circle-badge {
    width: 22px;
    height: 22px;
    font-size: 9px;
    left: 8px;
    bottom: 8px;
  }
  .card-banner .teacher-avatar-corner {
    width: 34px;
    height: 34px;
    right: 10px;
    bottom: -14px;
    border-width: 2px;
  }
  .card-body-ref {
    padding: 18px 8px 12px;
  }
  .card-meta-line {
    font-size: 10px;
    margin-bottom: 8px;
    gap: 2px;
  }
  .card-lessons-num,
  .card-rating-star {
    font-size: 10px;
  }
  .card-price-centered {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 8px;
  }
  .card-body-ref .btn {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: var(--radius-sm);
  }
  footer {
    padding: 25px 0 85px !important;
  }
  .login-box-split {
    grid-template-columns: 1fr;
  }
  .login-left-navy {
    display: none;
  }
  .dash-shell {
    flex-direction: column;
  }
  .dash-sidebar-left {
    display: none;
  }
  .dash-content-area {
    padding: 16px 14px 80px;
  }
  .mobile-bottom-nav {
    display: flex;
  }

  /* Mobile Lesson Improvements */
  .lesson-main-wrapper {
    padding: 16px 0 95px !important;
  }
  .lesson-header-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
  }
  .lesson-course-title {
    font-size: 16px !important;
    line-height: 1.35 !important;
    word-break: break-word !important;
  }
  .breadcrumbs-bar {
    font-size: 11px !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
  }
  .video-screen-16-9,
  .video-container-ref {
    width: 100% !important;
    max-width: 100% !important;
    aspect-ratio: 16 / 9 !important;
    border-radius: var(--radius-sm) !important;
  }
  .play-overlay-circle,
  .big-play-btn {
    width: 48px !important;
    height: 48px !important;
    font-size: 18px !important;
    margin-bottom: 6px !important;
  }
  .video-bottom-controls {
    padding: 6px 10px !important;
    font-size: 11px !important;
  }
  .video-red-track {
    bottom: 30px !important;
    left: 8px !important;
    right: 8px !important;
  }
  .lesson-details-card {
    padding: 16px 14px !important;
    margin-top: 14px !important;
  }
  .lesson-details-card h1 {
    font-size: 16.5px !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
  }
  .reactions-pill-bar {
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .reaction-pill-btn {
    padding: 6px 10px !important;
    font-size: 11.5px !important;
    flex: 1 1 auto !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .instructor-box {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px !important;
  }
  .instructor-box .btn {
    width: 100% !important;
    text-align: center !important;
  }
  .lesson-tabs-header {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    gap: 4px !important;
    padding-bottom: 4px !important;
    scrollbar-width: none !important;
  }
  .lesson-tabs-header::-webkit-scrollbar {
    display: none !important;
  }
  .lesson-tab-btn {
    padding: 7px 12px !important;
    font-size: 12px !important;
    flex-shrink: 0 !important;
  }
  .playlist-card-container {
    width: 100% !important;
  }
  .playlist-item {
    padding: 10px 12px !important;
    gap: 10px !important;
  }
  .lesson-sub-row {
    padding: 10px 12px !important;
  }
  .lesson-sub-row > div:first-child {
    min-width: 0 !important;
  }
}

@media (max-width: 380px) {
  .container {
    padding: 0 10px;
  }
  .courses-grid-8 {
    gap: 8px;
  }
  .card-banner {
    padding: 10px 8px;
    min-height: 85px;
  }
  .card-banner .course-title-main {
    font-size: 14.5px;
  }
  .card-banner .course-grade-sub {
    font-size: 9px;
  }
  .card-banner .teacher-avatar-corner {
    width: 30px;
    height: 30px;
    bottom: -12px;
  }
  .card-body-ref {
    padding: 15px 6px 10px;
  }
  .card-price-centered {
    font-size: 14px;
  }
  .card-body-ref .btn {
    padding: 6px 6px;
    font-size: 11px;
  }
  .ribbon-icon-circle {
    width: 30px;
    height: 30px;
  }
  .ribbon-svg {
    width: 13px;
    height: 13px;
  }
  .ribbon-label {
    font-size: 8.5px;
  }
}
