/* ============================================================
   MUSLIM LEGACY SERIES — Global Stylesheet
   Brand Colors from MLS Global Style Canon
   ============================================================ */

:root {
  /* Primary */
  --gold: #C9A84C;
  --navy: #1F3864;
  --teal: #1E6B7E;
  /* Secondary */
  --blue: #2E75B6;
  --olive: #6B7F3B;
  --brown: #8B6F47;
  --beige: #F5EDD6;
  /* Neutrals */
  --white: #FFFFFF;
  --off-white: #FAFAF7;
  --light-gray: #F0F0EC;
  --mid-gray: #999999;
  --dark-gray: #333333;
  /* Tints */
  --gold-light: #F5EDD6;
  --navy-light: #D5E0F0;
  --teal-light: #D8EDED;
  /* Fonts (EB Garamond via Google Fonts, Georgia fallback) */
  --font-body: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-heading: 'EB Garamond', Georgia, serif;
  /* Spacing */
  --section-pad: 80px 0;
  --container-width: 1200px;
  --radius: 8px;
  --shadow: 0 2px 16px rgba(31,56,100,0.08);
  --shadow-hover: 0 6px 24px rgba(31,56,100,0.14);
  --transition: all 0.3s ease;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 18px; }
body {
  font-family: var(--font-body);
  color: var(--dark-gray);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--teal); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold); }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); color: var(--navy); line-height: 1.25; }
h1 { font-size: 2.8rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.15rem; font-weight: 600; }
p { margin-bottom: 1rem; }

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }
.section { padding: var(--section-pad); }
.section-alt { background: var(--off-white); }
.section-navy { background: var(--navy); color: var(--white); }
.section-navy h2, .section-navy h3 { color: var(--gold); }
.section-navy p { color: rgba(255,255,255,0.85); }
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-teal { color: var(--teal); }
.text-navy { color: var(--navy); }

/* ---- BUTTONS ---- */
.btn {
  display: inline-block;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-align: center;
}
.btn-gold {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}
.btn-gold:hover { background: #b8943f; border-color: #b8943f; color: var(--white); }
.btn-navy {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.btn-navy:hover { background: #162b50; color: var(--white); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }
.btn-white {
  background: var(--white);
  color: var(--navy);
  border-color: var(--white);
}
.btn-white:hover { background: var(--gold-light); color: var(--navy); }
.btn-sm { padding: 10px 22px; font-size: 0.9rem; }
.btn-lg { padding: 18px 42px; font-size: 1.1rem; }

/* ---- HEADER / NAV ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--white);
  border-bottom: 2px solid var(--gold-light);
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
}
.nav-logo span { color: var(--gold); }
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-menu > li { position: relative; }
.nav-menu > li > a {
  display: block;
  padding: 8px 16px;
  color: var(--navy);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
}
.nav-menu > li > a:hover, .nav-menu > li > a.active {
  background: var(--gold-light);
  color: var(--gold);
}
/* Dropdown */
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: var(--transition);
  z-index: 100;
  padding: 8px 0;
}
.nav-menu > li:hover > .nav-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-dropdown a {
  display: block;
  padding: 8px 20px;
  color: var(--dark-gray);
  font-size: 0.9rem;
}
.nav-dropdown a:hover { background: var(--gold-light); color: var(--navy); }
/* Mobile toggle */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); margin: 5px 0; transition: var(--transition); }

