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

:root {
  --primary: #7c6cf2;
  --primary-dark: #151a2e;
  --primary-light: #eeebff;
  --primary-soft: #f6f3ff;
  --background: #f6f7fb;
  --surface: #ffffff;
  --surface-muted: #f0f2f7;
  --text: #171a2b;
  --text-secondary: #697084;
  --text-muted: #a0a6b6;
  --border: #e8eaf1;
  --danger: #db5664;
  --danger-light: #fdecef;
  --success: #1f9d78;
  --shadow: 0 22px 70px rgba(31, 35, 64, 0.10);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Tajawal", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 9% 10%, rgba(124, 108, 242, 0.10), transparent 28%),
    radial-gradient(circle at 92% 35%, rgba(21, 26, 46, 0.05), transparent 26%),
    var(--background);
  direction: rtl;
  text-align: right;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.site-shell { min-height: 100vh; display: flex; flex-direction: column; }
.container { width: min(calc(100% - 32px), var(--container)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(232, 234, 241, 0.85);
  background: rgba(246, 247, 251, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { width: 66px; height: 50px; object-fit: contain; }
.brand-copy { display: grid; gap: 1px; }
.brand-title { font-weight: 900; font-size: 18px; }
.brand-subtitle { color: var(--text-muted); font-size: 11px; font-weight: 700; }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  transition: 180ms ease;
}
.nav a:hover, .nav a.active { color: var(--primary); background: var(--primary-light); }
.nav .danger-link { color: var(--danger); }
.nav .danger-link:hover, .nav .danger-link.active { background: var(--danger-light); color: var(--danger); }

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
}

main { flex: 1; }

.hero { padding: 64px 0 40px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  gap: 28px;
  align-items: stretch;
}

.hero-card {
  position: relative;
  min-height: 410px;
  padding: 54px;
  overflow: hidden;
  border-radius: 40px;
  color: white;
  background: var(--primary-dark);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hero-card::before, .hero-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}
.hero-card::before {
  width: 330px;
  height: 330px;
  inset: -160px auto auto -100px;
  background: rgba(124, 108, 242, 0.30);
}
.hero-card::after {
  width: 190px;
  height: 190px;
  inset: auto -80px -90px auto;
  border: 38px solid rgba(255, 255, 255, 0.05);
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.08);
  font-size: 12px;
  font-weight: 800;
}
.hero h1 {
  position: relative;
  z-index: 1;
  margin: 22px 0 14px;
  max-width: 670px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.13;
  letter-spacing: -1.5px;
}
.hero p {
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0;
  color: rgba(255,255,255,.70);
  font-size: 17px;
  line-height: 1.9;
}
.hero-actions { position: relative; z-index: 1; display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  font-size: 13px;
  transition: transform 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--primary-dark); background: white; box-shadow: 0 10px 35px rgba(0,0,0,.16); }
.button-soft { color: white; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.12); }
.button-purple { color: white; background: var(--primary); }
.button-danger { color: white; background: var(--danger); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }

