/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:        #f6faf9;
  --bg-2:      #eef7f5;
  --paper:     #ffffff;
  --glass:     rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);

  --ink:       #16323a;
  --ink-soft:  #3d5960;
  --ink-mute:  #66808a;

  --accent:    #2f9e8f;
  --accent-2:  #4a90c4;
  --accent-soft: #d6efe9;

  --mesh-1: #bfe3f0;
  --mesh-2: #c9ecdd;
  --mesh-3: #eaf6fb;

  --line:      rgba(22, 50, 58, 0.12);

  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Manrope", var(--sans);

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --radius: 20px;
  --radius-sm: 12px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
  overflow-x: clip;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  text-wrap: balance;
  line-height: 1.08;
  letter-spacing: -0.01em;
  font-weight: 800;
}
ul { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* =============================================================
   3. Utilities
   ============================================================= */
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .7rem 1.1rem; background: var(--ink); color: #fff;
  z-index: 9999; border-radius: 8px; font-weight: 600;
  transition: top .25s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 1.25rem;
}
.container-narrow { max-width: 780px; }

.eyebrow {
  font-family: var(--display);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .8rem;
}
.eyebrow-center { text-align: center; }

.section { padding-block: clamp(3.5rem, 7vw, 6.5rem); }
.section-alt { background: var(--bg-2); }
.section-title {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  max-width: 42ch;
  margin-bottom: 1rem;
}
#servicios .section-title,
#faq .section-title,
#opiniones .section-title {
  margin-inline: auto;
  text-align: center;
  max-width: 32ch;
}

/* Glass card (signature effect) */
.glass-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: 0 20px 45px -20px rgba(22, 50, 58, 0.18);
}
@supports (backdrop-filter: blur(16px)) {
  .glass-card {
    background: var(--glass);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
  }
}

/* =============================================================
   4. Buttons
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .85rem 1.5rem;
  border-radius: 999px;
  font-family: var(--display);
  font-weight: 700;
  font-size: .95rem;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(22, 50, 58, 0.08);
  transition: transform .4s var(--ease-soft), box-shadow .4s var(--ease-soft), background .3s var(--ease-out), color .3s var(--ease-out);
}
.btn:hover { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); transition-duration: .12s; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { box-shadow: 0 22px 40px -12px rgba(47, 158, 143, 0.45); }

.btn-ghost {
  background: rgba(255,255,255,0.6);
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: #fff; }

.btn-on-band {
  background: #fff;
  color: var(--accent);
}
.btn-on-band:hover { box-shadow: 0 22px 40px -12px rgba(0,0,0,0.25); }

.btn-lg { padding: 1rem 1.9rem; font-size: 1rem; }
.btn-sm { padding: .6rem 1.15rem; font-size: .85rem; }
.icon-wa { width: 20px; height: 20px; flex: none; }

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: fixed; top: 0; inset-inline: 0; z-index: 200;
  transition: background-color .4s var(--ease-out), box-shadow .4s var(--ease-out), backdrop-filter .4s var(--ease-out);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
}
.nav.is-scrolled {
  background: rgba(246, 250, 249, 0.85);
  box-shadow: 0 1px 0 var(--line);
}
@supports (backdrop-filter: blur(12px)) {
  .nav.is-scrolled { backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%); }
}
.nav-brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
}
.nav-brand span { color: var(--accent); }
.nav-links { display: none; align-items: center; gap: 1.8rem; }
.nav-link {
  position: relative;
  font-weight: 600; font-size: .92rem; color: var(--ink-soft);
  padding-block: .25rem;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .4s var(--ease-out);
}
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }
.nav-cta { display: none; }
.nav-burger {
  display: grid; gap: 4px; padding: .5rem; z-index: 210;
}
.nav-burger span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease-out), opacity .3s; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: 0; z-index: 190;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6rem;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .55s var(--ease-soft);
}
.nav-mobile[data-open="true"] { clip-path: inset(0); }
.nav-mobile-link { font-family: var(--display); font-weight: 700; font-size: 1.4rem; color: var(--ink); }

@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-cta { display: inline-flex; }
  .nav-burger { display: none; }
}

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  padding-top: clamp(7rem, 14vw, 9rem);
  padding-bottom: clamp(3rem, 8vw, 5rem);
  overflow: clip;
  isolation: isolate;
}
.hero-mesh {
  position: absolute; inset: -10%; z-index: -1;
  background:
    radial-gradient(50% 45% at 15% 20%, var(--mesh-1) 0%, transparent 60%),
    radial-gradient(55% 50% at 85% 15%, var(--mesh-2) 0%, transparent 60%),
    radial-gradient(60% 60% at 50% 100%, var(--mesh-3) 0%, transparent 65%),
    var(--bg);
  filter: blur(50px) saturate(140%);
  animation: meshDrift 26s ease-in-out infinite;
}
@keyframes meshDrift {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50%      { transform: scale(1.15) rotate(6deg); }
}

.hero-grid {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
.hero-content { max-width: 640px; }
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  max-width: 16ch;
  margin-bottom: 1.1rem;
}
.hero-title em { color: var(--accent); font-style: normal; }
.hero-sub { font-size: 1.08rem; max-width: 48ch; margin-bottom: 1.8rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-bottom: 1.4rem; }
.hero-trust { font-size: .85rem; color: var(--ink-mute); }

.hero-visual { position: relative; justify-self: center; width: 100%; max-width: 420px; }
.hero-card { overflow: hidden; padding: 0; }
.hero-card img { aspect-ratio: 4 / 5; object-fit: cover; object-position: center 35%; width: 100%; }
.hero-badge {
  position: absolute; left: -1.2rem; bottom: -1.2rem;
  padding: 1rem 1.3rem;
  display: flex; flex-direction: column; gap: .1rem;
  max-width: 190px;
}
.hero-badge strong { font-family: var(--display); font-size: 1.3rem; color: var(--accent); }
.hero-badge span { font-size: .8rem; color: var(--ink-mute); }

@media (min-width: 960px) {
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
  .hero-visual { justify-self: end; }
}

/* =============================================================
   7. Services
   ============================================================= */
