/* ==========================================================================
   TIRUPUR WASTE MANAGEMENT PROGRAMME — RESPONSIVE DESIGN SYSTEM
   Mobile-First | Fluid Typography | 100svh Hero | Zero Layout Shifts
   ========================================================================== */

/* ==========================================================================
   1. DESIGN TOKENS & FLUID PROPERTIES
   ========================================================================== */
:root {
  /* Brand Color Palette */
  --color-primary: #1F7A4D;
  --color-primary-light: #2E8B57;
  --color-primary-dark: #18603A;
  --color-primary-hover: #258756;
  --color-secondary: #2E5C8A;
  --color-secondary-light: #3A7BC8;
  --color-background: #FFFFFF;
  --color-background-alt: #F4F6F5;
  --color-surface: #FFFFFF;
  --color-text-primary: #1C1E1F;
  --color-text-secondary: #4A4E4D;
  --color-text-muted: #6B6E6D;
  --color-border: #E0E4E2;
  --color-border-focus: #1F7A4D;
  --color-error: #C62828;
  --color-error-bg: #FEF2F2;
  --color-success: #1F7A4D;
  --color-success-bg: #F0FDF4;
  --color-shadow: rgba(0, 0, 0, 0.06);
  --color-shadow-hover: rgba(0, 0, 0, 0.12);
  --color-shadow-strong: rgba(0, 0, 0, 0.16);
  --color-overlay: rgba(255, 255, 255, 0.65);
  --color-overlay-strong: rgba(255, 255, 255, 0.85);

  /* Typography Stack */
  --font-primary: 'Noto Sans Tamil', 'Inter', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Noto Sans Tamil', 'Inter', 'Noto Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Fluid Typography (clamp min, preferred, max) */
  --fs-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.8125rem);
  --fs-sm: clamp(0.8125rem, 0.775rem + 0.25vw, 0.875rem);
  --fs-base: clamp(0.9375rem, 0.9rem + 0.25vw, 1rem);
  --fs-lg: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
  --fs-xl: clamp(1.1875rem, 1.1rem + 0.5vw, 1.375rem);
  --fs-2xl: clamp(1.375rem, 1.25rem + 0.75vw, 1.75rem);
  --fs-3xl: clamp(1.625rem, 1.45rem + 1.25vw, 2.25rem);
  --fs-4xl: clamp(2rem, 1.7rem + 1.75vw, 2.875rem);
  --fs-5xl: clamp(2.5rem, 2.1rem + 2.5vw, 3.75rem);
  --fs-6xl: clamp(3rem, 2.5rem + 4vw, 5.25rem);

  /* Fluid Spacing Scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --space-10: clamp(1.75rem, 1.5rem + 1.5vw, 2.5rem);
  --space-12: clamp(2rem, 1.75rem + 2vw, 3rem);
  --space-16: clamp(2.5rem, 2rem + 3vw, 4rem);
  --space-20: clamp(3rem, 2.5rem + 4vw, 5rem);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Z-Index Layers */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-drawer: 250;
  --z-modal: 300;
  --z-toast: 400;

  /* Global Unified Container */
  --container-max: 1280px;
  --container-padding: clamp(16px, 4vw, 48px);

  /* Navbar Dimensions */
  --navbar-height: 68px;
  --navbar-height-scrolled: 60px;
}

/* ==========================================================================
   2. RESET & ACCESSIBILITY DEFAULTS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--navbar-height) + 16px);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--color-text-primary);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
  touch-action: manipulation;
}

a:hover {
  color: var(--color-primary-hover);
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  touch-action: manipulation;
}

input, select, textarea {
  font-family: inherit;
  font-size: 16px; /* 16px min prevents iOS Safari auto-zoom on focus */
  color: inherit;
}

::selection {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   3. UNIFIED FLUID CONTAINER & UTILITIES
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   4. BUTTONS & TOUCH TARGETS (≥ 44px)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px; /* Comfortable 48px touch target */
  padding: var(--space-3) var(--space-6);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(31, 122, 77, 0.28);
}

@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-hover);
    box-shadow: 0 6px 18px rgba(31, 122, 77, 0.38);
    transform: translateY(-2px);
  }
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

@media (hover: hover) {
  .btn-secondary:hover:not(:disabled) {
    background-color: var(--color-primary);
    color: #FFFFFF;
  }
}

.btn-lg {
  min-height: 52px;
  padding: var(--space-4) var(--space-8);
  font-size: var(--fs-lg);
}