.hero-side { display: grid; gap: 16px; }
.mini-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 14px 46px rgba(31,35,64,.06);
}
.mini-card.dark { color: white; background: linear-gradient(145deg, #252943, #171a2e); border: 0; }
.mini-number { font-size: 42px; font-weight: 900; line-height: 1; color: var(--primary); }
.mini-card.dark .mini-number { color: white; }
.mini-title { margin-top: 16px; font-size: 18px; font-weight: 900; }
.mini-copy { margin-top: 7px; color: var(--text-secondary); font-size: 13px; line-height: 1.8; }
.mini-card.dark .mini-copy { color: rgba(255,255,255,.65); }

.section { padding: 44px 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.5px; }
.section-heading p { margin: 8px 0 0; color: var(--text-secondary); line-height: 1.8; }
.section-kicker { color: var(--primary); font-weight: 900; font-size: 12px; margin-bottom: 8px; }

.stage-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stage-card {
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  text-align: right;
  transition: 180ms ease;
  position: relative;
  overflow: hidden;
}
.stage-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: 180ms ease;
}
.stage-card:hover, .stage-card.active { transform: translateY(-4px); border-color: rgba(124,108,242,.42); box-shadow: 0 18px 42px rgba(31,35,64,.08); }
.stage-card:hover::after, .stage-card.active::after { opacity: 1; }
.stage-card strong { display: block; font-size: 16px; margin-bottom: 8px; }
.stage-card span { display: block; color: var(--text-secondary); font-size: 12px; line-height: 1.75; }
.stage-card small { display: inline-block; margin-top: 18px; color: var(--primary); font-size: 11px; font-weight: 900; }

.carousel-shell { position: relative; }
.teacher-viewport {
  overflow: hidden;
  border-radius: 32px;
}
.teacher-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 2px 20px;
  direction: rtl;
}
.teacher-track::-webkit-scrollbar { display: none; }
.teacher-card {
  flex: 0 0 min(660px, calc(100vw - 54px));
  min-height: 340px;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: var(--surface);
  overflow: hidden;
  scroll-snap-align: start;
  box-shadow: 0 18px 50px rgba(31,35,64,.07);
  display: grid;
  grid-template-columns: 1.08fr .92fr;
}
.teacher-cover {
  position: relative;
  min-height: 340px;
  background: linear-gradient(145deg, var(--primary-dark), #30345a);
  overflow: hidden;
}
.teacher-cover > img { width: 100%; height: 100%; object-fit: cover; }
.teacher-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(21,26,46,.14), rgba(21,26,46,.55)); }
.teacher-avatar {
  position: absolute;
  z-index: 2;
  right: 28px;
  bottom: 28px;
  width: 86px;
  height: 86px;
  border-radius: 26px;
  border: 4px solid rgba(255,255,255,.90);
  background: white;
  object-fit: cover;
  box-shadow: 0 14px 35px rgba(0,0,0,.22);
}
.teacher-avatar-fallback { display: grid; place-items: center; color: white; background: var(--primary); font-size: 28px; font-weight: 900; }
.teacher-content { padding: 34px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; }
.teacher-badge { color: var(--primary); background: var(--primary-light); border-radius: 999px; padding: 7px 11px; font-size: 10px; font-weight: 900; }
.teacher-name { margin: 18px 0 7px; font-size: 28px; font-weight: 900; }
.teacher-headline { color: var(--text-secondary); font-size: 14px; line-height: 1.85; }
.teacher-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.teacher-tag { padding: 8px 11px; border-radius: 12px; background: var(--surface-muted); color: var(--text-secondary); font-size: 11px; font-weight: 800; }
.teacher-location { margin-top: 20px; color: var(--text-muted); font-size: 12px; }

.carousel-controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.carousel-arrow {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font-size: 19px;
}
.carousel-dots { display: flex; gap: 6px; align-items: center; }
.carousel-dot { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: #d9dbe5; transition: 180ms ease; }
.carousel-dot.active { width: 24px; background: var(--primary); }

.loading-card, .empty-card {
  min-height: 300px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  display: grid;
  place-items: center;
  color: var(--text-secondary);
  text-align: center;
  padding: 30px;
}
.spinner { width: 34px; height: 34px; border: 3px solid var(--primary-light); border-top-color: var(--primary); border-radius: 999px; animation: spin .8s linear infinite; margin-inline: auto; margin-bottom: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.legal-hero { padding: 56px 0 28px; }
.legal-hero-card {
  position: relative;
  overflow: hidden;
  padding: 46px;
  border-radius: 34px;
  color: white;
  background: var(--primary-dark);
}
.legal-hero-card::after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 999px; left: -70px; top: -120px; background: rgba(124,108,242,.28); }
.legal-hero h1 { position: relative; z-index: 1; margin: 0; font-size: clamp(34px, 5vw, 54px); }
.legal-hero p { position: relative; z-index: 1; max-width: 760px; color: rgba(255,255,255,.70); line-height: 1.9; margin: 14px 0 0; }

.legal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 24px; align-items: start; padding: 20px 0 72px; }
.legal-content { display: grid; gap: 14px; }
.legal-section { padding: 28px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); }
.legal-section h2 { margin: 0 0 12px; font-size: 20px; }
.legal-section p, .legal-section li { color: var(--text-secondary); font-size: 14px; line-height: 2; }
.legal-section p { margin: 0 0 10px; }
.legal-section p:last-child { margin-bottom: 0; }
.legal-section ul { margin: 0; padding-right: 22px; }
.legal-aside { position: sticky; top: 102px; padding: 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--border); }
.legal-aside strong { display: block; margin-bottom: 12px; }
.legal-aside a { display: block; padding: 10px 12px; border-radius: 12px; color: var(--text-secondary); font-size: 12px; font-weight: 800; }
.legal-aside a:hover { color: var(--primary); background: var(--primary-light); }

