:root {
  /* Colours taken from the UFQ logo */
  --blue: #143562;
  --blue-dark: #0b2245;
  --accent: #2a62ad;
  --accent-light: #e9f0fa;
  --gold: #d4a63a;
  --text: #1d2733;
  --muted: #5b6876;
  --bg: #ffffff;
  --bg-alt: #f4f7fa;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(20, 53, 98, 0.08);
  --header-h: 72px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  font-family: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.35; margin: 0 0 0.5em; }

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

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e6ebf0;
}
.header-inner { display: flex; align-items: center; gap: 24px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 44px; height: 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-size: 1.35rem; color: var(--blue); letter-spacing: 1px; }
.brand-text small { font-size: 0.75rem; color: var(--accent); font-weight: 600; }

.main-nav { display: flex; gap: 6px; margin-inline-start: auto; }
.main-nav a {
  padding: 8px 14px; border-radius: 999px; font-weight: 600; color: var(--muted);
  transition: background 0.2s, color 0.2s;
}
.main-nav a:hover, .main-nav a.active { color: var(--blue); background: var(--bg-alt); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-toggle {
  font: inherit; font-weight: 700; cursor: pointer;
  border: 2px solid var(--blue); color: var(--blue); background: transparent;
  border-radius: 999px; padding: 4px 16px; min-width: 64px;
  transition: background 0.2s, color 0.2s;
}
.lang-toggle:hover { background: var(--blue); color: #fff; }

.menu-toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: 8px;
  flex-direction: column; gap: 5px;
}
.menu-toggle span { display: block; width: 24px; height: 2px; background: var(--blue); border-radius: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 28px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary { background: var(--gold); color: var(--blue-dark); }
.btn-outline { border: 2px solid #fff; color: #fff; }
.btn-light { background: #fff; color: var(--blue); }
.btn-whatsapp { background: #25d366; color: #fff; }
.phone { font-weight: 800; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(circle at 15% 20%, rgba(212, 166, 58, 0.22), transparent 45%),
    linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
  padding: 90px 0 100px;
}
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 48px; align-items: center; }
.hero-tag { color: var(--gold); font-weight: 700; margin: 0 0 12px; direction: ltr; unicode-bidi: isolate; }
.hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; }
.hero-lead { font-size: 1.15rem; opacity: 0.9; max-width: 600px; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.hero-visual { text-align: center; }
.hero-logo {
  width: min(260px, 70%); height: auto; margin: 0 auto;
  border-radius: 50%;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.hero-slogan { margin-top: 22px; font-weight: 700; color: var(--gold); }

/* ---------- Sections ---------- */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 50px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); color: var(--blue); }
.section-head h2::after {
  content: ""; display: block; width: 60px; height: 4px; border-radius: 2px;
  background: var(--accent); margin: 14px auto 0;
}
.section-head p { color: var(--muted); margin: 0; }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.service-card {
  background: #fff; border: 1px solid #e6ebf0; border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}
.service-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.service-num {
  width: 44px; height: 44px; border-radius: 12px; margin-bottom: 16px;
  display: grid; place-items: center;
  background: var(--accent-light); color: var(--accent); font-weight: 800; font-size: 1.2rem;
}
.service-card h3 { font-size: 1.15rem; color: var(--blue); }
.service-card ul, .why-list { list-style: none; margin: 0; padding: 0; }
.service-card li, .why-list li {
  position: relative; padding-inline-start: 26px; margin-bottom: 8px; color: var(--muted); font-size: 0.95rem;
}
.service-card li::before, .why-list li::before {
  content: "✔"; position: absolute; inset-inline-start: 0; color: var(--accent); font-weight: 700;
}

/* ---------- Certificates ---------- */
.certs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; }
.cert-card {
  margin: 0; background: #fff; border-radius: var(--radius); padding: 28px 18px;
  text-align: center; box-shadow: var(--shadow);
}
.cert-badge {
  width: 120px; height: 120px; margin: 0 auto 16px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--blue); color: #fff;
  border: 5px solid var(--gold); box-shadow: inset 0 0 0 4px #fff;
  direction: ltr;
}
.cert-badge span { font-size: 0.85rem; font-weight: 700; letter-spacing: 2px; opacity: 0.85; }
.cert-badge strong { font-size: 1.35rem; font-weight: 800; }
.badge-blue { background: var(--accent); }
.cert-img { width: 100%; height: 180px; object-fit: contain; margin-bottom: 16px; }
.cert-card figcaption { font-weight: 700; color: var(--blue); font-size: 0.95rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: start; }
.about-text h2 { color: var(--blue); font-size: clamp(1.6rem, 3vw, 2.3rem); }
.about-text p { color: var(--muted); font-size: 1.05rem; }
.about-stat {
  display: inline-flex; align-items: center; gap: 14px; margin-top: 12px;
  padding: 14px 22px; border-radius: var(--radius); background: var(--accent-light);
}
.about-stat strong { font-size: 2rem; color: var(--accent); }
.about-stat span { font-weight: 700; color: var(--blue); }
.why {
  background: var(--blue); color: #fff; border-radius: var(--radius); padding: 34px 30px;
  box-shadow: var(--shadow);
}
.why h3 { font-size: 1.4rem; color: var(--gold); }
.why .why-list li { color: #e3ecf5; font-size: 1rem; margin-bottom: 14px; }
.why .why-list li::before { color: var(--gold); }

/* ---------- Contact ---------- */
.contact { background: linear-gradient(135deg, var(--accent), var(--blue)); color: #fff; text-align: center; }
.contact h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
.contact p { opacity: 0.92; }
.contact-buttons { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 26px; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.social {
  padding: 6px 18px; border-radius: 999px; font-weight: 700; font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.4);
}
.social:hover { background: rgba(255, 255, 255, 0.3); }
.address { margin-top: 18px; white-space: pre-line; }

/* ---------- Footer ---------- */
.site-footer { background: var(--blue-dark); color: #b9c8d6; padding: 36px 0; text-align: center; }
.footer-inner p { margin: 6px 0; }
.brand-footer { justify-content: center; color: #fff; margin-bottom: 8px; direction: ltr; }
.brand-footer img { border-radius: 50%; }
.copy { font-size: 0.85rem; }

.to-top {
  position: fixed; bottom: 20px; inset-inline-end: 20px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: var(--blue); color: #fff; font-weight: 800; box-shadow: var(--shadow);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner, .about-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 70px; text-align: center; }
  .hero-lead { margin-inline: auto; }
  .hero-buttons { justify-content: center; }
  .hero-visual { order: -1; }
  .hero-logo { width: 170px; }
}

@media (max-width: 960px) {
  .menu-toggle { display: flex; }
  .header-actions { margin-inline-start: auto; }
  .main-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 10px 16px 16px;
    background: #fff; border-bottom: 1px solid #e6ebf0; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a { border-radius: 10px; padding: 12px 14px; }
  .section { padding: 64px 0; }
  .container { padding: 0 16px; }
}

/* ---------- Uploaded certificates & videos ---------- */
[hidden] { display: none !important; }
.sub-head { text-align: center; color: var(--blue); font-size: 1.3rem; margin: 0 0 24px; }
#uploaded-certs .sub-head:last-child { margin-top: 56px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 24px; }
.media-card {
  display: flex; flex-direction: column; background: #fff; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s;
}
.media-card:hover { transform: translateY(-4px); }
.media-card img { width: 100%; height: 220px; object-fit: contain; background: #fff; padding: 10px; }
.media-pdf {
  height: 220px; display: grid; place-items: center; background: var(--accent-light);
}
.media-pdf span {
  background: #c62828; color: #fff; font-weight: 800; padding: 10px 18px; border-radius: 8px; letter-spacing: 2px;
}
.media-title { padding: 14px 16px; font-weight: 700; color: var(--blue); text-align: center; }

.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 28px; }
.video-card { margin: 0; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-card figcaption { padding: 14px 18px; font-weight: 700; color: var(--blue); }

.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(0, 0, 0, 0.85);
  display: grid; place-items: center; padding: 24px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; background: #fff; }
.lightbox-close {
  position: absolute; top: 14px; inset-inline-end: 18px; background: none; border: 0;
  color: #fff; font-size: 2.4rem; cursor: pointer; line-height: 1;
}

@media (max-width: 420px) {
  .video-grid { grid-template-columns: 1fr; }
}
