/* =============================================================================
   Virtual Education Management System — public microsite stylesheet
   Complements Bootstrap 5 utilities + components; typography via Google Poppins.
   ============================================================================= */

/* --- Base tokens ------------------------------------------------------------ */
:root {
  --vems-blue: #0d6efd;
  --vems-blue-dark: #0a58ca;
  --vems-ink: #0f172a;
  --vems-muted: #64748b;
  --vems-soft-shadow: 0 0.65rem 1.75rem rgba(15, 23, 42, 0.08);
  --vems-radius: 1rem;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
}

/* Offset in-page anchors for sticky navbar height */
[id="home"],
[id="stats"],
[id="about"],
[id="courses"],
[id="admissions"],
[id="teachers"],
[id="contact"] {
  scroll-margin-top: 88px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body.public-site {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--vems-ink);
  background-color: #fff;
  margin-bottom: 0;
  line-height: 1.6;
}

.section-title {
  color: var(--vems-ink);
  letter-spacing: -0.02em;
}

/* --- First top bar ---------------------------------------------------------- */
.public-top-bar {
  background: linear-gradient(90deg, #0d6efd 0%, #0b5ed7 50%, #0a58ca 100%);
}

.public-top-bar .top-bar-item a {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.public-top-bar .top-bar-item a:hover {
  opacity: 0.92;
}

.public-top-bar .social-icon {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-left: 0.125rem;
  transition: transform 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

.public-top-bar .social-icon:hover {
  transform: translateY(-3px);
  background-color: rgba(255, 255, 255, 0.18);
}

/* --- Main navbar ------------------------------------------------------------ */
.public-main-nav {
  z-index: 1040;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.public-main-nav .brand-logo {
  width: 42px;
  height: 42px;
}

.public-main-nav .brand-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--vems-ink);
  letter-spacing: 0.02em;
}

.brand-link:hover .brand-text {
  color: var(--vems-blue);
}

.public-main-nav .nav-pill {
  border-radius: 999px;
  font-weight: 500;
  color: var(--vems-muted) !important;
  transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.public-main-nav .nav-pill:hover,
.public-main-nav .nav-pill:focus {
  color: var(--vems-blue) !important;
  background-color: rgba(13, 110, 253, 0.08);
  box-shadow: var(--vems-soft-shadow);
}

/* --- Hero carousel (Pakistan education focus) -------------------------------- */
.hero-carousel {
  margin-top: 0;
}

.hero-slide {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  height: min(78vh, 640px);
  background-size: cover;
  background-position: center;
  filter: saturate(1.06) contrast(1.02);
}

/* Stronger dark overlay for readable type over imagery */
.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    185deg,
    rgba(11, 18, 32, 0.72) 0%,
    rgba(15, 23, 42, 0.78) 45%,
    rgba(8, 12, 22, 0.88) 100%
  );
  z-index: 1;
}

.hero-carousel .carousel-item {
  position: relative;
}

/* Vertically center caption content */
.hero-carousel .carousel-caption.hero-caption-centered {
  z-index: 2;
  left: 0;
  right: 0;
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
  padding-bottom: 2rem;
  padding-top: 2rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 575.98px) {
  .hero-carousel .carousel-caption.hero-caption-centered {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    transform: translateY(-48%);
  }
}

/* Main headline — desktop target ~60–72px via clamp */
.hero-main-title {
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  font-size: clamp(2rem, 2.8vw + 1.1rem, 4.5rem);
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.55),
    0 12px 40px rgba(0, 0, 0, 0.45),
    0 0 1px rgba(0, 0, 0, 0.8);
}

/* Slightly smaller titles on slides 2–3 when using h2 */
.hero-slide-alt-title {
  font-size: clamp(1.75rem, 2.4vw + 0.95rem, 3.25rem);
}

/* Accent phrases */
.hero-highlight {
  color: #fde68a;
  font-weight: 800;
  text-shadow:
    0 0 24px rgba(0, 0, 0, 0.65),
    0 4px 16px rgba(0, 0, 0, 0.5);
}

/* Sub heading — medium-large, contrasting sky tone */
.hero-sub-title {
  font-size: clamp(1.15rem, 1.5vw + 0.65rem, 1.55rem);
  font-weight: 600;
  color: #bae6fd;
  text-shadow:
    0 2px 10px rgba(0, 0, 0, 0.55),
    0 1px 0 rgba(0, 0, 0, 0.35);
  max-width: 52rem;
  margin-left: auto;
  margin-right: auto;
}

/* Body description under hero */
.hero-description {
  font-size: clamp(0.95rem, 0.8vw + 0.75rem, 1.1rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.94);
  line-height: 1.65;
  max-width: 42rem;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
}

/* Fade-in when slide becomes active */
@keyframes heroFadeInUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.carousel-item.active .hero-caption-inner > * {
  animation: heroFadeInUp 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.carousel-item.active .hero-caption-inner > *:nth-child(1) {
  animation-delay: 0.04s;
}
.carousel-item.active .hero-caption-inner > *:nth-child(2) {
  animation-delay: 0.14s;
}
.carousel-item.active .hero-caption-inner > *:nth-child(3) {
  animation-delay: 0.22s;
}
.carousel-item.active .hero-caption-inner > *:nth-child(4) {
  animation-delay: 0.3s;
}

/* CTA row */
.hero-cta-row .hero-cta,
.hero-cta-row .hero-cta-secondary {
  min-width: 12rem;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background-color 0.2s ease,
    color 0.2s ease;
}

.hero-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(13, 110, 253, 0.45) !important;
}

