/* ============================================
   Sinergia Centro Quiropráctico — Base CSS
   Design tokens, resets, utilities
   ============================================ */

/* --- CSS Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Design Tokens --- */
:root {
  /* Brand Colors */
  --color-primary: #004481;        /* Azul Cobalto — dark navy */
  --color-secondary: #018abe;      /* Azul Cielo — sky blue */
  --color-tertiary: #6ab9ce;       /* Azul NYPD — light blue */
  --color-white: #ffffff;
  --color-light-bg: #f0f7fb;       /* Very light blue tint */
  --color-dark: #1a1a2e;           /* Dark text */
  --color-whatsapp: #25D366;       /* WhatsApp green */

  /* Neutral Scale */
  --color-gray-50: #f8fafc;
  --color-gray-100: #f1f5f9;
  --color-gray-200: #e2e8f0;
  --color-gray-300: #cbd5e1;
  --color-gray-400: #94a3b8;
  --color-gray-500: #64748b;
  --color-gray-600: #475569;
  --color-gray-700: #334155;
  --color-gray-800: #1e293b;

  /* Typography Scale — fluid with clamp */
  --text-xs: clamp(0.75rem, 0.7rem + 0.15vw, 0.8125rem);       /* 12-13px */
  --text-sm: clamp(0.8125rem, 0.78rem + 0.15vw, 0.875rem);     /* 13-14px */
  --text-base: clamp(0.9375rem, 0.9rem + 0.15vw, 1rem);        /* 15-16px */
  --text-lg: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);       /* 17-19px */
  --text-xl: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);           /* 20-24px */
  --text-2xl: clamp(1.5rem, 1.2rem + 1vw, 2rem);               /* 24-32px */
  --text-3xl: clamp(2rem, 1.5rem + 1.5vw, 2.75rem);            /* 32-44px */
  --text-hero: clamp(2.5rem, 1.8rem + 2.5vw, 4rem);            /* 40-64px */

  /* Spacing */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 900px;
  --container-wide: 1400px;
  --section-padding: clamp(var(--space-16), 8vw, var(--space-32));

  /* Radius */
  --radius-sm: 0.375rem;   /* 6px */
  --radius-md: 0.625rem;   /* 10px */
  --radius-lg: 1rem;       /* 16px */
  --radius-xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 1px 3px rgba(0,68,129,0.06), 0 8px 24px rgba(0,68,129,0.08);
  --shadow-form: 0 4px 24px rgba(0,68,129,0.12), 0 12px 48px rgba(0,68,129,0.08);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms;
  --duration-normal: 350ms;
  --duration-slow: 500ms;

  /* Z-index scale */
  --z-header: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 400;
}

/* --- Base Typography --- */
body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--text-base);
  color: var(--color-dark);
  background-color: var(--color-white);
}

/* --- Utility Classes --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

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

/* Scroll animation base */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

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

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity var(--duration-slow) var(--ease-out),
              transform var(--duration-slow) var(--ease-out);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Staggered children */
.stagger-children > * {
  transition-delay: calc(var(--i, 0) * 80ms);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .reveal-left, .reveal-right {
    opacity: 1;
    transform: none;
  }
}
