/* Página comercial de Odontia (odontia.com.co, raíz).
   HTML/CSS puro, sin framework. Misma identidad del app: teal #0d9488
   sobre grises slate, tipografía del sistema. */

:root {
  --teal: #0d9488;      /* acentos, iconos, detalles */
  --teal-deep: #0f766e; /* botones sólidos (mejor contraste con blanco) */
  --teal-dark: #115e59; /* hover de botones */
  --ink: #0f172a;       /* títulos */
  --text: #334155;      /* texto corrido */
  --muted: #64748b;     /* notas */
  --bg: #ffffff;
  --bg-soft: #f0fdfa;   /* teal muy claro para franjas */
  --bg-slate: #f8fafc;  /* gris muy claro para franjas */
  --border: #e2e8f0;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.1);
  /* Escala única de espaciado: todas las franjas respiran igual y la página
     queda más compacta (los clamp escalan solos en pantallas chicas). */
  --section-pad: clamp(52px, 8vw, 76px);
  --hero-pad: clamp(56px, 9vw, 84px);
  --title-gap: clamp(28px, 5vw, 44px);
  --row-gap: clamp(40px, 6vw, 56px);
  --font:
    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  /* El encabezado pegajoso no debe tapar el inicio de cada sección. */
  scroll-padding-top: 84px;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.2;
  font-weight: 700;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.btn:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.45);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--teal-deep);
  color: #fff;
}

.btn-primary:hover {
  background: var(--teal-dark);
}

.btn-outline {
  border: 1.5px solid var(--teal-deep);
  color: var(--teal-deep);
  background: transparent;
}

.btn-outline:hover {
  background: var(--bg-soft);
}

.btn-ghost {
  color: var(--teal-deep);
  border: 1.5px solid var(--border);
  padding: 9px 18px;
}

.btn-ghost:hover {
  border-color: var(--teal-deep);
  background: var(--bg-soft);
}

/* Botones sobre la franja teal del cierre. */
.btn-light {
  background: #fff;
  color: var(--teal-dark);
}

.btn-light:hover {
  background: #e6fffa;
}

.btn-outline-light {
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Encabezado ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

.header-logo img {
  width: 150px;
  height: auto;
}

.header-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.header-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 7px 14px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.header-nav a:hover {
  color: var(--teal-deep);
  background: var(--bg-soft);
}

/* Sección que se está viendo: su nombre queda resaltado en el encabezado. */
.header-nav a.is-active {
  color: var(--teal-deep);
  background: var(--bg-soft);
  font-weight: 600;
}

/* ---------- Hero ---------- */

.hero {
  background:
    radial-gradient(60% 80% at 85% 10%, rgba(13, 148, 136, 0.1), transparent),
    var(--bg-slate);
  padding: var(--hero-pad) 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(28px, 4vw, 48px);
  align-items: center;
}

.eyebrow {
  color: var(--teal-deep);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin-bottom: 18px;
}

.lead {
  font-size: 1.15rem;
  margin-bottom: 28px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-visual {
  min-width: 0;
}

/* ---------- Marco de navegador para las capturas ---------- */

.browser-frame {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.browser-bar {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}

.browser-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.browser-bar span:first-child {
  background: #fca5a5;
}

.browser-bar span:nth-child(2) {
  background: #fcd34d;
}

.browser-bar span:nth-child(3) {
  background: #86efac;
}

/* ---------- Funcionalidades (zigzag) ---------- */

.features {
  padding: var(--section-pad) 0;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-align: center;
  margin-bottom: var(--title-gap);
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.feature-row {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(28px, 4vw, 48px);
  align-items: center;
}

/* Separación pareja entre filas del zigzag (la primera va pegada al título,
   que ya trae su propio aire). */
.feature-row + .feature-row {
  margin-top: var(--row-gap);
}

.feature-row.row-flip .feature-copy {
  order: 2;
}

.feature-row.row-flip .feature-visual {
  order: 1;
}

.feature-copy h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.feature-copy p {
  font-size: 1.05rem;
}

.feature-visual {
  min-width: 0;
}

/* ---------- Maqueta de chat (confirmación por WhatsApp) ---------- */

.chat-mockup {
  background: #e7f6ef;
  border: 1px solid #d1e9dd;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 460px;
  margin: 0 auto;
}

.chat-bubble {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 85%;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.chat-bubble strong {
  display: block;
  color: var(--teal-dark);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.chat-in {
  background: #fff;
  align-self: flex-start;
  border-top-left-radius: 4px;
}

.chat-out {
  background: #d9fdd3;
  align-self: flex-end;
  border-top-right-radius: 4px;
  font-weight: 600;
}

.chat-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chat-actions span {
  flex: 1;
  text-align: center;
  color: #0284c7;
  font-weight: 600;
  font-size: 0.9rem;
  border-top: 1px solid #e2e8f0;
  padding-top: 8px;
}

/* ---------- Tarjetas de mensajes automáticos ---------- */

.auto-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 460px;
  margin: 0 auto;
}

.auto-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  padding: 14px 18px;
}

.auto-when {
  display: block;
  color: var(--teal-deep);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.auto-card strong {
  color: var(--ink);
}

.auto-card p {
  font-size: 0.92rem;
  color: var(--muted);
}

/* ---------- Cómo funciona ---------- */

.steps {
  background: var(--bg-soft);
  padding: var(--section-pad) 0;
}

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

.step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.step:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--teal-deep);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 14px;
}

.step h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.step p {
  font-size: 0.98rem;
}

/* ---------- Planes ---------- */

.plans {
  padding: var(--section-pad) 0;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: start;
}

.plan {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.plan:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.plan-featured {
  border: 2px solid var(--teal);
  box-shadow: var(--shadow);
  position: relative;
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal-deep);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan h3 {
  font-size: 1.2rem;
}

.plan-price {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ink);
}

.plan-price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
}

.plan ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.plan li {
  padding-left: 26px;
  position: relative;
  font-size: 0.97rem;
}

.plan li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--teal);
  font-weight: 700;
}

