/* ============================================================
 * Dentalead — Polish layer v4
 * ------------------------------------------------------------
 * Capa ADITIVA de refinamiento. Carga DESPUÉS de main.css.
 * Objetivo: acabado más elegante y sobrio SIN tocar la
 * composición ni romper el layout. 100% reversible.
 *
 * v5: + tipografía editorial (text-wrap balance), componentes
 * de conversión (comparativa, garantía, CTA sticky móvil,
 * cinta de confianza) con soporte light-mode completo.
 * v4: + textura de grano sutil (premium), borde de luz glass
 * unificado en cards y acabado glass en inputs.
 * v3: cursor nativo total (sin anillo), sin acento serif.
 * ============================================================ */

:root {
  --ease-premium: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── 1. Nitidez tipográfica (retina / Apple-like) ─── */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Tracking editorial: titulares grandes más compactos = más elegantes.
   Solo letter-spacing → no afecta a tamaños ni a saltos de línea. */
.hero-h1,
.section-h1,
.lp-hero-left h1,
.blog-header h1,
.article-header h1,
.contact-left h2,
#numbers h2 {
  letter-spacing: -0.025em;
}
.article-body h2 { letter-spacing: -0.015em; }

/* ─── 2. Cursor: 100% NATIVO (se quita el cursor custom por completo) ─── */
@media (hover: hover) and (pointer: fine) {
  body,
  a, button, [role="button"], label, select, summary,
  .faq-question, .hamburger, .theme-toggle, .lang-btn {
    cursor: auto !important;
  }
  a, button, [role="button"], summary,
  .faq-question, .hamburger, .theme-toggle, .lang-btn,
  label[for], .lgf-submit {
    cursor: pointer !important;
  }
  input, textarea, select { cursor: auto !important; }
  /* Elimina los elementos del cursor custom */
  #cursor-dot, #cursor-ring { display: none !important; }
}

/* ─── 3. Sombras en capas en vez de glows neón (más sobrio) ─── */
.btn-primary,
.btn-green {
  box-shadow: 0 6px 20px rgba(15,209,122,0.24), 0 2px 6px rgba(0,0,0,0.28);
}
.btn-primary:hover,
.btn-green:hover {
  box-shadow: 0 12px 32px rgba(15,209,122,0.34), 0 4px 12px rgba(0,0,0,0.32);
}
.testimonial-card:hover,
.step-card:hover {
  box-shadow: 0 24px 60px rgba(0,0,0,0.40), 0 2px 8px rgba(0,0,0,0.22);
}

/* ─── 4. Micro-interacciones más fluidas (mismo look, mejor tacto) ─── */
.btn-primary,
.btn-glass,
.btn-green,
.btn-outline,
.btn-nav-cta {
  transition: transform 0.35s var(--ease-premium),
              box-shadow 0.35s var(--ease-premium),
              background 0.3s var(--ease-soft),
              border-color 0.3s var(--ease-soft);
}
.btn-primary .arrow { transition: transform 0.35s var(--ease-premium); }

/* Sheen sutil que recorre el CTA principal al pasar el cursor */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary > * { position: relative; z-index: 1; }
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 80%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-18deg);
  transition: left 0.7s var(--ease-premium);
  pointer-events: none;
  z-index: 0;
}
.btn-primary:hover::after { left: 130%; }

.step-card,
.number-card,
.testimonial-card,
.problem-item,
.blog-card,
.service-card,
.recurso-card,
.faq-item {
  transition: transform 0.4s var(--ease-premium),
              box-shadow 0.4s var(--ease-premium),
              border-color 0.3s var(--ease-soft),
              background 0.3s var(--ease-soft);
}
.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 56px rgba(0,0,0,0.34);
}