.btn-sm {
  min-height: 40px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--fs-sm);
}

.btn-loader {
  display: none;
}

.btn.loading .btn-text {
  display: none;
}

.btn.loading .btn-loader {
  display: inline-flex;
}

/* ==========================================================================
   5. RESPONSIVE NAVBAR & MOBILE DRAWER
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  z-index: var(--z-sticky);
  transition: height var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}

.navbar.scrolled {
  height: var(--navbar-height-scrolled);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
  font-weight: 700;
  color: var(--color-text-primary);
  text-decoration: none;
  min-height: 44px;
}

.logo:hover {
  color: var(--color-primary);
}

.logo-icon {
  font-size: 1.5rem;
  color: var(--color-primary);
  flex-shrink: 0;
}

.logo span {
  white-space: nowrap;
}

/* Desktop Navigation Links */
.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-8);
}

.nav-link {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text-secondary);
  padding: var(--space-2) 0;
  position: relative;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-primary);
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background-color: rgba(31, 122, 77, 0.08);
  border: 1px solid rgba(31, 122, 77, 0.22);
  border-radius: 9999px;
  padding: 3px;
  gap: 2px;
}

.lang-btn {
  padding: 5px 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 9999px;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1.2;
  font-family: inherit;
}

.lang-btn:hover {
  color: var(--color-primary);
}

.lang-btn.active {
  background-color: var(--color-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(31, 122, 77, 0.28);
}

.lang-switcher-mobile {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-block: var(--space-2);
}

.nav-cta-desktop {
  display: none;
}

.nav-cta-mobile {
  display: inline-flex;
  width: 100%;
  margin-top: var(--space-2);
}

/* Hamburger Toggle (≥ 44px tap target) */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  z-index: calc(var(--z-drawer) + 10);
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2.5px;
  background-color: var(--color-text-primary);
  border-radius: 2px;
  transition: all var(--transition-base);
  transform-origin: center;
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* Mobile Navigation Drawer (< 1024px) */
@media (max-width: 1023px) {
  .nav-links {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    padding: var(--space-6) var(--container-padding) var(--space-8);
    gap: var(--space-3);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition-base), opacity var(--transition-base), visibility var(--transition-base);
    z-index: var(--z-drawer);
    max-height: calc(100svh - var(--navbar-height));
    overflow-y: auto;
  }

  .nav-links.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-lg);
    font-weight: 600;
    border-radius: var(--radius-md);
  }

  .nav-link:active {
    background-color: var(--color-background-alt);
  }

  .nav-link::after {
    display: none;
  }
}

@media (min-width: 1024px) {
  .nav-links {
    display: flex;
  }
  .hamburger {
    display: none;
  }
  .nav-cta-desktop {
    display: inline-flex;
  }
  .nav-cta-mobile {
    display: none;
  }
}

/* ==========================================================================
   5a. TAMIL LANGUAGE NAVBAR OVERRIDES
   When body.lang-ta is active, Tamil text is wider — tighten spacing & font
   ========================================================================== */
/* Tighten gap between nav links in Tamil */
body.lang-ta .nav-links {
  gap: clamp(0.6rem, 1.2vw, 1.2rem);
}

/* Smaller font on nav links in Tamil to prevent crowding */
body.lang-ta .nav-link {
  font-size: clamp(0.72rem, 1vw, 0.825rem);
  letter-spacing: -0.01em;
}

/* Shrink the CTA button padding in Tamil so it doesn't overflow */
body.lang-ta .nav-cta-desktop {
  font-size: clamp(0.72rem, 0.9vw, 0.825rem);
  padding-inline: clamp(0.65rem, 1.4vw, 1.1rem);
  min-height: 40px;
}

/* Shrink logo text slightly in Tamil to create breathing room */
body.lang-ta .logo {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
}

/* Reduce overall navbar height slightly in Tamil to avoid clumsiness */
@media (min-width: 1024px) {
  body.lang-ta {
    --navbar-height: 72px;
  }
}

/* Wider zone select in Tamil so labels don't get clipped */
body.lang-ta #zone,
body.lang-ta select[id="zone"] {
  min-width: 0;
}

/* Make form grid give more room to zone/ward on Tamil */
body.lang-ta .form-row {
  gap: 0.75rem;
}