.plan .btn {
  text-align: center;
}

.plans-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 28px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Preguntas frecuentes ---------- */

.faq {
  background: var(--bg-slate);
  padding: var(--section-pad) 0;
}

.faq-inner {
  max-width: 760px;
}

.faq details {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin-top: 14px;
}

.faq details:first-of-type {
  margin-top: 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  position: relative;
  padding-right: 28px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--teal-deep);
  font-size: 1.3rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}

/* El + gira y se vuelve × al abrir (así el cambio se puede animar). */
.faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.faq details p {
  margin-top: 10px;
}

/* ---------- CTA final ---------- */

.final-cta {
  background: linear-gradient(135deg, var(--teal-deep), var(--teal));
  color: #fff;
  text-align: center;
  padding: var(--section-pad) 0;
}

.final-cta h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 12px;
}

.final-cta p {
  font-size: 1.1rem;
  opacity: 0.92;
  margin-bottom: 28px;
}

.cta-center {
  justify-content: center;
}

/* ---------- Pie ---------- */

.site-footer {
  background: var(--ink);
  color: #cbd5e1;
  padding: 44px 0;
}

.footer-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.footer-row img {
  width: 120px;
}

.footer-fine {
  font-size: 0.85rem;
  color: #94a3b8;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-grid,
  .feature-row {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  /* En columna, el texto siempre va antes que la imagen. */
  .feature-row.row-flip .feature-copy {
    order: 1;
  }

  .feature-row.row-flip .feature-visual {
    order: 2;
  }

  .steps-grid,
  .plans-grid {
    grid-template-columns: 1fr;
  }

  .plan-featured {
    order: -1;
  }
}

/* ---------- Animaciones (sutiles; se apagan con reduced-motion) ---------- */

/* Los deslizamientos laterales no deben crear scroll horizontal. */
body {
  overflow-x: hidden;
  overflow-x: clip;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise-scale {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Entrada del hero al cargar, escalonada (solo CSS). */
.hero-copy > * {
  animation: rise 0.55s ease-out backwards;
}

.hero-copy > :nth-child(2) {
  animation-delay: 0.08s;
}

.hero-copy > :nth-child(3) {
  animation-delay: 0.16s;
}

.hero-copy > :nth-child(4) {
  animation-delay: 0.24s;
}

.hero-copy > :nth-child(5) {
  animation-delay: 0.32s;
}

.hero-visual {
  animation: rise-scale 0.6s ease-out 0.2s backwards;
}

/* Aparición al hacer scroll. Los estados ocultos SOLO existen cuando el
   script marcó <html class="anim">: sin JavaScript todo queda visible. */
html.anim .reveal,
html.anim .reveal-left,
html.anim .reveal-right {
  opacity: 0;
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
  transition-delay: var(--reveal-delay, 0s);
}

html.anim .reveal {
  transform: translateY(18px);
}

html.anim .reveal-left {
  transform: translateX(-24px);
}

html.anim .reveal-right {
  transform: translateX(24px);
}

html.anim .is-visible {
  opacity: 1;
  transform: none;
}

/* Lift sutil de las capturas, solo con mouse (no en táctiles). */
@media (hover: hover) {
  .browser-frame {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }

  .browser-frame:hover {
    transform: translateY(-3px);
  }
}

/* Sin animaciones para quien pidió menos movimiento en su sistema. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-copy > *,
  .hero-visual {
    animation: none;
  }

  html.anim .reveal,
  html.anim .reveal-left,
  html.anim .reveal-right {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn:hover,
  .step:hover,
  .plan:hover,
  .browser-frame:hover {
    transform: none;
  }
}

/* ---------- Responsive fino (celulares) ---------- */

@media (max-width: 900px) {
  /* La navegación no se oculta: pasa a una segunda fila deslizable. */
  .header-row {
    height: auto;
    flex-wrap: wrap;
    padding-top: 10px;
    padding-bottom: 10px;
    gap: 10px 16px;
  }

  .header-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    white-space: nowrap;
    gap: 8px;
    padding: 2px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .header-nav::-webkit-scrollbar {
    display: none;
  }

  /* En celular cada sección se ve como una ficha tocable. */
  .header-nav a {
    flex: 0 0 auto;
    background: var(--bg-slate);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.9rem;
    padding: 8px 15px;
  }

  /* La ficha de la sección actual queda resaltada con el teal de la marca. */
  .header-nav a.is-active {
    background: var(--bg-soft);
    border-color: var(--teal);
    color: var(--teal-deep);
  }

  /* El botón de Ingresar queda pegado al borde derecho de la primera fila. */
  #btn-sesion {
    margin-left: auto;
    white-space: nowrap;
  }

  /* El encabezado ahora ocupa dos filas: los saltos por ancla no deben
     esconder el título de la sección debajo de él. */
  html {
    scroll-padding-top: 118px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 18px;
  }

  /* Encabezado más compacto: el logo y el botón de sesión caben juntos
     incluso con el texto largo «Ir a mi consultorio». */
  .header-logo img {
    width: 118px;
  }

  #btn-sesion {
    padding: 7px 12px;
    font-size: 0.88rem;
  }

  /* Botones de acción a todo el ancho: cómodos con una sola mano. */
  .cta-row .btn {
    flex: 1 1 100%;
    text-align: center;
  }

  .chat-mockup {
    padding: 20px 16px;
  }

  .plan {
    padding: 24px 20px;
  }
}