/* ─── 5. Selección de texto con color de marca ─── */
::selection { background: rgba(107,175,192,0.30); color: #fff; }
body.light-mode ::selection { background: rgba(22,114,192,0.22); color: #0B1F3A; }

/* ─── 6. Scroll: las anclas no quedan bajo el navbar fijo ─── */
html { scroll-padding-top: 96px; }

/* ─── 7. Scrollbar custom (sutil, acorde al tema) ─── */
@media (hover: hover) and (pointer: fine) {
  * { scrollbar-width: thin; scrollbar-color: rgba(107,175,192,0.45) transparent; }
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgba(107,175,192,0.35);
    border-radius: 50px;
    border: 3px solid transparent;
    background-clip: content-box;
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(120,210,225,0.55); background-clip: content-box; }
  body.light-mode * { scrollbar-color: rgba(22,114,192,0.4) transparent; }
  body.light-mode ::-webkit-scrollbar-thumb { background: rgba(22,114,192,0.3); background-clip: content-box; }
}

/* ─── 8. Foco accesible por teclado (no afecta al ratón) ─── */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.faq-question:focus-visible,
.lang-btn:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--cyan-bright);
  outline-offset: 3px;
  border-radius: 6px;
}
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

/* Enlaces de texto en artículos: subrayado fluido */
.article-body a:not([class]) {
  text-decoration-color: rgba(107,175,192,0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.25s var(--ease-soft);
}
.article-body a:not([class]):hover { text-decoration-color: var(--cyan-bright); }

img { -webkit-user-drag: none; }

/* ─── 10. Textura de grano sutil (premium, tipo Linear/Apple) ─── */
/* Overlay fijo, no interactivo, casi imperceptible: da "cuerpo" y
   profundidad al fondo plano sin oscurecer el contenido. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.light-mode::after { opacity: 0.035; }

/* ─── 11. Borde de luz glass unificado en cards (acabado premium) ─── */
.step-card,
.number-card,
.testimonial-card,
.blog-card,
.service-card,
.recurso-card {
  box-shadow: 0 8px 30px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ─── 12. Inputs con acabado glass sutil ─── */
.lgf-input,
.lgf-textarea {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.lgf-input:focus,
.lgf-textarea:focus {
  box-shadow: 0 0 0 3px rgba(107,175,192,0.18), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ============================================================
 * v5 — Capa "California studio": tipografía editorial,
 * componentes de conversión (comparativa, garantía, CTA sticky)
 * y micro-detalles premium. Aditiva y reversible.
 * ============================================================ */

/* ─── 13. Tipografía editorial: titulares equilibrados ─── */
h1, h2, h3,
.hero-h1, .section-h1, .atlas-h2 {
  text-wrap: balance;
  font-feature-settings: 'ss01' on, 'cv11' on;
}
p, .section-sub, .hero-sub, .faq-answer-inner {
  text-wrap: pretty;
}

/* ─── 14. Cards con borde de luz direccional al hover ─── */
.step-card:hover,
.testimonial-card:hover,
.number-card:hover {
  border-color: rgba(120,210,225,0.35);
}
body.light-mode .step-card:hover,
body.light-mode .testimonial-card:hover,
body.light-mode .number-card:hover {
  border-color: rgba(0,119,200,0.35);
}

/* ─── 15. COMPARATIVA — Dentalead vs agencia genérica ─── */
#compare { background: var(--navy-800); }
.compare-wrap {
  max-width: 880px;
  margin: 48px auto 0;
  border: 1px solid rgba(107,175,192,0.18);
  border-radius: 24px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(107,175,192,0.04) 100%),
    rgba(13,21,41,0.55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 64px -16px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}
.compare-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.compare-row:last-child { border-bottom: none; }
.compare-row.head {
  background: rgba(255,255,255,0.035);
  border-bottom: 1px solid rgba(107,175,192,0.22);
}
.compare-cell {
  padding: 18px 22px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.compare-cell.crit {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}
.compare-cell.dl {
  position: relative;
  background: rgba(107,175,192,0.06);
  border-left: 1px solid rgba(107,175,192,0.18);
  border-right: 1px solid rgba(107,175,192,0.18);
  color: var(--text-primary);
  font-weight: 600;
}
.compare-row.head .compare-cell { padding: 20px 22px; }
.compare-head-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  color: var(--cyan-bright);
  letter-spacing: -0.01em;
}
.compare-head-other {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.compare-ico {
  display: inline-flex;
  flex-shrink: 0;
  margin-right: 8px;
  vertical-align: -3px;
}
.compare-ico.yes { color: var(--accent-green); }
.compare-ico.no { color: var(--red-text); opacity: 0.8; }
.compare-foot {
  margin-top: 28px;
  text-align: center;
}
body.light-mode .compare-wrap {
  background: rgba(255,255,255,0.72);
  border-color: rgba(0,119,200,0.18);
  box-shadow: 0 24px 56px -20px rgba(11,31,58,0.18), inset 0 1px 0 rgba(255,255,255,0.9);
}
body.light-mode .compare-row { border-bottom-color: rgba(11,31,58,0.07); }
body.light-mode .compare-row.head { background: rgba(0,119,200,0.05); border-bottom-color: rgba(0,119,200,0.2); }
body.light-mode .compare-cell.dl {
  background: rgba(0,119,200,0.06);
  border-left-color: rgba(0,119,200,0.16);
  border-right-color: rgba(0,119,200,0.16);
}
body.light-mode .compare-head-brand { color: #0077C8; }
@media (max-width: 720px) {
  .compare-row { grid-template-columns: 1fr 1fr 1fr; }
  .compare-cell { padding: 13px 12px; font-size: 12px; }
  .compare-cell.crit { font-size: 11.5px; }
  .compare-row.head .compare-cell { padding: 14px 12px; }
  .compare-head-brand { font-size: 12.5px; }
  .compare-head-other { font-size: 10.5px; }
}

/* ─── 16. GARANTÍA / RIESGO CERO ─── */
#guarantee { background: var(--navy-900); }
.guarantee-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-top: 48px;
}
.guarantee-card {
  position: relative;
  padding: 32px 28px;
  border-radius: 22px;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.04) 0%, rgba(107,175,192,0.05) 100%),
    rgba(13,21,41,0.6);
  border: 1px solid rgba(107,175,192,0.16);
  box-shadow: 0 12px 36px -10px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.07);
  transition: transform 0.4s var(--ease-premium), box-shadow 0.4s var(--ease-premium), border-color 0.3s var(--ease-soft);
}
.guarantee-card:hover {
  transform: translateY(-5px);
  border-color: rgba(120,210,225,0.4);
  box-shadow: 0 28px 64px -14px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}
.guarantee-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin-bottom: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(107,175,192,0.18), rgba(22,114,192,0.18));
  border: 1px solid rgba(107,175,192,0.3);
  color: var(--cyan-bright);
}
.guarantee-card h3 {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.guarantee-card p {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.guarantee-cta { margin-top: 44px; text-align: center; }
body.light-mode .guarantee-card {
  background: rgba(255,255,255,0.78);
  border-color: rgba(0,119,200,0.16);
  box-shadow: 0 12px 32px -12px rgba(11,31,58,0.16), inset 0 1px 0 rgba(255,255,255,0.9);
}
body.light-mode .guarantee-icon {
  background: linear-gradient(135deg, rgba(0,119,200,0.1), rgba(0,95,168,0.12));
  border-color: rgba(0,119,200,0.25);
  color: #0077C8;
}
@media (max-width: 900px) {
  .guarantee-grid { grid-template-columns: 1fr; gap: 16px; }
}

/* ─── 17. CTA STICKY MÓVIL (solo <769px, aparece tras el hero) ─── */
.sticky-cta {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--accent-green), #0BAF65);
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: 0 14px 36px -8px rgba(15,209,122,0.5), 0 4px 14px rgba(0,0,0,0.35);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.45s var(--ease-premium), opacity 0.35s var(--ease-soft);
  pointer-events: none;
}
.sticky-cta.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
@media (max-width: 768px) {
  .sticky-cta { display: flex; }
  /* El popup de prueba social no debe tapar la CTA sticky */
  body:has(.sticky-cta) #sp-popup {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

/* ─── 18. Cinta de confianza bajo el hero ─── */
.trust-strip {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 28px;
  padding: 18px 5%;
  background: rgba(5,10,20,0.55);
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.trust-strip svg { color: var(--cyan-primary); flex-shrink: 0; }
body.light-mode .trust-strip {
  background: rgba(255,255,255,0.6);
  border-color: rgba(11,31,58,0.06);
}

/* ─── 9. prefers-reduced-motion: respeto total (accesibilidad) ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .btn-primary::after { display: none !important; }
  #cursor-dot, #cursor-ring { display: none !important; }
}