/* ==========================================================================
   6. HERO SECTION & AUTO CAROUSEL (100svh Mobile Viewport Unit)
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100svh; /* 100svh eliminates iOS/Chrome address bar height jumps */
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--navbar-height);
}

.hero-carousel {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background-color: #0F172A;
}

.hero-slides-wrapper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 1.2s;
  z-index: 1;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.hero-slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  transform: scale(1);
  transition: transform 6.5s ease-out;
}

.hero-slide.active .hero-slide-img {
  transform: scale(1.06); /* Smooth Ken Burns cinematic zoom */
}

/* Floating Slide Caption Pill */
.hero-slide-caption {
  position: absolute;
  top: clamp(5.5rem, 10vh, 7.5rem);
  right: clamp(1rem, 4vw, 3rem);
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
  pointer-events: none;
}

.hero-slide.active .hero-slide-caption {
  opacity: 1;
  transform: translateY(0);
}

.slide-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4ADE80;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.slide-caption-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #F8FAFC;
}

@media (max-width: 640px) {
  .hero-slide-caption {
    display: none; /* Keep mobile view ultra clean and focused */
  }
}

/* Carousel Navigation Arrows */
.carousel-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #FFFFFF;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.carousel-nav-btn:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFFFFF;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 0 20px rgba(31, 122, 77, 0.5);
}

.carousel-nav-btn.prev {
  left: clamp(0.75rem, 2.5vw, 2.5rem);
}

.carousel-nav-btn.next {
  right: clamp(0.75rem, 2.5vw, 2.5rem);
}

@media (max-width: 640px) {
  .carousel-nav-btn {
    display: none; /* Mobile uses intuitive touch swipe and indicators */
  }
}

/* Carousel Indicators / Dots */
.carousel-indicators {
  position: absolute;
  bottom: clamp(1.25rem, 3.5vh, 2.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
  width: 28px;
  background: var(--color-primary-light, #2EAF6D);
  box-shadow: 0 0 10px rgba(46, 175, 109, 0.6);
}

/* Enhanced Gradient Overlay for 100% Readability */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.72) 0%,
    rgba(15, 23, 42, 0.48) 35%,
    rgba(15, 23, 42, 0.75) 70%,
    rgba(15, 23, 42, 0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: var(--space-12) var(--container-padding) var(--space-16);
  max-width: 900px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5.5vw, 4.25rem);
  font-weight: 800;
  line-height: 1.18;
  color: #FFFFFF !important;
  margin-bottom: var(--space-4);
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.95),
    0 2px 8px rgba(0, 0, 0, 0.98),
    0 0 40px rgba(0, 0, 0, 0.6);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  font-weight: 500;
  color: #F8FAFC !important;
  margin-bottom: var(--space-8);
  max-width: 680px;
  line-height: 1.65;
  text-wrap: balance;
  text-shadow: 
    0 3px 16px rgba(0, 0, 0, 0.95),
    0 1px 4px rgba(0, 0, 0, 0.98);
}

.hero-counter {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: clamp(0.85rem, 2vw, 1.25rem) clamp(1.5rem, 3.5vw, 2.75rem);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.4), 0 0 20px rgba(31, 122, 77, 0.25);
  margin-bottom: var(--space-8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  width: auto;
  max-width: 100%;
}

.counter-number {
  font-family: var(--font-heading);
  font-size: var(--fs-5xl);
  font-weight: 900;
  color: #15803D;
  line-height: 1;
  letter-spacing: -0.02em;
}

.counter-label {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-buttons {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  max-width: 360px;
  justify-content: center;
}

@media (min-width: 600px) {
  .hero-buttons {
    flex-direction: row;
    max-width: none;
    width: auto;
    gap: var(--space-4);
  }
  .hero-buttons .btn {
    min-width: 180px;
  }
}

.scroll-indicator {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  animation: scrollBounce 2s infinite ease-in-out;
}

@media (min-height: 700px) and (min-width: 768px) {
  .scroll-indicator {
    display: flex;
  }
}

@keyframes scrollBounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-8px);
  }
  60% {
    transform: translateX(-50%) translateY(-4px);
  }
}

/* ==========================================================================
   7. SECTIONS & CARDS LAYOUT
   ========================================================================== */
.section {
  padding: var(--space-16) 0;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
  max-width: 720px;
  margin-inline: auto;
}

