/* ==========================================================================
   Sonrisa Imperial — Landing page
   Paleta: navy profundo + verde azulado (accent) + dorado (detalle)
   ========================================================================== */

:root {
  --ink:        #0E1C2B;
  --ink-soft:   #405264;
  --muted:      #6B7A89;
  --line:       #E4E8EC;
  --bg:         #FFFFFF;
  --bg-alt:     #F7F9FA;
  --accent:     #0F766E;
  --accent-dk:  #0B554F;
  --gold:       #C9A227;

  --radius:     14px;
  --radius-lg:  22px;
  --shadow-sm:  0 1px 2px rgba(14, 28, 43, .05);
  --shadow-md:  0 12px 32px rgba(14, 28, 43, .08);
  --shadow-lg:  0 24px 60px rgba(14, 28, 43, .12);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;

  --container: 1140px;
  --header-h: 74px;
}

*, *::before, *::after { box-sizing: border-box; }

/* La identidad de la clínica es deliberadamente clara: fijamos el esquema
   para que los controles del formulario no se oscurezcan en modo oscuro. */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
  background: var(--bg);
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2rem, 4.2vw, 2.95rem); }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.13rem; font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
h4 { font-size: .93rem; font-family: var(--sans); font-weight: 600; letter-spacing: .02em; }

p { margin: 0 0 1rem; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 24px;
}

.eyebrow {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9rem;
}
.eyebrow.light { color: var(--gold); }

.muted { color: var(--muted); }
.muted-light { color: rgba(255, 255, 255, .72); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  font: inherit;
  font-size: .95rem;
  font-weight: 600;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(15, 118, 110, .22); }
.btn-primary:hover { background: var(--accent-dk); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-1px); }

.btn-sm  { padding: 10px 20px; font-size: .88rem; }
.btn-lg  { padding: 16px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; margin-right: auto; }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--ink);
  color: #fff;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--serif); font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; }
.brand-text small { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; gap: 30px; }
.nav a {
  font-size: .93rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  position: relative;
  padding: 4px 0;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1.5px;
  background: var(--accent);
  transition: width .22s ease;
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 1.5px; background: var(--ink); margin-inline: auto; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Oculto por defecto: solo aparece cuando el botón quita el atributo [hidden].
   Una regla de clase gana sobre el [hidden] del navegador, así que el estado
   cerrado se declara aquí de forma explícita. */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 22px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.mobile-nav:not([hidden]) { display: flex; }
.mobile-nav a { padding: 12px 0; text-decoration: none; font-weight: 500; color: var(--ink-soft); }
.mobile-nav .btn { margin-top: 10px; color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(38px, 5vw, 64px) 0 clamp(34px, 4vw, 54px);
  background:
    radial-gradient(900px 420px at 88% -8%, rgba(15, 118, 110, .09), transparent 62%),
    radial-gradient(700px 380px at 4% 6%, rgba(201, 162, 39, .07), transparent 60%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(32px, 5vw, 68px);
  align-items: center;
}

.hero h1 { margin-bottom: .8rem; }
.hero h1 em { font-style: italic; color: var(--accent); }

.lead { font-size: 1.05rem; color: var(--ink-soft); max-width: 46ch; margin-bottom: 1.6rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 1.9rem; }

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  list-style: none;
  margin: 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  font-size: .86rem;
  color: var(--muted);
}
.hero-trust strong { display: block; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; color: var(--ink); }

.card-quiet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-lg);
}
.card-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin-bottom: 1rem; }

.steps { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; align-items: flex-start; gap: 13px; font-size: .95rem; color: var(--ink-soft); }
.steps span {
  flex: none;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(15, 118, 110, .1);
  color: var(--accent);
  font-size: .78rem;
  font-weight: 600;
}
.card-note { font-size: .84rem; color: var(--muted); padding-bottom: .6rem; }

/* ---------- Marquee de confianza ---------- */
.marquee { border-block: 1px solid var(--line); background: var(--bg-alt); }
.marquee-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 22px;
  padding: 16px 24px;
  font-size: .82rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.marquee-inner i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

/* ---------- Secciones ---------- */
.section { padding: clamp(64px, 8vw, 104px) 0; }
.section-alt { background: var(--bg-alt); }

.section-head { max-width: 34ch; margin-bottom: clamp(34px, 4vw, 52px); }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

/* ---------- Servicios ---------- */
.service {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.service:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.service p { margin: 0; font-size: .93rem; color: var(--muted); }

.service-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(15, 118, 110, .09);
  color: var(--accent);
  margin-bottom: 18px;
}
.service-icon svg { width: 22px; height: 22px; }

/* ---------- La clínica ---------- */
.clinic-intro {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}
.clinic-intro .section-head { margin-bottom: 0; }
.clinic-text p { font-size: .98rem; color: var(--ink-soft); }
.clinic-text p:last-child { margin-bottom: 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: clamp(32px, 4vw, 52px);
}
.shot { margin: 0; }
.shot svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
}
.shot figcaption {
  margin-top: 11px;
  font-size: .84rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.shot figcaption::before { content: ""; width: 14px; height: 1px; background: var(--gold); }

.facts-row {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: clamp(32px, 4vw, 48px) 0 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--line);
}
.facts-row strong { display: block; font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin-bottom: .2rem; }
.facts-row span { font-size: .84rem; color: var(--muted); }

