/* ═══════════════════════════════════════════════════════════
   InsoQuest — Public Site (Crio.do inspired premium SaaS)
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Design tokens */
  --navy: #0f172a;
  --blue: #2563eb;
  --sky: #38bdf8;
  --purple: #7c3aed;
  --green: #10b981;
  --gray: #64748b;
  --white: #ffffff;
  --light: #f8fafc;
  --border: #e2e8f0;
  --font-primary: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
  --radius-card: 16px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --transition: 0.2s ease;

  /* Legacy aliases (used across stylesheets) */
  --iq-navy: var(--navy);
  --iq-navy-light: #1e293b;
  --iq-navy-dark: #020617;
  --iq-blue: var(--blue);
  --iq-blue-light: #3b82f6;
  --iq-blue-glow: rgba(37, 99, 235, 0.35);
  --iq-accent: var(--sky);
  --iq-gradient: linear-gradient(135deg, var(--blue) 0%, var(--purple) 50%, var(--sky) 100%);
  --iq-gradient-soft: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 50%, #ecfeff 100%);
  --iq-text: var(--navy);
  --iq-text-muted: var(--gray);
  --iq-border: var(--border);
  --iq-white: var(--white);
  --iq-radius: 12px;
  --iq-radius-lg: 20px;
  --iq-shadow: var(--shadow-card);
  --iq-shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --navbar-height: 76px;
  --font-heading: var(--font-primary);
  --btn-radius-pill: 9999px;
  --btn-primary: #ff751f;
  --btn-primary-hover: #e5660c;
  --btn-primary-light: #ff914d;
  --btn-primary-soft: rgba(255, 117, 31, 0.12);
  --btn-shadow: 0 4px 14px rgba(255, 117, 31, 0.28);
  --btn-shadow-hover: 0 8px 22px rgba(255, 117, 31, 0.38);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--iq-text);
  background: var(--iq-white);
  overflow-x: hidden;
}

img,
iframe,
video {
  max-width: 100%;
}

body.page-inner {
  padding-top: var(--navbar-height);
}

/* Inner-page heroes already pad for navbar — pull bg flush under fixed header */
body.page-inner #main-content > :first-child[class$='-hero'] {
  margin-top: calc(-1 * var(--navbar-height));
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
}

a {
  color: var(--iq-blue);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--iq-blue-light);
}

/* ─── Logo ─── */
.iq-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--iq-white);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.iq-logo .logo-dot {
  color: var(--iq-blue-light);
}

.navbar-brand.iq-logo {
  display: inline-flex;
  align-items: center;
  padding: 0;
  margin-right: 0.75rem;
  background: transparent !important;
  line-height: 1;
}

.site-logo-img {
  display: block;
  height: 42px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: left center;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.footer-logo .site-logo-img {
  height: 44px;
  max-width: 220px;
}

.page-inner .iq-logo,
.footer-logo {
  color: var(--iq-white);
}

/* ─── Navbar ─── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-home .site-header {
  background: transparent;
}

.page-home .site-header .iq-navbar {
  background: transparent;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.page-inner .site-header .iq-navbar,
.site-header.is-scrolled .iq-navbar {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.site-header.is-scrolled .iq-navbar,
.site-header.navbar-scrolled .iq-navbar {
  background: rgba(15, 23, 42, 0.95);
}

.site-header.navbar-scrolled .iq-navbar {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.iq-navbar .nav-link {
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88) !important;
  padding: 0.5rem 1rem !important;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.iq-navbar .nav-link:hover,
.iq-navbar .nav-link.active {
  color: var(--iq-white) !important;
  background: rgba(255, 255, 255, 0.1);
}

.iq-navbar .nav-link.active {
  color: var(--iq-blue-light) !important;
}

/* ─── Button system (public site) ─── */
body:not(.admin-app) .btn {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.25;
  border-radius: var(--btn-radius-pill);
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease,
    box-shadow 0.2s ease, transform 0.2s ease;
}

body:not(.admin-app) .btn:focus-visible {
  outline: 2px solid var(--btn-primary-light);
  outline-offset: 2px;
  box-shadow: none;
}

body:not(.admin-app) .btn-sm {
  font-size: 0.8125rem;
  padding: 0.5rem 1rem;
}

body:not(.admin-app) .btn-lg {
  font-size: 1rem;
  padding: 0.85rem 1.75rem;
}

/* Primary filled */
body:not(.admin-app) .btn-cta,
body:not(.admin-app) .btn-primary,
body:not(.admin-app) .btn-hero-primary {
  position: relative;
  overflow: hidden;
  background: var(--btn-primary);
  color: var(--iq-white) !important;
  border: 2px solid var(--btn-primary);
  box-shadow: var(--btn-shadow);
  white-space: nowrap;
}

body:not(.admin-app) .btn-cta:not(.btn-sm):not(.btn-lg),
body:not(.admin-app) .btn-primary:not(.btn-sm):not(.btn-lg),
body:not(.admin-app) .btn-hero-primary:not(.btn-sm):not(.btn-lg) {
  font-size: 0.9375rem;
  padding: 0.72rem 1.45rem;
}

body:not(.admin-app) .btn-cta:hover,
body:not(.admin-app) .btn-primary:hover,
body:not(.admin-app) .btn-hero-primary:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: var(--iq-white) !important;
  transform: translateY(-2px);
  box-shadow: var(--btn-shadow-hover);
}

