/* ============================================================
   BASE.CSS — global design tokens + shared chrome (navbar/footer)
   Loaded once by pages/base.html. Every page inherits this.
   Page-specific rules belong in css/pages/<page>.css or
   enrollment/css/<page>.css — never re-declare tokens there.
   ============================================================ */

:root {
  --navy: #0f172a;
  --navy-mid: #1e293b;
  --navy-light: #334155;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.12);
  --accent-glow: rgba(245, 158, 11, 0.25);
  --success: #10b981;
  --danger: #ef4444;
  --body-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --font-head: "Cairo", sans-serif;
  --font-body: "Cairo", sans-serif;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}

/* ── Sticky footer: footer always sits at the bottom of the
   viewport on short pages, and below content on long ones ── */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--font-body);
  background: var(--body-bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.75;
  overflow-x: hidden;
}
body > footer {
  margin-top: auto;
}

/* ── Navbar ───────────────────────────────────────────────── */
#navbar {
  background: var(--navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 1040;
  transition: box-shadow 0.25s;
}
#navbar.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
/* Let the navbar's row breathe on large screens instead of being capped
   at Bootstrap's stock 1320px container — the nav links + quick-access
   buttons need more horizontal room than a generic container allows. */
#navbar .container {
  max-width: 1520px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}
.navbar-nav .nav-link {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7) !important;
  padding: 6px 10px !important;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.07);
}
.navbar-nav .dropdown-menu {
  background: var(--navy-mid);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  min-width: 220px;
  padding: 6px;
  margin-top: 6px !important;
}
.navbar-nav .dropdown-item {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  transition: all 0.15s;
}
.navbar-nav .dropdown-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.navbar-nav .dropdown-item i {
  font-size: 14px;
  color: var(--accent);
}

.navbar-quicklinks {
  border-inline-start: 1px solid rgba(255, 255, 255, 0.12);
  padding-inline-start: 14px;
}
.btn-app {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
  border: 1.5px solid transparent;
}
.btn-app-amber {
  background: var(--accent);
  color: var(--navy);
}
.btn-app-amber:hover {
  background: var(--accent-dark);
  color: var(--navy);
}
.btn-app-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.85);
}
.btn-app-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 5px 9px;
}
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
@media (max-width: 1399.98px) {
  .navbar-collapse {
    background: var(--navy);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    padding: 12px 16px 16px;
    margin: 0 -12px;
  }
  .navbar-nav .dropdown-menu {
    position: static !important;
    float: none !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 8px !important;
    margin: 4px 0 8px 0 !important;
    padding: 4px !important;
    box-shadow: none !important;
  }
  .navbar-nav .dropdown-item {
    padding: 9px 14px;
    border-radius: 6px;
  }
  .navbar-quicklinks {
    flex-direction: column !important;
    align-items: stretch !important;
    padding-top: 10px;
    padding-inline-start: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-inline-start: 0;
    margin-top: 8px;
    gap: 8px !important;
  }
  .btn-app {
    width: 100%;
    justify-content: center;
  }
  .navbar-nav .nav-link {
    padding: 10px 12px !important;
    border-radius: 8px;
    white-space: normal;
  }
}

.section-label {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}
.section-desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.85;
  max-width: 580px;
}

/* ── Footer ───────────────────────────────────────────────── */
footer {
  background: var(--navy);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 56px 0 32px;
  flex-shrink: 0;
}
.footer-desc {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.9;
  margin-top: 12px;
}
.footer-heading {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}
.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13.5px;
  text-decoration: none;
  padding: 5px 0;
  transition: color 0.15s;
}
.footer-link:hover {
  color: rgba(255, 255, 255, 0.9);
}
.footer-link i {
  font-size: 13px;
}
.footer-app-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s;
  margin-bottom: 8px;
}
.footer-app-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245, 158, 11, 0.05);
}
.footer-app-link i {
  font-size: 16px;
  color: var(--accent);
}
.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 15px;
  transition: all 0.15s;
}
.social-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.social-icon:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(245, 158, 11, 0.08);
}
.footer-bottom {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.25);
}
.visitor-counter {
  display: flex;
  align-items: center;
  gap: 14px;
}
.visitor-counter span {
  display: flex;
  align-items: center;
  gap: 5px;
}
.visitor-counter i {
  font-size: 11px;
  color: var(--accent);
}
.newsletter-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.newsletter-form input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 13px;
}
.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.newsletter-form button {
  background: var(--accent);
  color: var(--navy);
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 13px;
}

/* ── Generic sub-page hero (about/faq/contact/nomenclature) ── */
.page-hero {
  background: var(--navy);
  padding: 72px 0 64px;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, var(--accent-glow), transparent 70%);
  pointer-events: none;
}
.page-hero .section-label {
  color: var(--accent);
}
.page-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 14px;
}
.page-hero p {
  font-size: 15.5px;
  color: rgba(255, 255, 255, 0.65);
  max-width: 620px;
  line-height: 1.9;
}

section.page-section {
  padding: 72px 0;
}
section.page-section.alt {
  background: #ffffff;
}

/* ── Toast stack (flash messages) ────────────────────────── */
#toast-stack {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  width: min(92vw, 420px);
}

/* ── Scroll-reveal utility ────────────────────────────────── */
.reveal {
  opacity: 1;
  transform: none;
  transition:
    opacity 0.55s ease,
    transform 0.55s ease;
}
.reveal.hidden {
  opacity: 0;
  transform: translateY(22px);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ── Back-to-top button ──────────────────────────────────── */
#back-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 42px;
  height: 42px;
  background: var(--accent);
  color: var(--navy);
  border-radius: 10px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  z-index: 999;
}
#back-top.show {
  opacity: 1;
  transform: none;
}
#back-top:hover {
  background: var(--accent-dark);
}

[dir-ltr] {
  direction: ltr;
  unicode-bidi: isolate;
}