/* ---------- Equipo ---------- */
.team-wrap { margin-top: clamp(48px, 6vw, 72px); }
.team-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 600;
  padding-top: 34px;
  border-top: 1px solid var(--line);
  margin-bottom: 26px;
}
.member {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.member h4 { font-size: 1.02rem; margin-bottom: .2rem; letter-spacing: 0; }
.member p { font-size: .9rem; color: var(--muted); margin: 0; }
.member .role { color: var(--accent); font-weight: 500; font-size: .85rem; margin-bottom: .7rem; }
.avatar {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-family: var(--serif);
  font-size: .95rem;
  letter-spacing: .04em;
}

/* ---------- Preguntas frecuentes ---------- */
.faq-wrap { max-width: 820px; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 44px 20px 0;
  position: relative;
  font-weight: 600;
  font-size: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  position: absolute;
  right: 6px; top: 50%;
  width: 11px; height: 11px;
  margin-top: -7px;
  border-right: 1.8px solid var(--accent);
  border-bottom: 1.8px solid var(--accent);
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.faq summary:hover { color: var(--accent); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.faq p { margin: 0 0 20px; padding-right: 44px; font-size: .95rem; color: var(--muted); }
.faq a { color: var(--accent); }

/* ---------- Nosotros ---------- */
.checklist { list-style: none; margin: 1.6rem 0 0; padding: 0; display: grid; gap: 13px; }
.checklist li {
  position: relative;
  padding-left: 32px;
  font-size: .96rem;
  color: var(--ink-soft);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: .42em;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 13 4 4L19 7'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.stat { background: #fff; padding: 30px 26px; }
.stat strong { display: block; font-family: var(--serif); font-size: 1.9rem; font-weight: 600; line-height: 1; margin-bottom: .4rem; }
.stat span { font-size: .84rem; color: var(--muted); }

/* ---------- Opiniones ---------- */
.quote {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stars { color: var(--gold); letter-spacing: .14em; font-size: .88rem; }
.quote blockquote { margin: 0; font-size: .97rem; color: var(--ink-soft); }
.quote figcaption { margin-top: auto; font-size: .86rem; font-weight: 600; }
.quote figcaption span { display: block; font-weight: 400; color: var(--muted); }

/* ---------- Agendar ---------- */
.booking {
  background:
    radial-gradient(700px 420px at 82% 12%, rgba(15, 118, 110, .28), transparent 60%),
    var(--ink);
  color: #fff;
}
.booking h2 { color: #fff; }
.split-form { align-items: start; }

.booking-facts { list-style: none; margin: 2.2rem 0 0; padding: 0; display: grid; gap: 18px; }
.booking-facts li { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .14); }
.fact-label { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .5); padding-top: 3px; }
.fact-value { font-size: .95rem; color: rgba(255, 255, 255, .9); }
.fact-value a { text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .3); }

.form-card {
  background: #fff;
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 34px);
  box-shadow: var(--shadow-lg);
}

.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink);
}
.optional { font-weight: 400; color: var(--muted); }

input[type="text"], input[type="tel"], input[type="email"], input[type="date"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
textarea { resize: vertical; min-height: 84px; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7A89' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 17px;
  padding-right: 38px;
}

input::placeholder, textarea::placeholder { color: #A7B2BC; }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .13);
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea { border-color: #C2453C; }

.error { display: none; margin: 6px 0 0; font-size: .8rem; color: #C2453C; }
.field.has-error .error, .error.is-visible { display: block; }

.consent { display: flex; align-items: flex-start; gap: 10px; margin: 6px 0 4px; font-size: .84rem; font-weight: 400; color: var(--muted); line-height: 1.5; }
.consent input { flex: none; width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); }
.consent a { color: var(--accent); }

.form-foot { margin: 12px 0 0; text-align: center; font-size: .8rem; color: var(--muted); }

.form-success { text-align: center; padding: 12px 0 4px; }
.success-mark {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(15, 118, 110, .1);
  color: var(--accent);
  font-size: 1.5rem;
}
.form-success h3 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; }
.form-success p { font-size: .93rem; color: var(--muted); margin-bottom: 1.4rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding-top: 56px; font-size: .9rem; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 40px; }
.footer-brand strong { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; display: block; margin-bottom: .6rem; }
.footer-brand p, .footer-col p { color: var(--muted); margin: 0; }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h4 { margin: 0 0 4px; text-transform: uppercase; font-size: .74rem; letter-spacing: .12em; color: var(--muted); }
.footer-col a { text-decoration: none; color: var(--ink-soft); width: fit-content; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding-block: 18px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
}
.footer-bottom p { margin: 0; }

/* ---------- WhatsApp flotante ---------- */
.whatsapp-float {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 90;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  box-shadow: 0 10px 26px rgba(37, 211, 102, .35);
  transition: transform .18s ease;
}
.whatsapp-float:hover { transform: scale(1.06); }
.whatsapp-float svg { width: 27px; height: 27px; }

/* ---------- Animación de entrada ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
/* En escritorio el menú desplegable nunca se muestra, aunque haya quedado
   abierto antes de agrandar la ventana. */
@media (min-width: 941px) {
  .mobile-nav, .mobile-nav:not([hidden]) { display: none; }
}

@media (max-width: 940px) {
  .hero-inner, .split, .clinic-intro { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .gallery { gap: 14px; }
  .facts-row { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .nav, .header-cta { display: none; }
  .nav-toggle { display: flex; }
  .hero-card { max-width: 460px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .grid-3, .field-row, .stats, .gallery { grid-template-columns: 1fr; }
  .facts-row { grid-template-columns: 1fr 1fr; gap: 16px; }
  .faq summary { padding-right: 36px; font-size: .96rem; }
  .faq p { padding-right: 0; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .booking-facts li { grid-template-columns: 1fr; gap: 4px; }
  .whatsapp-float { right: 14px; bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