body:not(.admin-app) .btn-cta:active,
body:not(.admin-app) .btn-primary:active,
body:not(.admin-app) .btn-hero-primary:active {
  transform: translateY(0);
}

/* Secondary outline (light backgrounds) */
body:not(.admin-app) .btn-outline-primary,
body:not(.admin-app) .btn-outline-secondary {
  background: transparent;
  color: var(--btn-primary) !important;
  border: 2px solid var(--btn-primary);
  box-shadow: none;
}

body:not(.admin-app) .btn-outline-primary:not(.btn-sm):not(.btn-lg),
body:not(.admin-app) .btn-outline-secondary:not(.btn-sm):not(.btn-lg) {
  font-size: 0.9375rem;
  padding: 0.72rem 1.45rem;
}

body:not(.admin-app) .btn-outline-primary:hover,
body:not(.admin-app) .btn-outline-secondary:hover {
  background: var(--btn-primary-soft);
  border-color: var(--btn-primary-light);
  color: var(--btn-primary-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 117, 31, 0.18);
}

body:not(.admin-app) .btn-outline-success {
  background: transparent;
  color: #059669 !important;
  border: 2px solid #10b981;
  box-shadow: none;
}

body:not(.admin-app) .btn-outline-success:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: #059669;
  color: #047857 !important;
  transform: translateY(-2px);
}

body:not(.admin-app) .btn-link {
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
}

body:not(.admin-app) .btn-link:hover {
  text-decoration: underline;
}

.iq-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.btn-ripple {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple-anim 0.6s ease-out;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

@keyframes ripple-anim {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Mega menu */
.mega-dropdown {
  position: static !important;
}

.mega-menu {
  left: 0 !important;
  right: 0 !important;
  width: 100%;
  margin-top: 0 !important;
  border-radius: 0 0 var(--iq-radius-lg) var(--iq-radius-lg) !important;
  background: var(--iq-white) !important;
  padding: 0 !important;
}

.mega-menu-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--iq-blue);
  margin-bottom: 0.75rem;
}

.mega-menu-list a {
  display: block;
  padding: 0.35rem 0;
  color: var(--iq-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.mega-menu-list a:hover {
  color: var(--iq-blue);
  padding-left: 4px;
}

.mega-menu-empty {
  color: var(--iq-text-muted);
}

/* Mobile toggler */
.navbar-toggler {
  width: 44px;
  height: 44px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.toggler-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--iq-white);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.navbar-toggler.is-active .toggler-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar-toggler.is-active .toggler-bar:nth-child(2) {
  opacity: 0;
}

.navbar-toggler.is-active .toggler-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1045;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.35s ease;
}

.mobile-drawer.is-open {
  pointer-events: auto;
  visibility: visible;
}

.mobile-drawer-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.mobile-drawer.is-open .mobile-drawer-overlay {
  opacity: 1;
}

.mobile-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--iq-navy);
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

.mobile-drawer.is-open .mobile-drawer-panel {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.mobile-drawer-nav a {
  display: block;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  padding: 0.85rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-drawer-nav a:hover,
.mobile-drawer-nav a.active {
  color: var(--iq-blue-light);
}

/* ─── Footer ─── */
.site-footer {
  background: var(--iq-navy);
  color: rgba(255, 255, 255, 0.85);
  padding: 4rem 0 0;
  margin-top: 5rem;
}

.footer-heading {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--iq-white);
  margin-bottom: 1.25rem;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--iq-blue-light);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.footer-about {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.footer-contact li {
  margin-bottom: 0.5rem;
}

.footer-contact a {
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-contact a:hover {
  color: var(--iq-white);
}

.footer-links a {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
  padding: 0.35rem 0;
  transition: all 0.2s ease;
}

.footer-links a:hover {
  color: var(--iq-blue-light);
  padding-left: 4px;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.footer-social a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: var(--iq-white);
  font-size: 1.15rem;
  transition: all 0.25s ease;
}

.footer-social a:hover {
  background: var(--iq-blue);
  color: var(--iq-white);
  transform: translateY(-3px);
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom {
  margin-top: 3rem;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.65);
}

.footer-bottom a:hover {
  color: var(--iq-white);
}

.footer-bottom .col-md-12 {
  overflow-wrap: anywhere;
}

/* ─── WhatsApp float ─── */
.whatsapp-float {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9999;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .whatsapp-float {
    bottom: 28px;
  }
}

.whatsapp-icon {
  position: relative;
  z-index: 2;
  width: 58px;
  height: 58px;
  background: #25d366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.75rem;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
  transition: transform 0.25s ease;
}

.whatsapp-float:hover .whatsapp-icon {
  transform: scale(1.08);
}

.whatsapp-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #25d366;
  animation: whatsapp-pulse 2s ease-out infinite;
  z-index: 1;
}

@keyframes whatsapp-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ─── Mobile CTA bar ─── */
.mobile-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  display: flex;
  background: var(--iq-white);
  border-top: 1px solid var(--iq-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-cta-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  border: none;
}

.mobile-cta-call {
  background: var(--iq-navy);
  color: var(--iq-white) !important;
}

.mobile-cta-wa {
  background: #25d366;
  color: var(--iq-white) !important;
}

body {
  padding-bottom: 0;
}

@media (max-width: 767.98px) {
  body {
    padding-bottom: 56px;
  }
}

/* ─── Lead modal ─── */
.lead-modal-content {
  border-radius: var(--iq-radius-lg) !important;
  overflow: hidden;
}

.lead-modal-header {
  background: var(--iq-navy);
  padding: 1.25rem 1.5rem;
}

.lead-modal-header .modal-title {
  font-family: var(--font-heading);
  font-weight: 600;
}

#leadModalForm .form-label {
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--iq-text);
}

