/* ==========================================================================
   OccuSure Health Pvt Ltd — Shared Stylesheet
   ========================================================================== */

* {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

h1, h2, h3, h4, h5, h6, .font-heading {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

/* Visually hidden utility (preserves accessibility tree; reveals focusable skip links) */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link:focus-visible {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  background: #1a4d8f;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

/* High-contrast focus indicators */
:where(a:any-link, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #2e8b3f;
  outline-offset: 2px;
}

.bg-primary :where(a:any-link, button):focus-visible,
.bg-dark :where(a:any-link, button):focus-visible,
.hero-bg :where(a:any-link, button):focus-visible,
.page-hero :where(a:any-link, button):focus-visible {
  outline-color: #6ee7b7;
}

/* Navbar states */
#navbar {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#navbar.scrolled,
#navbar.navbar-solid {
  background-color: #ffffff !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

#navbar.scrolled .nav-link,
#navbar.navbar-solid .nav-link {
  color: #1c2b3a !important;
}

#navbar.scrolled .nav-link:hover,
#navbar.navbar-solid .nav-link:hover,
#navbar.scrolled .nav-link[aria-current="page"],
#navbar.navbar-solid .nav-link[aria-current="page"] {
  color: #1a4d8f !important;
}

#navbar.scrolled #hamburger,
#navbar.navbar-solid #hamburger {
  color: #1c2b3a !important;
}

#navbar.scrolled .logo-subtext,
#navbar.navbar-solid .logo-subtext {
  color: #64748b !important;
}

/* Mobile menu drawer */
#mobile-menu {
  transition: max-height 0.3s ease, opacity 0.25s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

#mobile-menu.open {
  max-height: 440px;
  opacity: 1;
}

/* Hero backgrounds */
.hero-bg {
  background: linear-gradient(135deg, rgba(26, 77, 143, 0.92) 0%, rgba(18, 58, 109, 0.78) 55%, rgba(26, 77, 143, 0.68) 100%),
              url('../images/gallery/camp-25.jpg') center/cover no-repeat;
  min-height: 100vh;
}

.page-hero {
  background: linear-gradient(135deg, #1a4d8f 0%, #123a6d 65%, #185745 100%);
}

/* Card hover effects */
.stat-card,
.service-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(26, 77, 143, 0.14);
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(90deg, #1a4d8f, #2e8b3f);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Pulsing badge */
@keyframes pulse-ring {
  0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(46, 139, 63, 0.5); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(46, 139, 63, 0); }
  100% { transform: scale(0.96); }
}

.pulse-badge {
  animation: pulse-ring 2.2s infinite;
}

/* Client marquee */
@keyframes marquee-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes marquee-right {
  0% { transform: translateX(-50%); }
  100% { transform: translateX(0); }
}

.marquee-track {
  width: max-content;
  will-change: transform;
}

.marquee-left {
  animation: marquee-left 45s linear infinite;
}

.marquee-right {
  animation: marquee-right 48s linear infinite;
}

.marquee-wrapper:hover .marquee-track {
  animation-play-state: paused;
}

.client-logo-card {
  width: 210px;
  height: 112px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .client-logo-card {
    width: 170px;
    height: 96px;
  }
}

/* Native <dialog> lightbox & modal scroll containment */
dialog:modal {
  overscroll-behavior: contain;
  margin: auto;
  border: none;
  padding: 0;
  background: transparent;
  max-width: min(94vw, 960px);
  max-height: 92vh;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
}

/* Native <details> accordion icon rotation */
summary::-webkit-details-marker {
  display: none;
}

details[open] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-chevron {
  transition: transform 0.2s ease;
}

/* Accessible Form Controls & Progressive Validation (:user-invalid / :user-valid) */
.form-control {
  font: inherit;
  font-size: max(1rem, 1em);
  min-height: 48px;
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #94a3b8;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  color: #1c2b3a;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

@media (pointer: coarse) {
  .form-control {
    min-height: 52px;
  }
}

.form-control:focus {
  border-color: #1a4d8f;
}

.form-hint {
  display: block;
  color: #475569;
  font-size: 0.85rem;
  margin-bottom: 0.375rem;
}

.error-msg {
  display: none;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: 0.375rem;
  align-items: center;
  gap: 0.375rem;
}

.form-control:is(:user-invalid, .user-invalid-fallback) {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.form-control:is(:user-invalid, .user-invalid-fallback) + .error-msg {
  display: flex;
}

.form-control:is(:user-valid, .user-valid-fallback) {
  border-color: #2e8b3f;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: #1a4d8f;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .marquee-left,
  .marquee-right,
  .pulse-badge {
    animation: none;
  }
  .marquee-wrapper {
    overflow-x: auto;
  }
  .stat-card,
  .service-card,
  #navbar,
  #mobile-menu {
    transition: none;
  }
}