.services-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}
.card {
  padding: 2rem 1.7rem;
  transition: transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft);
}
.card:hover { transform: translateY(-6px); box-shadow: 0 30px 55px -22px rgba(22, 50, 58, 0.25); }
.card-icon {
  display: grid; place-items: center;
  width: 54px; height: 54px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.card-icon svg { width: 28px; height: 28px; }
.card h3 { font-size: 1.15rem; margin-bottom: .5rem; }
.card p { font-size: .95rem; color: var(--ink-mute); }

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

/* =============================================================
   8. Clinic / about
   ============================================================= */
.clinic-grid { display: grid; gap: 2.5rem; align-items: center; }
.clinic-copy { margin-bottom: 1.3rem; max-width: 55ch; }
.clinic-list li {
  position: relative; padding-left: 1.6rem; margin-bottom: .6rem; color: var(--ink-soft);
}
.clinic-list li::before {
  content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700;
}
.clinic-gallery {
  display: grid; grid-template-columns: 1fr 1fr; gap: .9rem;
}
.clinic-gallery img {
  width: 100%; height: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius-sm);
  transition: transform .6s var(--ease-soft);
}
.clinic-gallery img:hover { transform: scale(1.04); }

@media (min-width: 960px) { .clinic-grid { grid-template-columns: 1fr 1fr; } }

/* =============================================================
   9. Testimonials
   ============================================================= */
