/* DoWell Physio - Refined Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --primary: #0b4f6c;
  --primary-light: #166081;
  --primary-ultra-light: #f0f7f9;
  --accent: #d4af37;
  --accent-soft: #fcf8e8;
  --text-dark: #1e2b37;
  --text-muted: #5a6b77;
  --bg-soft: #f8fafc;
  --border-light: #e2e8f0;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-dark);
}

h1,
h2,
h3,
h4,
.font-heading {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Active nav link */
.nav-links a.active {
  color: var(--primary);
  opacity: 1;
}

.nav-links a {
  position: relative;
  transition: opacity 0.3s ease;
  opacity: 0.8;
}

.nav-links a:hover {
  opacity: 1;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background-color: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
  transform-origin: left;
}

header {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.header-hidden {
  transform: translateY(-100%);
}

#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(to right, var(--accent), var(--primary));
  z-index: 1001;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(11, 79, 108, 0.15);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 99;
  border: none;
  cursor: pointer;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-4px);
  background: var(--primary-light);
  box-shadow: 0 8px 16px rgba(11, 79, 108, 0.2);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 3001;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.menu-toggle span {
  display: block;
  height: 2px;
  width: 18px;
  background-color: var(--primary);
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
  position: absolute;
}

.menu-toggle span:nth-child(1) {
  transform: translateY(-5px);
}

.menu-toggle span:nth-child(2) {
  transform: translateX(0);
}

.menu-toggle span:nth-child(3) {
  transform: translateY(5px);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(0) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(0) rotate(-45deg);
}

body.menu-open {
  overflow: hidden;
}

body.menu-open header {
  z-index: 3000;
}

/* Form refinement */
.input-error {
  border-color: #ef4444 !important;
  background-color: #fef2f2 !important;
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mobile nav */
@media (max-width: 850px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: white;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 15px;
    transition: right 0.5s cubic-bezier(0.8, 0, 0.2, 1);
    z-index: 2000;
    padding: 10% 15%;
  }

  .nav-links.active {
    right: 0;
    display: flex !important;
  }

  .nav-links a {
    font-size: 2rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-align: left;
    padding: 10px 0;
    opacity: 0;
    transform: translateX(30px);
    transition: all 0.4s ease;
  }

  .nav-links.active a {
    opacity: 1;
    transform: translateX(0);
  }

  .nav-links a:nth-child(1) {
    transition-delay: 0.1s;
  }

  .nav-links a:nth-child(2) {
    transition-delay: 0.15s;
  }

  .nav-links a:nth-child(3) {
    transition-delay: 0.2s;
  }

  .nav-links a:nth-child(4) {
    transition-delay: 0.25s;
  }

  .nav-links a:nth-child(5) {
    transition-delay: 0.3s;
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(11, 79, 108, 0.2);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 1500;
  }

  .nav-overlay.active {
    opacity: 1;
    visibility: visible;
  }
}

/* Card & Background Refinements */
.glass-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px rgba(11, 79, 108, 0.04);
}

.img-zoom {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.img-zoom img {
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.img-zoom:hover img {
  transform: scale(1.04);
}

/* Custom Utilities */
.section-refined {
  padding: 5rem 0;
}

@media (max-width: 768px) {
  .section-refined {
    padding: 3.5rem 0;
  }
}

.heading-xl {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1.1;
}

.heading-lg {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
}

/* Subtle Grain Pattern */
.bg-grain {
  position: relative;
}

.bg-grain::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.02;
  pointer-events: none;
  z-index: 1;
}

/* Hero Slider Dot Styling */
.active-dot {
  background-color: white !important;
  width: 24px !important;
  border-radius: 4px !important;
}

#heroSlider {
  will-change: transform;
}