.form-card { padding: 30px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 16px 50px rgba(31,35,64,.06); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 900; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-muted);
  color: var(--text);
  outline: none;
  padding: 14px 15px;
  text-align: right;
  transition: 180ms ease;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--primary); background: white; box-shadow: 0 0 0 4px var(--primary-light); }
.form-note { color: var(--text-muted); font-size: 11px; line-height: 1.8; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.form-status { display: none; padding: 13px 15px; border-radius: 14px; font-size: 12px; font-weight: 800; }
.form-status.show { display: block; }
.form-status.success { color: var(--success); background: #e8f8f2; }
.form-status.error { color: var(--danger); background: var(--danger-light); }
.honeypot { position: absolute !important; left: -9999px !important; opacity: 0 !important; pointer-events: none !important; }

.support-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 36px; border-radius: 30px; border: 1px solid var(--border); background: var(--surface); }
.support-card h2 { margin: 0; font-size: 28px; }
.support-card p { color: var(--text-secondary); line-height: 1.9; }
.support-email { direction: ltr; unicode-bidi: isolate; }

.site-footer { margin-top: 40px; border-top: 1px solid var(--border); background: rgba(255,255,255,.64); }
.footer-inner { min-height: 150px; display: flex; align-items: center; justify-content: space-between; gap: 30px; }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 54px; height: 42px; object-fit: contain; }
.footer-copy { color: var(--text-muted); font-size: 11px; line-height: 1.8; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px; }
.footer-links a { padding: 8px 11px; border-radius: 11px; color: var(--text-secondary); font-size: 11px; font-weight: 800; }
.footer-links a:hover { color: var(--primary); background: var(--primary-light); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; }
  .stage-grid { grid-template-columns: repeat(3, 1fr); }
  .legal-layout { grid-template-columns: 1fr; }
  .legal-aside { position: static; order: -1; display: flex; flex-wrap: wrap; gap: 4px; }
  .legal-aside strong { width: 100%; }
}

@media (max-width: 760px) {
  .header-inner { min-height: 68px; }
  .brand img { width: 58px; height: 44px; }
  .brand-copy { display: none; }
  .menu-button { display: inline-grid; place-items: center; }
  .nav {
    display: none;
    position: absolute;
    top: 68px;
    right: 16px;
    left: 16px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
  }
  .nav.open { display: flex; }
  .nav a { text-align: right; }
  .hero { padding-top: 28px; }
  .hero-card { min-height: 440px; padding: 32px 24px; border-radius: 30px; }
  .hero h1 { font-size: 40px; }
  .hero p { font-size: 14px; }
  .hero-side { grid-template-columns: 1fr; }
  .stage-grid { grid-template-columns: 1fr 1fr; }
  .teacher-card { grid-template-columns: 1fr; min-height: 520px; }
  .teacher-cover { min-height: 250px; }
  .teacher-content { padding: 25px; }
  .teacher-name { font-size: 24px; }
  .legal-hero-card { padding: 32px 24px; border-radius: 28px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .support-card { grid-template-columns: 1fr; }
  .footer-inner { padding: 34px 0; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .container { width: min(calc(100% - 22px), var(--container)); }
  .hero-card { padding: 30px 20px; }
  .hero h1 { font-size: 34px; }
  .section { padding: 34px 0; }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .stage-grid { grid-template-columns: 1fr; }
  .stage-card { min-height: 125px; }
  .teacher-card { flex-basis: calc(100vw - 26px); }
  .teacher-content { align-items: stretch; }
  .legal-section, .form-card { padding: 22px; }
}