.testi-note {
  text-align: center; font-size: .85rem; color: var(--ink-mute); font-style: italic;
  margin-bottom: 2.2rem; margin-top: -.5rem;
}
.testi-grid { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
.testi-card { display: flex; flex-direction: column; gap: 1rem; }
.testi-quote { font-size: 1rem; color: var(--ink-soft); }
.testi-author { font-size: .85rem; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.testi-tag {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--accent-soft); color: var(--accent); padding: .15rem .5rem; border-radius: 999px;
}

@media (min-width: 720px) { .testi-grid { grid-template-columns: repeat(2, 1fr); } }

/* =============================================================
   10. CTA band
   ============================================================= */
.cta-band {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  padding-block: clamp(3rem, 7vw, 4.5rem);
}
.cta-band-inner { text-align: center; color: #fff; }
.cta-band-inner h2 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: .6rem; }
.cta-band-inner p { color: rgba(255,255,255,0.9); margin-bottom: 1.7rem; font-size: 1.05rem; }

/* =============================================================
   11. FAQ
   ============================================================= */
.faq-list { display: flex; flex-direction: column; gap: .9rem; }
.faq-item {
  background: rgba(255,255,255,0.75);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
}
@supports (backdrop-filter: blur(16px)) {
  .faq-item { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.2rem 1.4rem;
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem; color: var(--accent); flex: none;
  transition: transform .35s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-body { padding: 0 1.4rem 1.3rem; color: var(--ink-mute); font-size: .95rem; }

/* =============================================================
   12. Contact
   ============================================================= */
.contact-grid { display: grid; gap: 2.5rem; }
.contact-list { display: flex; flex-direction: column; gap: 1.3rem; margin-block: 1.6rem; }
.contact-list li { display: flex; gap: 1rem; align-items: flex-start; }
.contact-icon {
  display: grid; place-items: center; flex: none;
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-list strong { display: block; color: var(--ink); margin-bottom: .15rem; }
.contact-list span, .contact-list a { color: var(--ink-mute); font-size: .95rem; }
.contact-list a:hover { color: var(--accent); }

.contact-map { overflow: hidden; padding: 0; min-height: 320px; }
.contact-map iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }

.contact-form {
  padding: 1.8rem;
  margin-top: 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-form-title { font-weight: 600; color: var(--ink); margin-bottom: .2rem; }
.form-row { display: flex; flex-direction: column; gap: .35rem; }
.form-row label { font-size: .85rem; color: var(--ink-mute); }
.form-row input, .form-row textarea {
  font: inherit;
  padding: .7rem .9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-status { font-size: .9rem; min-height: 1.2em; }
.form-status[data-state="ok"] { color: var(--accent); }
.form-status[data-state="error"] { color: #c0392b; }

@media (min-width: 960px) { .contact-grid { grid-template-columns: 1fr 1fr; } }

/* =============================================================
   13. Footer
   ============================================================= */
.footer { background: var(--ink); color: rgba(255,255,255,0.75); padding-block: 3rem; }
.footer-grid { display: grid; gap: 2rem; }
.footer p { margin-bottom: .4rem; font-size: .9rem; }
.footer a:hover { color: #fff; }
.footer-brand { font-family: var(--display); font-weight: 800; color: #fff; font-size: 1.1rem; margin-bottom: .6rem; }
.footer-legal p { font-size: .8rem; color: rgba(255,255,255,0.55); }
.footer-credits a { color: rgba(255,255,255,0.75); text-decoration: underline; }

@media (min-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* =============================================================
   14. WhatsApp floating button
   ============================================================= */
.wa-float {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 300;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25d366; color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 12px 30px -8px rgba(37, 211, 102, 0.6);
  transition: transform .4s var(--ease-soft), box-shadow .4s var(--ease-soft);
}
.wa-float:hover { transform: translateY(-4px) scale(1.05); box-shadow: 0 18px 36px -8px rgba(37, 211, 102, 0.7); }
.wa-float svg { width: 30px; height: 30px; }

/* =============================================================
   15. Reveal on scroll
   ============================================================= */
[data-reveal] {
  opacity: 0; transform: translateY(30px);
  transition: opacity .8s var(--ease-soft), transform .8s var(--ease-soft);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* =============================================================
   16. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .hero-mesh { animation: none; }
}

/* =============================================================
   17. Credits page
   ============================================================= */
.page-credits { padding-top: 6rem; }
.page-credits main { max-width: 780px; margin-inline: auto; padding: 0 1.25rem 4rem; }
.page-credits h1 { margin-bottom: 1rem; }
.credits-back { display: inline-block; margin: 1.5rem 1.25rem 0; font-weight: 600; color: var(--accent); }
.credits-list li { padding: .9rem 0; border-bottom: 1px solid var(--line); font-size: .92rem; color: var(--ink-mute); }
.credits-list a { color: var(--accent); text-decoration: underline; }