#leadModalForm .form-control,
#leadModalForm .form-select {
  border-radius: 10px;
  border-color: var(--iq-border);
  padding: 0.65rem 0.85rem;
}

#leadModalForm .form-control:focus,
#leadModalForm .form-select:focus {
  border-color: var(--iq-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.success-icon {
  font-size: 4rem;
  color: #22c55e;
  line-height: 1;
}

/* ─── Legacy / page sections (from prior phases) ─── */
.hero-section {
  background: var(--iq-gradient);
  min-height: 520px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.page-header {
  background: var(--iq-gradient);
  padding: 4rem 0;
}

.course-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: none;
  border-radius: var(--iq-radius);
  overflow: hidden;
}

.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--iq-shadow-lg) !important;
}

.course-img-placeholder {
  height: 180px;
  background: var(--iq-gradient-soft);
}

.stat-card {
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.about-placeholder {
  background: var(--iq-gradient);
  min-height: 300px;
  border-radius: var(--iq-radius-lg);
}

.min-vh-50 {
  min-height: 50vh;
}

.breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.6);
}

.breadcrumb-item a {
  color: rgba(255, 255, 255, 0.75);
}

.breadcrumb-item.active {
  color: #fff;
}

.accordion-button:not(.collapsed) {
  background-color: #eff6ff;
  color: var(--iq-blue);
}

/* Section utilities */
.section-padding {
  padding: 5rem 0;
}

.section-alt {
  background: var(--light);
}

.section-alt + .section-padding:not(.section-alt),
.section-padding:not(.section-alt) + .section-alt {
  /* alternating rhythm */
}

/* Counter stats */
.counter,
.counter-animate {
  font-variant-numeric: tabular-nums;
}

/* Testimonial quote accent */
.testimonial-slide,
.placement-testimonial-card {
  position: relative;
}

.testimonial-quote::before,
.placement-testimonial-text::before {
  content: '\201C';
  position: absolute;
  left: -0.15em;
  top: -0.35em;
  font-size: 3rem;
  line-height: 1;
  color: var(--blue);
  opacity: 0.2;
  font-family: Georgia, serif;
}

.placement-testimonial-card {
  border-left: 4px solid var(--blue);
  padding-left: 1.25rem;
}

/* Error pages */
.error-page-code {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(4rem, 12vw, 7rem);
  color: var(--blue);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.error-page-title {
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--iq-navy);
  margin-bottom: 0.75rem;
}

.section-subtitle {
  color: var(--iq-text-muted);
  font-size: 1.1rem;
  max-width: 600px;
}

.text-gradient {
  background: var(--iq-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive footer */
@media (max-width: 575.98px) {
  body:not(.admin-app) .iq-btn-group {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  body:not(.admin-app) .iq-btn-group .btn {
    width: 100%;
  }

  .container,
  .container-fluid {
    overflow-x: clip;
  }

  .iq-navbar .container {
    gap: 0.5rem;
  }

  .navbar-toggler {
    width: 40px;
    height: 40px;
  }

  .mobile-drawer-panel {
    width: 100%;
    max-width: 320px;
  }

  .footer-grid > div {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-contact a {
    justify-content: center;
  }

  .mobile-cta-btn {
    font-size: 0.82rem;
    padding: 0.8rem 0.45rem;
  }
}

/* Shared placement stat cards (home, about, placements) */
.placement-stat-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.75rem 1rem;
  text-align: center;
  box-shadow: var(--iq-shadow, 0 4px 24px rgba(15, 23, 42, 0.06));
  border: 1px solid var(--iq-border, #e2e8f0);
  height: 100%;
}

.placement-stat-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.5rem;
}

.placement-stat-icon-img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
}

.placement-stat-icon-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 150px;
  height: 150px;
  margin: 0 auto 0.75rem;
  border-radius: 16px;
  background: #dbeafe;
  color: #2563eb;
  font-size: 2.5rem;
}

.placement-stat-value {
  display: block;
  font-family: var(--font-heading, 'Poppins', sans-serif);
  font-weight: 700;
  font-size: 2rem;
  color: var(--iq-blue, #2563eb);
  line-height: 1.2;
}

.placement-stat-label {
  font-size: 0.85rem;
  color: var(--iq-text-muted, #64748b);
}