/* ---- HERO ---- */
.hero {
  padding: 100px 0 80px;
  background: linear-gradient(135deg, var(--navy) 0%, #142a4f 60%, var(--teal) 100%);
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to bottom right, transparent 49.5%, var(--white) 50%);
}
.hero h1 { color: var(--white); font-size: 3.2rem; margin-bottom: 16px; }
.hero .tagline { color: var(--gold); font-size: 1.35rem; font-weight: 500; margin-bottom: 32px; }
.hero p { color: rgba(255,255,255,0.85); font-size: 1.1rem; max-width: 680px; margin: 0 auto 40px; }
.hero-btns { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---- TRUST BAR ---- */
.trust-bar {
  padding: 48px 0;
  background: var(--off-white);
  border-bottom: 1px solid var(--gold-light);
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  text-align: center;
}
.trust-item .trust-number {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}
.trust-item .trust-label {
  font-size: 0.95rem;
  color: var(--navy);
  margin-top: 4px;
}

/* ---- CARD GRID ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
}
.card {
  background: var(--white);
  border: 1px solid var(--gold-light);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.card-img { width: 100%; aspect-ratio: 3/4; object-fit: cover; background: var(--light-gray); }
.card-body { padding: 24px; }
.card-body h3 { margin-bottom: 8px; }
.card-body p { font-size: 0.95rem; color: var(--mid-gray); margin-bottom: 16px; }
.card-meta { font-size: 0.85rem; color: var(--teal); margin-bottom: 12px; }

/* ---- GRADE GRID (K-12 selector) ---- */
.grade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
}
.grade-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  background: var(--white);
  border: 2px solid var(--gold-light);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  color: var(--navy);
  transition: var(--transition);
  cursor: pointer;
  text-align: center;
}
.grade-badge:hover, .grade-badge.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

/* ---- AUDIENCE SPLIT ---- */
.audience-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
.audience-card {
  padding: 48px 40px;
  border-radius: var(--radius);
  text-align: center;
  border: 2px solid var(--gold-light);
  transition: var(--transition);
}
.audience-card:hover { border-color: var(--gold); box-shadow: var(--shadow-hover); }
.audience-card h3 { margin-bottom: 12px; }
.audience-card p { margin-bottom: 24px; color: var(--mid-gray); }
.audience-icon { font-size: 3rem; margin-bottom: 16px; }

/* ---- WHY MLS / DIFFERENTIATORS ---- */
.diff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
}
.diff-item {
  padding: 32px;
  border-radius: var(--radius);
  background: var(--white);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow);
}
.diff-item h4 { margin-bottom: 8px; color: var(--navy); }
.diff-item p { font-size: 0.95rem; color: var(--mid-gray); margin-bottom: 0; }
.diff-stat { font-size: 1.6rem; font-weight: 700; color: var(--gold); margin-bottom: 4px; }

/* ---- AUTHENTICATION STEPS ---- */
.auth-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  counter-reset: step;
}
.auth-step {
  text-align: center;
  padding: 40px 24px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  position: relative;
}
.auth-step::before {
  counter-increment: step;
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  background: var(--gold);
  color: var(--white);
  border-radius: 50%;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 auto 16px;
}
.auth-step h4 { margin-bottom: 8px; }
.auth-step p { font-size: 0.9rem; color: var(--mid-gray); margin-bottom: 0; }

/* ---- LEAD CAPTURE ---- */
.lead-capture {
  max-width: 600px;
  margin: 0 auto;
  padding: 48px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.lead-capture h3 { margin-bottom: 8px; }
.lead-capture p { color: var(--mid-gray); margin-bottom: 24px; }
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,0.15);
}

/* ---- FAQ ---- */
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--gold-light); }
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--navy);
  font-size: 1.05rem;
}
.faq-question::after { content: '+'; font-size: 1.5rem; color: var(--gold); transition: var(--transition); }
.faq-item.open .faq-question::after { content: '\2212'; }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  color: var(--mid-gray);
  font-size: 0.95rem;
  line-height: 1.7;
}
.faq-item.open .faq-answer { max-height: 500px; padding-bottom: 20px; }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: 60px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-brand h3 { color: var(--white); margin-bottom: 8px; }
.footer-brand .footer-tagline { color: var(--gold); font-size: 0.95rem; margin-bottom: 16px; }
.footer-col h4 { color: var(--gold); margin-bottom: 16px; font-size: 1rem; }
.footer-col a { display: block; color: rgba(255,255,255,0.7); padding: 4px 0; font-size: 0.9rem; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}
.footer-bottom a { color: var(--gold); }