.hero-cta-secondary {
  background-color: #fff !important;
  border: 2px solid rgba(255, 255, 255, 0.95) !important;
}

.hero-cta-secondary:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.2) !important;
  background-color: #f8fafc !important;
  color: var(--vems-blue-dark) !important;
}

.hero-control {
  width: 3rem !important;
  height: 3rem !important;
  background-size: 50% 50% !important;
  backdrop-filter: blur(4px);
  background-color: rgba(255, 255, 255, 0.12);
}

.hero-carousel .carousel-indicators button {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* --- Hero stats band -------------------------------------------------------- */
.hero-stats-section {
  background: linear-gradient(180deg, #f1f5f9 0%, #fff 55%, #fff 100%);
  margin-top: -1px;
}

.hero-stat-card {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.55s ease,
    transform 0.55s ease,
    box-shadow 0.25s ease;
}

.hero-stats-section.is-visible .hero-stat-card {
  opacity: 1;
  transform: translateY(0);
}

.hero-stats-section.is-visible .col-6:nth-child(1) .hero-stat-card {
  transition-delay: 0.05s;
}
.hero-stats-section.is-visible .col-6:nth-child(2) .hero-stat-card {
  transition-delay: 0.12s;
}
.hero-stats-section.is-visible .col-6:nth-child(3) .hero-stat-card {
  transition-delay: 0.19s;
}
.hero-stats-section.is-visible .col-6:nth-child(4) .hero-stat-card {
  transition-delay: 0.26s;
}

.hero-stat-card:hover {
  box-shadow: 0 0.75rem 2rem rgba(15, 23, 42, 0.1) !important;
}

.stat-icon-wrap {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(13, 110, 253, 0.12);
  color: var(--vems-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-icon-wrap.stat-icon-light {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.hero-stat-number {
  font-size: clamp(1.5rem, 2vw + 1rem, 2.15rem);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.letter-spacing-sm {
  letter-spacing: 0.06em;
}

.hero-stat-label {
  font-size: clamp(1rem, 1vw + 0.85rem, 1.2rem);
}

/* --- Feature cards ---------------------------------------------------------- */
.feature-card {
  transition: transform 0.26s ease, box-shadow 0.26s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 1.35rem 2.5rem rgba(15, 23, 42, 0.12) !important;
}

.feature-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: rgba(13, 110, 253, 0.1);
  color: var(--vems-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

/* --- About ------------------------------------------------------------------ */
.section-about .about-image-wrap {
  box-shadow: var(--vems-soft-shadow);
}

.section-about .about-image {
  object-fit: cover;
  min-height: 280px;
}

.btn-read-more:hover {
  transform: translateY(-2px);
}

/* --- Teachers --------------------------------------------------------------- */
.teacher-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.teacher-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 1.15rem 2.15rem rgba(15, 23, 42, 0.12) !important;
}

.teacher-avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
}

/* --- Courses ---------------------------------------------------------------- */
.course-thumb {
  height: 182px;
  object-fit: cover;
}

.course-card {
  transition: transform 0.26s ease, box-shadow 0.26s ease;
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 1.35rem 2.5rem rgba(15, 23, 42, 0.12) !important;
}

.btn-course:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(13, 110, 253, 0.3);
}

/* --- Admissions ribbon ------------------------------------------------------- */
.admissions-banner {
  border-block: 1px solid rgba(255, 255, 255, 0.2);
}

/* Apply page — banner contrasts blue public top bar */
.application-page-hero {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 55%, #cbd5e1 100%);
  color: var(--vems-ink);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  padding-block: 1.35rem;
}

.application-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--vems-ink);
}

.application-page-lead {
  font-size: 0.9rem;
  color: var(--vems-muted);
}

.application-page-body {
  padding-block: 2rem;
}

.application-form-card {
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  border-radius: 1.25rem;
  background-color: #fff;
}

.application-form-grid .application-form-row {
  margin-bottom: 0.35rem;
}

.application-form-grid .application-form-row:last-child {
  margin-bottom: 0;
}

.application-form-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--vems-ink);
  margin-bottom: 0;
  text-align: end;
  padding-right: 0.35rem;
  line-height: 1.3;
}

.application-form-field .form-control-sm,
.application-form-field .form-select-sm {
  min-height: calc(1.5em + 0.5rem + 2px);
}

.application-form-field .text-danger.small,
.application-form-card .field-validation-error {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.7rem;
  line-height: 1.2;
}

.application-form-card .input-validation-error,
.application-form-card .form-select.is-invalid {
  border-color: var(--bs-danger);
}

@media (max-width: 991.98px) {
  .application-form-label {
    text-align: start;
    padding-right: 0;
    margin-bottom: 0.15rem;
  }

  .application-form-row {
    margin-bottom: 0.65rem !important;
  }

  .application-form-row > .application-form-field {
    margin-bottom: 0.5rem;
  }
}

/* --- Footer ----------------------------------------------------------------- */
.public-footer {
  background: linear-gradient(180deg, #0b1220 0%, #070b13 100%);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
  display: inline-block;
}

.footer-links a:hover {
  color: #fff;
  padding-left: 4px;
}

.footer-social {
  display: inline-flex;
  width: 2.35rem;
  height: 2.35rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
  transition: transform 0.22s ease, background-color 0.22s ease;
}

.footer-social:hover {
  transform: translateY(-3px);
  background-color: var(--vems-blue);
}

/* --- Focus states (accessibility) ------------------------------------------ */
.btn:focus-visible,
.nav-link:focus-visible,
.form-control:focus-visible,
.navbar-toggler:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.35);
}
