/* =========================================================
   Deeni Academy — Premium Islamic Theme
   Fonts: Amiri (Arabic display) · Cairo (AR/EN UI) · Marcellus (EN display)
   Palette: Emerald + Gold on warm cream, with a matching dark mode
   ========================================================= */

:root {
  --primary: #0b3d2e;      /* deep emerald */
  --primary-light: #145c44;
  --accent: #c9a227;       /* gold */
  --accent-light: #e0c15c;
  --bg: #faf7f0;           /* warm cream */
  --bg-alt: #f2ecdd;
  --text: #1e2420;
  --text-muted: #5c6a61;
  --border: #e5ddc8;
  --card-bg: #ffffff;
  --header-bg: #ffffff;
  --footer-bg: #0a2b20;
  --footer-text: #cfe0d5;
  --shadow: 0 10px 30px rgba(11, 61, 46, 0.08);
  --radius: 16px;
  --font-ui: 'Cairo', 'Segoe UI', sans-serif;
  --font-display: 'Marcellus', 'Cairo', serif;
  --font-arabic-display: 'Amiri', 'Cairo', serif;
}

[data-theme="dark"] {
  --primary: #1c7a5e;
  --primary-light: #22946f;
  --accent: #e0c15c;
  --accent-light: #f0d97e;
  --bg: #0d1512;
  --bg-alt: #131f19;
  --text: #eef3ee;
  --text-muted: #9db0a5;
  --border: #223028;
  --card-bg: #16221c;
  --header-bg: #0e1a15;
  --footer-bg: #081310;
  --footer-text: #b8c9bd;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .25s ease, color .25s ease;
}
html[dir="rtl"] body { font-family: 'Cairo', 'Amiri', sans-serif; }
a { text-decoration: none; color: inherit; transition: color .18s ease, opacity .18s ease; }
img { max-width: 100%; display: block; }
ul { list-style: none; margin: 0; padding: 0; }
a, button, .btn, .card, .theme-toggle, .locale-dropdown-group a, .social-icon, .faq-tab, input, select, textarea {
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

h1, h2, h3, .font-display { font-family: var(--font-display); font-weight: 500; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .font-display {
  font-family: var(--font-arabic-display); font-weight: 700;
}
.arabic-accent { font-family: var(--font-arabic-display); direction: rtl; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Islamic education pattern background (book, cap, crescent & star) ---------- */
.pattern-bg {
  position: relative;
}
.pattern-overlay {
  position: absolute; inset: 0; pointer-events: none; opacity: .28; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round' opacity='0.45'%3E%3C!-- open book --%3E%3Cpath d='M20 34 Q34 26 48 34 L48 58 Q34 51 20 58 Z'/%3E%3Cpath d='M48 34 Q62 26 76 34 L76 58 Q62 51 48 58 Z'/%3E%3Cline x1='48' y1='34' x2='48' y2='58'/%3E%3C!-- graduation cap --%3E%3Cpath d='M140 30 L168 42 L140 54 L112 42 Z'/%3E%3Cpath d='M124 47 L124 60 Q140 68 156 60 L156 47'/%3E%3Cline x1='168' y1='42' x2='168' y2='58'/%3E%3Ccircle cx='168' cy='61' r='2.4' fill='%23c9a227' stroke='none'/%3E%3C!-- crescent + star --%3E%3Cpath d='M45 140 A16 16 0 1 0 45 172 A12.5 12.5 0 1 1 45 140 Z'/%3E%3Cpath d='M78 148 l2.6 5.4 5.9.8 -4.3 4.2 1 5.9 -5.2-2.8 -5.2 2.8 1-5.9 -4.3-4.2 5.9-.8 Z'/%3E%3C!-- geometric medallion --%3E%3Cpath d='M165 120 L195 150 L165 180 L135 150 Z'/%3E%3Ccircle cx='165' cy='150' r='11'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 220px 220px;
}
[data-theme="dark"] .pattern-overlay { opacity: .16; }
/* Force the content wrapper above the pattern layer (positioned elements otherwise paint
   above normal-flow siblings regardless of source order, which was pushing the pattern
   on top of cards/text) */
.pattern-bg > .container { position: relative; z-index: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; padding: 12px 26px; border-radius: 999px; font-weight: 700;
  font-size: 14px; cursor: pointer; border: 2px solid transparent; transition: all .2s ease;
  letter-spacing: .2px;
}
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-gold { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #23260f; }
.btn-gold:hover { filter: brightness(1.05); }
.btn-outline { border-color: var(--primary); color: var(--primary); background: transparent; }
[data-theme="dark"] .btn-outline { color: var(--accent-light); border-color: var(--accent-light); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { border-color: #c0392b; color: #c0392b; background: transparent; }
.btn-danger:hover { background: #c0392b; color: #fff; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-sm { padding: 8px 18px; font-size: 13px; }

/* ---------- Header ---------- */
.site-header { background: var(--header-bg); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; gap: 20px; flex-wrap: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 46px; }
.brand-text { font-family: var(--font-display); font-size: 24px; font-weight: 600; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
[data-theme="dark"] .brand-text { color: var(--accent-light); }
.main-nav { display: flex; gap: 28px; }
.main-nav a { font-weight: 600; font-size: 15px; padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--accent); border-color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; flex-shrink: 0; }
.brand { min-width: 0; flex-shrink: 1; }
.desktop-auth-actions { display: flex; align-items: center; gap: 10px; }
.mobile-nav-auth { display: none; }

/* Compact language + currency dropdown (replaces the old always-visible pill switchers) */
.locale-dropdown { position: relative; }
.locale-dropdown-btn {
  display: flex; align-items: center; gap: 5px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--bg); color: var(--text); font-size: 13px; font-weight: 700; padding: 7px 13px; cursor: pointer;
}
.locale-dropdown-btn .caret { font-size: 10px; transition: transform .2s ease; }
.locale-dropdown.open .locale-dropdown-btn .caret { transform: rotate(180deg); }
.locale-dropdown-panel {
  position: absolute; top: calc(100% + 8px); right: 0; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); padding: 10px; min-width: 170px; z-index: 120;
  opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity .15s ease, transform .15s ease;
}
html[dir="rtl"] .locale-dropdown-panel { right: auto; left: 0; }
.locale-dropdown.open .locale-dropdown-panel { opacity: 1; pointer-events: auto; transform: translateY(0); }
.locale-dropdown-group { display: flex; flex-direction: column; padding: 4px 0; }
.locale-dropdown-group + .locale-dropdown-group { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }
.locale-dropdown-label { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); padding: 2px 10px 6px; }
.locale-dropdown-group a { padding: 8px 10px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--text); }
.locale-dropdown-group a:hover { background: var(--bg-alt); }
.locale-dropdown-group a.active { background: var(--primary); color: #fff; }

.theme-toggle {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 999px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text);
}
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; }
.nav-close { display: none; }
.nav-backdrop { display: none; }
.nav-toggle span { width: 24px; height: 2px; background: var(--text); }

/* ---------- Hero ---------- */
.hero { padding: 90px 0; background: var(--bg-alt); position: relative; overflow: hidden; }
.hero-inner { display: flex; align-items: center; gap: 56px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-text { flex: 1 1 440px; }
.hero-text .kicker {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-transform: uppercase;
  letter-spacing: 1.6px; margin: 0 0 14px; font-size: 13px; font-weight: 700;
}
.hero-text .bismillah {
  font-family: var(--font-arabic-display); font-weight: 700; font-size: 26px; color: var(--primary);
  margin: 0 0 16px; direction: rtl; text-align: left; letter-spacing: .5px;
}
[data-theme="dark"] .hero-text .bismillah { color: var(--accent-light); }

.site-breadcrumb { font-size: 13px; margin-bottom: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.site-breadcrumb a { color: var(--text-muted); font-weight: 600; }
.site-breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
[data-theme="dark"] .site-breadcrumb a:hover { color: var(--accent-light); }
.site-breadcrumb .sep { color: var(--text-muted); opacity: .5; }
.site-breadcrumb .current { color: var(--text); font-weight: 700; }
/* The course detail page banner is dark (primary gradient) — keep breadcrumbs legible there */
.course-banner .site-breadcrumb a, .course-banner .site-breadcrumb .sep { color: rgba(255,255,255,0.75); }
.course-banner .site-breadcrumb .current { color: #fff; }
.course-banner .site-breadcrumb a:hover { color: #fff; }
.hero-text h1 { font-size: 48px; margin: 0 0 18px; line-height: 1.2; color: var(--primary); }
[data-theme="dark"] .hero-text h1 { color: var(--accent-light); }
.hero-text p { color: var(--text-muted); margin-bottom: 30px; max-width: 520px; font-size: 16px; }
.hero-text .hero-desc-rich { max-width: 520px; margin-bottom: 30px; font-size: 16px; }
.hero-text .hero-desc-rich p:last-child { margin-bottom: 0; }
.hero-image { flex: 1 1 380px; position: relative; }
.hero-arch {
  border-radius: 50% 50% 8px 8px / 30% 30% 8px 8px;
  overflow: hidden; box-shadow: var(--shadow); border: 6px solid var(--card-bg);
  outline: 2px solid var(--accent); outline-offset: 6px;
}
.hero-arch img { aspect-ratio: 4/5; object-fit: cover; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Hero style: trust_panel (stats card, no photo) ---------- */
.hero-trust-panel {
  flex: 1 1 380px; background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; box-shadow: 0 8px 24px rgba(11,61,46,0.06);
}
.hero-trust-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero-trust-stat { text-align: center; padding: 16px 10px; border-radius: 10px; background: var(--bg-alt); }
.hero-trust-stat .num { font-family: var(--font-display); font-size: 26px; color: var(--accent); }
.hero-trust-stat .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.hero-trust-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-muted); text-align: center; }

/* ---------- Hero style: overlap (2 angled overlapping photos + floating badge) ---------- */
.hero-overlap { flex: 1 1 380px; position: relative; height: 360px; }
.hero-overlap-img {
  position: absolute; border-radius: 16px; overflow: hidden; border: 6px solid var(--card-bg);
  box-shadow: 0 16px 34px rgba(11,61,46,0.16);
}
.hero-overlap-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-overlap-img-1 { top: 6px; left: 20px; width: 62%; height: 82%; transform: rotate(-4deg); z-index: 1; }
.hero-overlap-img-2 { bottom: 0; right: 4px; width: 48%; height: 58%; transform: rotate(5deg); z-index: 2; }
.hero-overlap-badge {
  position: absolute; top: 14px; right: 0; background: var(--primary); color: #fff; border-radius: 12px;
  padding: 12px 18px; box-shadow: 0 10px 22px rgba(0,0,0,0.18); text-align: center; z-index: 3;
}
[data-theme="dark"] .hero-overlap-badge { background: var(--card-bg); border: 1px solid var(--accent-light); }
.hero-overlap-badge .num { font-family: var(--font-display); font-size: 19px; color: var(--accent-light); }
.hero-overlap-badge .label { font-size: 10.5px; opacity: .85; margin-top: 2px; }

/* ---------- Hero style: single_badge (1 photo, two corner stat badges) ---------- */
.hero-single-badge { flex: 1 1 380px; position: relative; }
.hero-single-badge-img { border-radius: 20px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.hero-single-badge-img img { width: 100%; aspect-ratio: 4/3.2; object-fit: cover; display: block; }
.hero-corner-badge {
  position: absolute; width: 84px; height: 84px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; box-shadow: 0 10px 24px rgba(11,61,46,0.16);
}
.hero-corner-badge-top { top: -14px; right: -14px; background: var(--card-bg); border: 1px solid var(--border); }
.hero-corner-badge-top .num { color: var(--accent); }
.hero-corner-badge-top .label { color: var(--text-muted); }
.hero-corner-badge-bottom { bottom: -14px; left: -14px; background: var(--primary); }
.hero-corner-badge-bottom .num { color: var(--accent-light); }
.hero-corner-badge-bottom .label { color: rgba(255,255,255,0.8); }
.hero-corner-badge .num { font-family: var(--font-display); font-size: 16px; }
.hero-corner-badge .label { font-size: 9px; margin-top: 2px; }

/* ---------- Hero style: collage (3 photos, asymmetric grid + floating multi-stat badge) ---------- */
.hero-collage { flex: 1 1 380px; position: relative; padding-bottom: 26px; }
.hero-collage-grid {
  display: grid; grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; gap: 12px; height: 320px;
}
.hero-collage-img { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); }
.hero-collage-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-collage-img-large { grid-row: 1 / 3; }
.hero-collage-badge {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); background: var(--card-bg);
  border: 1px solid var(--border); border-radius: 14px; padding: 14px 22px; box-shadow: 0 12px 28px rgba(11,61,46,0.14);
  display: flex; gap: 24px; white-space: nowrap;
}
.hero-collage-badge-stat { text-align: center; }
.hero-collage-badge-stat .num { font-family: var(--font-display); font-size: 18px; color: var(--accent); }
.hero-collage-badge-stat .label { font-size: 10px; color: var(--text-muted); margin-top: 2px; }

@media (max-width: 700px) {
  .hero-overlap { height: 280px; }
  .hero-corner-badge { width: 68px; height: 68px; }
  .hero-collage-grid { height: 240px; }
  .hero-collage-badge { gap: 14px; padding: 10px 14px; }
  .hero-collage-badge-stat .num { font-size: 15px; }
}

/* ---------- Section shared ---------- */
.section { padding: 90px 0; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 56px; }
.section-head .kicker {
  display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-transform: uppercase;
  letter-spacing: 1.6px; margin: 0 0 10px; font-size: 13px; font-weight: 700;
}
.section-head .kicker::before, .section-head .kicker::after { content: ''; width: 22px; height: 1px; background: var(--accent); }
.section-head h2 { font-size: 34px; margin: 0 0 14px; color: var(--primary); }
[data-theme="dark"] .section-head h2 { color: var(--accent-light); }
.section-head p { color: var(--text-muted); }
.section-alt { background: var(--bg-alt); position: relative; }
.section-white { background: var(--card-bg); position: relative; }

.divider-gold {
  width: 90px; height: 3px; margin: 18px auto; background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.featured-video-wrap {
  max-width: var(--video-max-width, 700px); margin: 0 auto 50px;
  border-radius: var(--video-border-radius, var(--radius)); overflow: hidden;
  box-shadow: var(--shadow); border: 3px solid var(--bg-alt); outline: 1px solid var(--accent);
  aspect-ratio: 16/9; background: #000;
  transition: transform .3s ease, box-shadow .3s ease;
}
.featured-video-wrap.frame-square { border-radius: 4px; outline: none; border-width: 0; box-shadow: none; }
.featured-video-wrap.frame-minimal { border: none; outline: none; box-shadow: none; }
.featured-video-wrap:hover { transform: translateY(-3px); box-shadow: 0 20px 50px rgba(11,61,46,0.22); }
.featured-video-wrap iframe, .featured-video-wrap video {
  width: 100%; height: 100%; border: 0; display: block; object-fit: cover;
  transition: opacity .4s ease;
}

/* ---------- Feature / info cards ---------- */
.grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px; box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); }
.card h4 { margin: 16px 0 10px; font-size: 18px; font-family: var(--font-display); }
.card p { color: var(--text-muted); font-size: 14px; margin: 0; }
.card .icon-circle {
  width: 56px; height: 56px; border-radius: 50%; background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 24px;
  border: 1px solid var(--border);
}
[data-theme="dark"] .card .icon-circle { color: var(--accent-light); }

/* ---------- Teachers (audio) - arch frame ---------- */
.teacher-card { text-align: center; }
.teacher-photo {
  width: 140px; height: 168px; margin: 0 auto 18px; overflow: hidden;
  border-radius: 50% 50% 6px 6px / 34% 34% 6px 6px;
  border: 4px solid var(--bg-alt); outline: 2px solid var(--accent); outline-offset: 4px;
}
.teacher-photo img { width: 100%; height: 100%; object-fit: cover; }
.teacher-card h4 { margin: 0 0 4px; }
.teacher-card .role { color: var(--accent); font-size: 13px; margin-bottom: 16px; font-weight: 700; }
.teacher-audio { width: 100%; height: 38px; border-radius: 999px; }

/* ---------- Testimonials (video) ---------- */
.testimonial-card { text-align: center; }
.testimonial-video-wrap {
  position: relative; border-radius: var(--radius); overflow: hidden; margin-bottom: 18px;
  aspect-ratio: 4/3; background: #000; border: 3px solid var(--bg-alt); outline: 1px solid var(--accent);
}
.testimonial-video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.testimonial-card h4 { margin: 0 0 2px; }
.testimonial-card .role { color: var(--accent); font-size: 13px; font-weight: 700; }

/* ---------- Courses ---------- */
.course-card { display: flex; flex-direction: column; height: 100%; }
.course-card .badge {
  display: inline-block; background: var(--bg-alt); color: var(--primary);
  font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 999px; margin-bottom: 14px; width: fit-content;
  border: 1px solid var(--border);
}
[data-theme="dark"] .course-card .badge { color: var(--accent-light); }
.course-card h4 { margin: 0 0 10px; }
.course-card p { flex: 1; }
.course-card a { margin-top: 18px; font-weight: 700; color: var(--accent); }

/* ---------- Pricing ---------- */
.pricing-card { text-align: center; position: relative; }
.pricing-card.featured { border-color: var(--accent); transform: translateY(-10px); border-width: 2px; }
.pricing-card .price { font-family: var(--font-display); font-size: 40px; font-weight: 600; color: var(--primary); margin: 12px 0; }
[data-theme="dark"] .pricing-card .price { color: var(--accent-light); }
.pricing-card .price span { font-size: 14px; color: var(--text-muted); font-weight: 500; font-family: var(--font-ui); }
.pricing-card ul { margin: 22px 0; text-align: left; }
html[dir="rtl"] .pricing-card ul { text-align: right; }
.pricing-card ul li { padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; position: relative; }
.info-tip {
  display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border-radius: 50%; background: var(--bg-alt); color: var(--primary); font-size: 11px; font-style: normal;
  cursor: help; margin-left: 4px; position: relative; vertical-align: middle;
}
[data-theme="dark"] .info-tip { color: var(--accent-light); }
.info-tip::after {
  content: attr(data-tooltip); position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%);
  background: #1b1f1e; color: #fff; font-size: 12px; font-weight: 500; padding: 8px 12px; border-radius: 8px;
  white-space: normal; width: max-content; max-width: 220px; text-align: center; line-height: 1.4;
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; z-index: 5;
}
.info-tip:hover::after { opacity: 1; }
.pricing-card .ribbon {
  position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #23260f; font-size: 12px;
  font-weight: 800; padding: 5px 16px; border-radius: 999px;
}

/* ---------- Forms ---------- */
.form-card {
  max-width: 540px; margin: 0 auto; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 40px; box-shadow: var(--shadow);
}
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 7px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 12px 15px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: inherit; font-size: 14px;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-group textarea { min-height: 130px; resize: vertical; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.form-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-muted); }
.form-foot a { color: var(--primary); font-weight: 700; }
[data-theme="dark"] .form-foot a { color: var(--accent-light); }

.alert { padding: 13px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 22px; }
.alert-success { background: #e3f6ee; color: #146c43; border: 1px solid #b6e6cf; }
.alert-error { background: #fdeaea; color: #b02a37; border: 1px solid #f5c2c7; }
[data-theme="dark"] .alert-success { background: #10251b; color: #6fd7a8; border-color: #1e4530; }
[data-theme="dark"] .alert-error { background: #2a1416; color: #f19aa2; border-color: #4a1f24; }
.legal-notice { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: 16px; line-height: 1.6; }
.legal-notice a { color: var(--primary); font-weight: 700; text-decoration: underline; }
[data-theme="dark"] .legal-notice a { color: var(--accent-light); }

.gateway-choice { display: flex; flex-direction: column; gap: 10px; }
.gateway-btn {
  padding: 13px 16px; border-radius: 10px; border: 2px solid var(--border); background: var(--bg);
  color: var(--text); font-weight: 700; font-size: 14px; text-align: left; cursor: pointer;
}
html[dir="rtl"] .gateway-btn { text-align: right; }
.gateway-btn.active { border-color: var(--primary); background: var(--bg-alt); color: var(--primary); }
[data-theme="dark"] .gateway-btn.active { color: var(--accent-light); border-color: var(--accent-light); }

/* ---------- Features page zigzag layout ---------- */
.zigzag-row {
  display: flex; align-items: center; gap: 60px; margin-bottom: 80px;
}
.zigzag-row.reverse { flex-direction: row-reverse; }
.zigzag-image, .zigzag-content { flex: 1 1 50%; min-width: 0; }
.zigzag-image img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius);
  box-shadow: var(--shadow); border: 4px solid var(--bg-alt);
}
.zigzag-content h2 { font-size: 28px; color: var(--primary); margin: 0 0 16px; }
[data-theme="dark"] .zigzag-content h2 { color: var(--accent-light); }
.zigzag-highlights-label { color: var(--accent); text-transform: uppercase; font-size: 13px; letter-spacing: .6px; margin: 22px 0 10px; }
.zigzag-highlights { margin: 0; padding: 0; }
.zigzag-highlights li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; font-size: 14.5px; color: var(--text-muted); }
.zigzag-highlights .check { color: var(--primary); font-weight: 800; flex-shrink: 0; margin-top: 1px; }
[data-theme="dark"] .zigzag-highlights .check { color: var(--accent-light); }
.zigzag-highlights strong { color: var(--text); }

@media (max-width: 800px) {
  .zigzag-row, .zigzag-row.reverse { flex-direction: column; gap: 26px; margin-bottom: 50px; }
}

/* ---------- Rendered rich text content (from the admin Quill editor) ---------- */
.rich-content { font-size: 16px; color: var(--text-muted); line-height: 1.8; }
.rich-content h2, .rich-content h3 { color: var(--text); margin: 22px 0 12px; font-family: var(--font-display); }
.rich-content p { margin: 0 0 14px; }
.rich-content ul, .rich-content ol { margin: 0 0 14px; padding-left: 24px; }
html[dir="rtl"] .rich-content ul, html[dir="rtl"] .rich-content ol { padding-left: 0; padding-right: 24px; }
.rich-content li { margin-bottom: 6px; }
.rich-content a { color: var(--primary); font-weight: 600; text-decoration: underline; }
[data-theme="dark"] .rich-content a { color: var(--accent-light); }
.rich-content blockquote {
  border-left: 3px solid var(--accent); margin: 16px 0; padding: 6px 18px; color: var(--text); font-style: italic;
}
html[dir="rtl"] .rich-content blockquote { border-left: none; border-right: 3px solid var(--accent); }
.rich-content strong { color: var(--text); }

.full-width-map { width: 100%; height: 420px; }
.full-width-map iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 700px) { .full-width-map { height: 300px; } }

.info-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 900px) { .info-row-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .info-row-4 { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid var(--border); padding: 18px 0; }
.faq-q { display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 700; }
.faq-a { max-height: 0; overflow: hidden; color: var(--text-muted); transition: max-height .3s ease; font-size: 14px; }
.faq-item.open .faq-a { max-height: 400px; padding-top: 12px; }
.faq-item.open .faq-q .chevron { transform: rotate(180deg); }
.chevron { transition: transform .2s ease; color: var(--accent); }

/* ---------- Stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 22px; text-align: center; }
.stat-box .stat-icon { font-size: 30px; margin-bottom: 8px; }
.stat-box .stat-icon-img { width: 40px; height: 40px; object-fit: contain; margin: 0 auto 8px; }
.stat-box h3 { font-family: var(--font-display); font-size: 36px; color: var(--accent); margin: 0; }
.stat-box p { color: var(--text-muted); margin: 6px 0 0; font-size: 14px; }

.map-texture {
  position: relative; border-radius: var(--radius); padding: 44px 28px;
  background-color: var(--bg-alt);
  background-image: radial-gradient(circle, rgba(11,61,46,0.16) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  border: 1px solid var(--border);
}
[data-theme="dark"] .map-texture { background-image: radial-gradient(circle, rgba(224,193,92,0.14) 1.4px, transparent 1.6px); }
.country-badges { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; position: relative; z-index: 1; }
.country-badge {
  display: flex; align-items: center; gap: 9px; background: var(--card-bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 10px 18px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
  cursor: default; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.country-badge .flag { font-size: 20px; }
.country-badge:hover {
  transform: translateY(-5px) scale(1.06); border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(201,162,39,0.28);
}

/* ---------- Trusted-countries map-pin mode (admin-uploaded map image) ---------- */
.pin-map-wrap { position: relative; max-width: 900px; margin: 0 auto; border-radius: var(--radius); overflow: visible; }
.pin-map-img { width: 100%; display: block; border-radius: var(--radius); }
.pin-map-pin {
  position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column;
  align-items: center; cursor: pointer; z-index: 1;
}
.pin-dot {
  width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 4px rgba(201,162,39,0.25); display: block; transition: transform .2s ease;
  animation: pin-pulse 2.4s ease-in-out infinite;
}
@keyframes pin-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(201,162,39,0.25); }
  50% { box-shadow: 0 0 0 9px rgba(201,162,39,0.12); }
}
.pin-flag { font-size: 22px; margin-top: 2px; transition: transform .2s ease; }
.pin-label {
  opacity: 0; pointer-events: none; position: absolute; bottom: 100%; margin-bottom: 8px;
  background: #1b1f1e; color: #fff; font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 6px;
  white-space: nowrap; transition: opacity .18s ease, transform .18s ease; transform: translateY(4px);
}
.pin-map-pin:hover .pin-dot { transform: scale(1.4); }
.pin-map-pin:hover .pin-flag { transform: scale(1.3); }
.pin-map-pin:hover .pin-label { opacity: 1; transform: translateY(0); }
@media (max-width: 700px) {
  .pin-flag { font-size: 17px; }
  .pin-label { font-size: 10.5px; padding: 4px 8px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding-top: 66px; position: relative; background-size: cover; background-position: center; }
.site-footer.has-bg-image { background-color: var(--footer-bg); }
.footer-scrim { position: absolute; inset: 0; background: var(--footer-bg); opacity: .55; pointer-events: none; }
.site-footer:not(.has-bg-image) .footer-scrim { display: none; }
.footer-pattern-overlay {
  position: absolute; inset: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='84' viewBox='0 0 84 84'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='0.7'%3E%3Cpath d='M42 2 L82 42 L42 82 L2 42 Z'/%3E%3Ccircle cx='42' cy='42' r='18'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}
.footer-grid, .footer-bottom { position: relative; z-index: 1; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 34px; padding-bottom: 44px; }
.footer-logo { height: 42px; margin-bottom: 16px; }
.site-footer h3, .site-footer h4 { color: var(--accent-light); margin: 0 0 18px; font-family: var(--font-display); }
.site-footer p { font-size: 14px; opacity: .88; }
.site-footer ul li { margin-bottom: 11px; font-size: 14px; }
.site-footer ul a:hover { color: var(--accent-light); }
.social-icons { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.social-icon {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 800; font-family: var(--font-ui); border: 2px solid rgba(255,255,255,0.25);
  transition: all .2s ease; box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.social-icon:hover { transform: translateY(-2px); filter: brightness(1.1); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 20px 0; text-align: center; font-size: 13px; opacity: .8; }

/* ---------- FAQ tabs ---------- */
.faq-tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 40px; }
.faq-tab {
  padding: 10px 22px; border-radius: 999px; border: 1px solid var(--border); font-weight: 700; font-size: 14px;
  cursor: pointer; background: var(--card-bg); color: var(--text-muted); transition: all .2s ease;
}
.faq-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
[data-theme="dark"] .faq-tab.active { background: var(--accent); color: #23260f; border-color: var(--accent); }
.faq-panel { display: none; }
.faq-panel.active { display: block; }

/* ---------- Auth pages: light backdrop, centered premium card ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px;
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 15% 15%, rgba(201,162,39,0.14), transparent 45%),
              radial-gradient(circle at 85% 85%, rgba(11,61,46,0.10), transparent 45%),
              var(--bg-alt);
}
.auth-page::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='0.8' opacity='0.5'%3E%3Cpath d='M60 4 L116 60 L60 116 L4 60 Z'/%3E%3Ccircle cx='60' cy='60' r='26'/%3E%3Ccircle cx='60' cy='60' r='40'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
}
.auth-card-premium {
  position: relative; z-index: 1; width: 100%; max-width: 440px; background: var(--card-bg);
  border-radius: 22px; padding: 46px 42px; box-shadow: 0 24px 60px rgba(11,61,46,0.16), 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--border);
}
.auth-crest {
  width: 58px; height: 58px; border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; font-size: 24px;
  box-shadow: 0 8px 20px rgba(11,61,46,0.25);
}
.auth-crest img { width: 34px; height: 34px; object-fit: contain; }
.auth-card-premium .auth-brand { text-align: center; font-family: var(--font-display); font-size: 20px; color: var(--primary); margin-bottom: 4px; }
[data-theme="dark"] .auth-card-premium .auth-brand { color: var(--accent-light); }
.auth-card-premium .auth-quote { text-align: center; font-family: var(--font-arabic-display); font-size: 17px; color: var(--accent); opacity: .85; margin-bottom: 26px; direction: rtl; }
.auth-card-premium .kicker { display: flex; justify-content: center; }
.auth-card-premium h2 { text-align: center; margin: 6px 0 28px; font-size: 25px; }
.auth-card-premium .form-group { margin-bottom: 16px; }
.auth-card-premium .form-group label { font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin-bottom: 5px; }
.auth-card-premium .form-group input, .auth-card-premium .form-group select {
  padding: 11px 14px; font-size: 14px; border-radius: 10px;
}
.auth-card-premium .btn-block { padding: 13px 22px; margin-top: 6px; font-size: 15px; }
.auth-card-premium .form-foot { margin-top: 22px; }
@media (max-width: 480px) {
  .auth-card-premium { padding: 34px 26px; border-radius: 18px; }
}

/* =========================================================
   MOBILE LAYOUT — auto-activates below 900px
   A distinct, app-like mobile experience: fixed-height header,
   slide-in nav drawer with backdrop, touch-tuned spacing/type,
   and tap feedback to replace desktop's hover transitions.
   ========================================================= */
@media (max-width: 900px) {
  /* Header: comfortable fixed height instead of feeling cramped */
  .header-inner { padding: 10px 16px; min-height: 62px; }
  .brand img { height: 34px; }
  .brand-text { font-size: 19px; max-width: 150px; }

  /* Slide-in drawer nav (from the right) with a dimmed backdrop */
  .nav-backdrop {
    display: block;
    position: fixed; inset: 0; background: rgba(10, 20, 15, 0.5); z-index: 98;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .nav-backdrop.open { opacity: 1; pointer-events: auto; }

  .main-nav {
    position: fixed; top: 0; right: 0; bottom: 0; width: 78%; max-width: 320px;
    background: var(--header-bg); flex-direction: column; align-items: flex-start;
    padding: 90px 26px 26px; gap: 4px; z-index: 99;
    transform: translateX(105%); transition: transform .3s ease; box-shadow: -8px 0 30px rgba(0,0,0,0.18);
    overflow-y: auto;
  }
  html[dir="rtl"] .main-nav { right: auto; left: 0; transform: translateX(-105%); }
  .main-nav.open { transform: translateX(0); }
  .main-nav a { width: 100%; padding: 14px 4px; font-size: 17px; border-bottom: 1px solid var(--border); }
  .main-nav a:active { background: var(--bg-alt); }
  .nav-close {
    display: block; position: absolute; top: 20px; right: 20px; background: var(--bg-alt); border: 1px solid var(--border);
    border-radius: 50%; width: 36px; height: 36px; font-size: 16px; cursor: pointer; color: var(--text);
  }
  html[dir="rtl"] .nav-close { right: auto; left: 20px; }

  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col:nth-child(1) { grid-column: 1; grid-row: 1; }
  .footer-col:nth-child(2) { grid-column: 1; grid-row: 2; }
  .footer-col:nth-child(3) { grid-column: 2; grid-row: 2; }
  .footer-col:nth-child(4) { grid-column: 2; grid-row: 1; }
  .hero-text h1 { font-size: 32px; }
  .hero { padding: 48px 0; }
  .section { padding: 48px 0; }

  /* Header row was overcrowded (locale dropdown + theme toggle + Login + Sign Up + burger
     all fighting for space on a ~375px screen, causing button text to wrap and look broken).
     Move Login/Sign Up into the slide-in drawer instead — the header row now only needs to
     fit the locale dropdown, theme toggle, and burger. */
  .desktop-auth-actions { display: none; }
  .mobile-nav-auth {
    display: flex; gap: 10px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border);
    width: 100%;
  }
  .mobile-nav-auth .btn, .mobile-nav-auth form { flex: 1; }
  .mobile-nav-auth .btn {
    width: 100%; text-align: center; white-space: nowrap; box-sizing: border-box;
    padding: 10px 8px !important; font-size: 12.5px !important;
  }
  .mobile-nav-auth form button {
    width: 100%; box-sizing: border-box; padding: 10px 8px !important; font-size: 12.5px !important;
  }

  .locale-dropdown-btn { padding: 7px 10px; font-size: 12px; }
}
@media (max-width: 480px) {
  /* At the narrowest widths, drop the currency code from the button label (still fully
     available inside the dropdown panel) so the pill doesn't get cramped */
  .locale-dropdown-btn .currency-part { display: none; }
}
@media (max-width: 700px) {
  .hero-inner { gap: 24px; }
  .hero-text { text-align: center; }
  .hero-text .kicker, .hero-text .bismillah { justify-content: center; text-align: center; }
  .hero-text p, .hero-text .hero-desc-rich { margin-left: auto; margin-right: auto; }
  .hero-btns { justify-content: center; }
  .hero-image { order: -1; max-width: 280px; margin: 0 auto; }
  .hero-arch img { aspect-ratio: 1/1; }
  .section-head h2 { font-size: 26px; }
  .section-head { margin-bottom: 32px; }
  .grid { gap: 16px; }
  .card { padding: 20px; }
  .container { padding: 0 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-card.featured { transform: none; }
  .form-card { padding: 24px 18px; }
  .info-row-4 { gap: 14px; }

  /* Product-grid style for Courses / Why Choose Us / Teachers / Feedback — two compact
     columns instead of one tall stack, similar to how e-commerce apps show items on mobile. */
  .grid-compact-mobile { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .grid-compact-mobile .card { padding: 12px; border-radius: 12px; }
  .grid-compact-mobile .card h4 { font-size: 13.5px; margin: 8px 0 4px; line-height: 1.3; }
  .grid-compact-mobile .card .badge { font-size: 10px; padding: 3px 8px; margin-bottom: 6px; }
  .grid-compact-mobile .card .role { font-size: 11.5px; }
  .grid-compact-mobile .card p:not(.role) { font-size: 12px; line-height: 1.5; }
  .grid-compact-mobile .card .rich-content {
    font-size: 12px !important; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .grid-compact-mobile .card a { font-size: 12.5px; }
  .grid-compact-mobile .icon-circle { width: 38px; height: 38px; font-size: 17px; margin-bottom: 8px; }
  .grid-compact-mobile .card img { margin-bottom: 8px !important; }
  .grid-compact-mobile .teacher-photo { aspect-ratio: 1/1; }
  .grid-compact-mobile .teacher-audio { width: 100%; height: 32px; }
  .grid-compact-mobile .testimonial-video-wrap { aspect-ratio: 4/3; }
  .grid-compact-mobile .testimonial-video-wrap video,
  .grid-compact-mobile .testimonial-video-wrap img { width: 100%; height: 100%; object-fit: cover; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-col:nth-child(1) { grid-column: 1; grid-row: 1; } /* Brand + logo + social */
  .footer-col:nth-child(2) { grid-column: 1; grid-row: 2; } /* Pages */
  .footer-col:nth-child(3) { grid-column: 2; grid-row: 2; } /* Others */
  .footer-col:nth-child(4) { grid-column: 2; grid-row: 1; } /* Get in Touch */
  .form-row { flex-direction: column; }
  .hero-text h1 { font-size: 26px; }
  .hero-text .bismillah { font-size: 19px; }
  .btn { padding: 12px 20px; font-size: 14px; }
  .btn-sm { padding: 9px 16px; font-size: 13px; }
  .header-actions { gap: 6px; }
  .theme-toggle { width: 38px; height: 38px; }
  .site-header .header-actions .btn { padding: 9px 15px; font-size: 13px; }
  .hero-btns { flex-direction: row; flex-wrap: nowrap; justify-content: center; gap: 10px; }
  .hero-btns .btn { text-align: center; flex: 1; min-width: 0; padding-left: 14px; padding-right: 14px; font-size: 13.5px; white-space: nowrap; }
  .faq-tabs { gap: 8px; }
  .faq-tab { padding: 9px 18px; font-size: 13px; }
  .icon-circle { width: 46px; height: 46px; font-size: 20px; }
  .auth-crest { width: 52px; height: 52px; }
}

/* Touch feedback: since touch devices have no :hover, give tap feedback so mobile
   doesn't feel static compared to desktop's hover transitions */
@media (max-width: 900px) {
  a, button { -webkit-tap-highlight-color: transparent; }
  .btn:active, .card:active, .social-icon:active, .faq-tab:active, .gateway-btn:active {
    transform: scale(0.97); transition: transform .1s ease;
  }
  .card:hover { transform: none; } /* hover lift doesn't apply on touch; avoid stuck-hover state */
}

/* Scroll-reveal: sections/cards fade up into view as the user scrolls (works on all
   screen sizes, but this is what gives mobile browsing the "alive" feel that hover
   transitions give desktop) */
@media (prefers-reduced-motion: no-preference) {
  /* Uses the standalone `translate` property (not `transform`) so this never conflicts
     with hover lifts or the featured-card transform — they animate independently. */
  .reveal-on-scroll {
    opacity: 0; translate: 0 18px;
    transition: opacity .5s ease, translate .5s ease, transform .2s ease, box-shadow .2s ease,
                background-color .2s ease, border-color .2s ease, color .2s ease;
  }
  .reveal-on-scroll.revealed { opacity: 1; translate: 0 0; }
}

/* ---------- Scroll to top button (sitewide, both desktop and mobile) ---------- */
#scrollTopBtn {
  position: fixed; bottom: 26px; right: 26px; z-index: 90;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-size: 18px; font-weight: 700;
  box-shadow: 0 8px 22px rgba(11,61,46,0.28);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease, background .2s ease;
}
#scrollTopBtn.show { opacity: 1; visibility: visible; transform: translateY(0); }
#scrollTopBtn:hover { background: var(--primary-light); }
html[dir="rtl"] #scrollTopBtn { right: auto; left: 26px; }
@media (max-width: 560px) {
  #scrollTopBtn { width: 40px; height: 40px; font-size: 16px; bottom: 18px; right: 18px; }
  html[dir="rtl"] #scrollTopBtn { left: 18px; }
}