/* ---- CHATBOT WIDGET ---- */
.chatbot-toggle {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 60px; height: 60px;
  background: var(--gold);
  border: none;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(201,168,76,0.4);
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1.5rem;
  color: var(--white);
}
.chatbot-toggle:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(201,168,76,0.5); }
.chatbot-window {
  position: fixed;
  bottom: 96px; right: 24px;
  width: 380px;
  max-height: 520px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  z-index: 999;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chatbot-window.open { display: flex; }
.chatbot-header {
  background: var(--navy);
  color: var(--white);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chatbot-header h4 { color: var(--gold); margin: 0; font-size: 1rem; }
.chatbot-close { background: none; border: none; color: var(--white); cursor: pointer; font-size: 1.2rem; }
.chatbot-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  max-height: 360px;
}
.chat-msg {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 85%;
}
.chat-msg.bot { background: var(--gold-light); color: var(--navy); border-bottom-left-radius: 2px; }
.chat-msg.user { background: var(--navy); color: var(--white); margin-left: auto; border-bottom-right-radius: 2px; }
.chatbot-input {
  display: flex;
  border-top: 1px solid #eee;
  padding: 12px;
  gap: 8px;
}
.chatbot-input input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 20px;
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.chatbot-input button {
  background: var(--gold);
  color: var(--white);
  border: none;
  border-radius: 20px;
  padding: 10px 20px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
}

/* ---- PHILOSOPHY GRID (Islamic Studies Page) ---- */
.philosophy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}
.philosophy-card {
  padding: 40px 32px;
  background: var(--white);
  border-radius: var(--radius);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.philosophy-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-4px); }
.philosophy-card h3 { margin-bottom: 8px; font-size: 1.2rem; }
.philosophy-card h4 { color: var(--gold); margin-bottom: 12px; font-size: 1.05rem; }
.philosophy-card p { color: var(--mid-gray); font-size: 0.95rem; margin: 0; }

/* ---- SCOPE & SEQUENCE GRID ---- */
.scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}
.scope-item {
  padding: 28px;
  background: var(--white);
  border-radius: var(--radius);
  border-top: 3px solid var(--gold);
  box-shadow: var(--shadow);
}
.scope-item h4 { margin-bottom: 12px; font-size: 1.1rem; }
.scope-item p { color: var(--mid-gray); font-size: 0.93rem; margin: 0; line-height: 1.6; }

/* ---- GRADE CARDS GRID (13 cards) ---- */
.grade-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.grade-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
  min-height: 200px;
  background: linear-gradient(135deg, var(--white) 0%, var(--off-white) 100%);
  border: 2px solid var(--gold-light);
  border-radius: var(--radius);
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.grade-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-hover);
  transform: translateY(-6px);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--off-white) 100%);
}
.grade-card-number {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 8px;
}
.grade-card-title {
  font-size: 0.95rem;
  color: var(--navy);
  font-weight: 600;
  line-height: 1.4;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .hero h1 { font-size: 2.2rem; }
  .audience-split { grid-template-columns: 1fr; }
  .auth-steps { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .philosophy-grid { grid-template-columns: 1fr; }
  .scope-grid { grid-template-columns: repeat(2, 1fr); }
  .grade-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-menu { display: none; }
  .nav-toggle { display: block; }
  .nav-menu.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 72px; left: 0; right: 0;
    background: var(--white);
    padding: 16px;
    border-bottom: 2px solid var(--gold-light);
    box-shadow: var(--shadow);
  }
  .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding-left: 16px;
  }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 1.8rem; }
  .hero .tagline { font-size: 1.1rem; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .diff-grid { grid-template-columns: 1fr; }
  .philosophy-grid { grid-template-columns: 1fr; }
  .scope-grid { grid-template-columns: 1fr; }
  .grade-cards-grid { grid-template-columns: 1fr; }
  .chatbot-window { width: calc(100vw - 32px); right: 16px; }
}