.section-title {
  font-family: var(--font-heading);
  font-size: var(--fs-4xl);
  font-weight: 800;
  color: var(--color-text-primary);
  margin-bottom: var(--space-3);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-subtitle {
  font-size: var(--fs-lg);
  color: var(--color-text-secondary);
  line-height: 1.6;
  text-wrap: balance;
}

/* Generic Card */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 2rem);
  box-shadow: 0 4px 20px var(--color-shadow);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  height: 100%;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 36px var(--color-shadow-hover);
  }
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  background-color: var(--color-success-bg);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  flex-shrink: 0;
}

.card-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.card-text {
  font-size: var(--fs-base);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* Vision & Mission Grid */
.vm-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

@media (min-width: 768px) {
  .vm-grid {
    grid-template-columns: repeat(2, 1fr);
    align-items: stretch;
  }
}

/* Pillars Grid (Fluid auto-fit from 1 -> 2 -> 4 cols) */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: var(--space-6);
}

.pillar-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   8. CITIZEN ENROLLMENT FORM (Mobile-First & Touch Optimised)
   ========================================================================== */
.enroll {
  background-color: var(--color-background-alt);
}

.form-wrapper {
  width: 100%;
  max-width: 680px;
  margin-inline: auto;
}

.enrollment-form {
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: clamp(1.25rem, 4vw, 2.5rem);
  box-shadow: 0 8px 32px var(--color-shadow);
  border: 1px solid var(--color-border);
}

.form-row {
  margin-bottom: var(--space-4);
}

/* 2-Column paired grid on sm+ screens */
.form-row-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

@media (min-width: 600px) {
  .form-row-grid {
    grid-template-columns: 1fr 1.25fr;
  }

  /* In Tamil, give zone column more room for longer labels */
  body.lang-ta .form-row-grid {
    grid-template-columns: 1.3fr 1fr;
  }
}

.form-group {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.form-label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.required {
  color: var(--color-error);
}

.form-input,
.form-select {
  width: 100%;
  min-height: 48px; /* Touch friendly height */
  padding: 0.75rem 1rem;
  font-size: 16px; /* Prevents auto-zoom in iOS Safari */
  color: var(--color-text-primary);
  background-color: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input::placeholder {
  color: var(--color-text-muted);
}

@media (hover: hover) {
  .form-input:hover,
  .form-select:hover {
    border-color: var(--color-text-muted);
  }
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 3px rgba(31, 122, 77, 0.18);
}

.form-input.error,
.form-select.error {
  border-color: var(--color-error);
}

.form-input.error:focus,
.form-select.error:focus {
  box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.18);
}

/* Native OS select picker */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234A4E4D' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.75rem;
  cursor: pointer;
}

/* Tamil: shrink select font to 14px so zone labels fit in the box */
body.lang-ta .form-select {
  font-size: 14px;
  padding: 0.65rem 2.5rem 0.65rem 0.85rem;
}

.error-message {
  display: block;
  font-size: var(--fs-xs);
  color: var(--color-error);
  margin-top: 0.35rem;
  min-height: 1.2em;
  font-weight: 500;
}

/* Checkbox target wrapper (min 44px tap target) */
.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-top: var(--space-2);
  margin-bottom: var(--space-6);
  cursor: pointer;
}

.form-checkbox {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  accent-color: var(--color-primary);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.checkbox-label {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  line-height: 1.55;
  cursor: pointer;
  user-select: none;
}

.form-actions {
  margin-top: var(--space-2);
}

.btn-submit {
  width: 100%;
}

.privacy-note {
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.6;
}

/* Form Success State */
.success-message {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  animation: formSuccessIn 0.35s ease-out;
}

@keyframes formSuccessIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  background-color: var(--color-success-bg);
  border-radius: 50%;
  color: var(--color-success);
  font-size: 2.5rem;
  margin-bottom: var(--space-4);
}

.success-message h3 {
  font-family: var(--font-heading);
  font-size: var(--fs-2xl);
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.success-message p {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  font-size: var(--fs-base);
}

/* ==========================================================================
   9. OUR NUMBERS / LIVE STATS SECTION
   ========================================================================== */
.our-numbers {
  background-color: var(--color-background-alt);
}

.numbers-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  max-width: 980px;
  margin-inline: auto;
}

@media (min-width: 640px) {
  .numbers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.stat-card {
  text-align: center;
  padding: clamp(1.25rem, 3vw, 2rem);
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 20px var(--color-shadow);
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  background-color: var(--color-success-bg);
  border-radius: 50%;
  color: var(--color-primary);
  font-size: 1.75rem;
  margin-bottom: var(--space-3);
}

.stat-value {
  font-family: var(--font-heading);
  font-size: var(--fs-5xl);
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1.1;
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.numbers-note {
  text-align: center;
  margin-top: var(--space-8);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}

/* ==========================================================================
   10. FOOTER (Fluid Multi-Column)
   ========================================================================== */
.footer {
  background-color: var(--color-text-primary);
  color: var(--color-background);
  padding: var(--space-16) 0 var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: var(--space-12);
}

.footer-title {
  font-family: var(--font-heading);
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
  color: #FFFFFF;
}

.footer-text {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
  margin-bottom: var(--space-6);
  font-size: var(--fs-sm);
}

.social-links {
  display: flex;
  gap: var(--space-3);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px; /* Minimum 44px touch target */
  background-color: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: #FFFFFF;
  font-size: var(--fs-lg);
  transition: all var(--transition-fast);
}

@media (hover: hover) {
  .social-link:hover {
    background-color: var(--color-primary);
    color: #FFFFFF;
    transform: translateY(-2px);
  }
}

.footer-heading {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: var(--space-4);
  color: #FFFFFF;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--fs-sm);
  display: inline-block;
  min-height: 24px;
  transition: color var(--transition-fast);
}

@media (hover: hover) {
  .footer-links a:hover {
    color: var(--color-primary-light);
  }
}

.contact-info {
  font-style: normal;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  font-size: var(--fs-sm);
}

.contact-info p {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.contact-info i {
  color: var(--color-primary-light);
  font-size: 1rem;
  margin-top: 4px;
  flex-shrink: 0;
}

.contact-info a {
  color: rgba(255, 255, 255, 0.72);
}

.footer-bottom {
  padding-top: var(--space-8);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.copyright {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   11. TOAST NOTIFICATIONS
   ========================================================================== */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  animation: slideToastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: calc(100vw - 2rem);
}

@keyframes slideToastIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.toast-content {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px var(--color-shadow-strong);
  border-left: 4px solid var(--color-success);
  min-width: 280px;
}

.toast.error .toast-content {
  border-left-color: var(--color-error);
}

.toast.error .toast-icon.success {
  display: none;
}

.toast:not(.error) .toast-icon.error {
  display: none;
}

.toast-icon.success {
  color: var(--color-success);
  font-size: 1.25rem;
}

.toast-icon.error {
  color: var(--color-error);
  font-size: 1.25rem;
}

.toast-message {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--color-text-primary);
}

/* Mobile Toast adjustments */
@media (max-width: 600px) {
  .toast {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
    max-width: none;
  }
  .toast-content {
    min-width: 0;
    width: 100%;
  }
}

/* ==========================================================================
   12. ULTRA-WIDE SCREENS (≥ 1920px & ≥ 2560px)
   ========================================================================== */
@media (min-width: 1920px) {
  :root {
    --container-max: 1400px;
  }
}

/* ==========================================================================
   13. PRINT STYLES
   ========================================================================== */
@media print {
  .navbar,
  .hero-buttons,
  .scroll-indicator,
  .form-actions,
  .footer .social-links,
  .toast {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding-top: 0;
  }

  .hero-video-wrapper,
  .hero-overlay {
    display: none;
  }

  body {
    font-size: 11pt;
    line-height: 1.4;
    color: #000000;
  }
}

/* ==========================================================================
   14. DUPLICATE REGISTRATION POPUP MODAL
   ========================================================================== */
.custom-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.custom-modal[hidden] {
  display: none !important;
}

.custom-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modalFadeIn 0.25s ease-out;
}

.custom-modal-card {
  position: relative;
  z-index: 2;
  background-color: var(--color-surface, #ffffff);
  border-radius: var(--radius-lg, 16px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.3);
  max-width: 460px;
  width: 100%;
  padding: 2rem;
  text-align: center;
  border: 1px solid rgba(226, 232, 240, 0.8);
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.custom-modal-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.custom-modal-icon.warning {
  background-color: #FEF3C7;
  color: #D97706;
  border: 4px solid #FDE68A;
}

.custom-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1E293B;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.custom-modal-desc {
  font-size: 0.925rem;
  color: #64748B;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.custom-modal-desc strong {
  color: #0F172A;
  font-weight: 700;
}

.custom-modal-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.custom-modal-actions .btn {
  min-width: 140px;
}