/*  NEOMED — LEGAL PAGES (PRO) */

/*  1) VARIABLE  */
:root {
  --c-primary: var(--primary-color, #00cfff);
  /* color de marca */
  --c-accent: var(--accent-color, #ffc107);
  /* subrayados/tiras */
  --c-ink: #0f172a;
  /* títulos */
  --c-body: #334155;
  /* párrafos */
  --c-mute: #64748b;
  /* texto tenue */
  --c-bdr: rgba(2, 6, 23, .08);
  /* bordes suaves */
  --radius: 14px;
  --shadow: 0 10px 24px rgba(2, 6, 23, .06);
}

/* 2) BASE TIPOGRÁFICA */
body {
  font-family: 'Poppins', sans-serif !important;
  line-height: 1.7;
}

/* Utilidad para justificado real */
.text-justify {
  text-align: justify !important;
  hyphens: auto;
}

/* (opcional) utilidades de tamaño extra si las usas en vistas
.fs-7{ font-size:.95rem !important; }
.fs-8{ font-size:.90rem !important; }
.fs-9{ font-size:.875rem !important; }
*/

/*  3) HERO (cabecera de la página legal) */
.legal-hero {
  background: var(--c-primary);
  color: #fff;
  /* padding adaptable: desktop/móvil */
  padding: clamp(1.8rem, 3vw, 3.2rem) 0 clamp(0.9rem, 1.6vw, 1.4rem);
  position: relative;
  overflow: hidden;
}

.legal-hero::after {
  content: "";
  position: absolute;
  inset: -28% -18% auto -18%;
  height: 120%;
  background: linear-gradient(120deg, rgba(255, 255, 255, .18), transparent 40%);
  transform: rotate(-8deg);
  pointer-events: none;
}

.legal-title {
  font-weight: 800;
  letter-spacing: .2px;
  margin: .2rem 0 .35rem;
}

.legal-subtitle {
  font-size: 1.06rem;
  opacity: .96;
  max-width: 68ch;
}

.legal-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .6rem;
  opacity: .95;
}

.legal-meta .badge {
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(255, 255, 255, .25);
  font-weight: 600;
}

/* 4) LAYOUT DE CONTENIDO */
.legal-page {
  padding-top: clamp(1rem, 2vw, 1.8rem);
}

.legal-content {
  max-width: 880px;
}

/* ancho ideal de lectura */

/* 5) SECCIONES Y TIPOGRAFÍA */
.legal-section {
  margin-bottom: 1.8rem;
}

.legal-section h2 {
  font-size: clamp(1.25rem, 1.05rem + .8vw, 1.7rem);
  font-weight: 800;
  color: var(--c-ink);
  margin-bottom: .75rem;
  position: relative;
  scroll-margin-top: 96px;
  /* compensa navbar fija al navegar con #anclas */
}

.legal-section h2::after {
  content: "";
  display: block;
  width: 72px;
  height: 4px;
  border-radius: 2px;
  background: var(--c-accent);
  margin-top: .35rem;
}

.legal-section p {
  color: var(--c-body);
  line-height: 1.65;
}

/* resumen inicial grande */
.lead {
  color: var(--c-body);
  font-size: 16px !important;
  text-align: justify;
}

/* 6) LISTAS */
/* bullets suaves */
.bullet-soft {
  list-style: none;
  padding-left: 0;
}

.bullet-soft li {
  position: relative;
  padding-left: 1.35rem;
  margin: .35rem 0;
  color: var(--c-body);
}

.bullet-soft li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55rem;
  width: .48rem;
  height: .48rem;
  border-radius: 50%;
  background: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(0, 207, 255, .12);
}

/* items legales destacados (con negrita al inicio) */
.legal-li {
  position: relative;
  padding-left: 1.35rem;
  margin: .45rem 0;
  color: var(--c-body);
}

.legal-li>span {
  font-weight: 700;
  color: var(--c-ink);
}

.legal-li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .58rem;
  width: .52rem;
  height: .52rem;
  border-radius: 50%;
  background: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(0, 207, 255, .15);
}

/* 7) CALLOUT (caja de resumen) */
.callout {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  background: linear-gradient(180deg, #f4fbff, #edf7fb);
  border: 1px solid rgba(0, 207, 255, .20);
  border-radius: var(--radius);
  padding: .95rem 1rem;
  margin-top: .8rem;
  box-shadow: var(--shadow);
  color: #0b2a38;
}

.callout .ico {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #0799bd;
}

.callout svg {
  width: 22px;
  height: 22px;
}

/* 8) TOC (Índice) */
/* Escritorio (sticky) */
.legal-toc {
  position: sticky;
  top: 96px;
  background: #fff;
  border: 1px solid var(--c-bdr);
  border-radius: 16px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.legal-toc .toc-title {
  font-weight: 800;
  text-transform: uppercase;
  font-size: .8rem;
  letter-spacing: .06em;
  color: #475569;
  margin-bottom: .55rem;
}

.legal-toc .toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.legal-toc a {
  --pad-left: .75rem;
  position: relative;
  display: block;
  text-decoration: none;
  color: #0f172a;
  padding: .42rem var(--pad-left);
  border-radius: 10px;
  font-size: .95rem;
}

.legal-toc a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 3px;
  background: transparent;
}

.legal-toc a:hover {
  background: rgba(0, 207, 255, .08);
}

.legal-toc a.active {
  background: rgba(0, 207, 255, .14);
  box-shadow: inset 0 0 0 1px rgba(0, 207, 255, .28);
  font-weight: 700;
}

.legal-toc a.active::before {
  background: var(--c-primary);
}

/* Móvil (details/summary) */
.legal-toc-mobile {
  border: 1px solid var(--c-bdr);
  border-radius: 12px;
  padding: .55rem .8rem;
}

.legal-toc-mobile summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  color: var(--c-ink);
}

.legal-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.legal-toc-mobile .toc-list {
  list-style: none;
  margin: .6rem 0 0;
  padding: 0;
}

.legal-toc-mobile a {
  display: block;
  text-decoration: none;
  color: #0f172a;
  padding: .38rem .25rem;
  border-radius: 8px;
}

.legal-toc-mobile a:hover {
  background: rgba(0, 207, 255, .10);
}

/* 9) UTILIDADES ESPECÍFICAS DE ESTA PÁGINA  */
.btn-outline-secondary.btn-sm {
  border-radius: 999px;
}

/* “volver arriba” */
.contacto {
  background-color: #edf7fb !important;
}

/* bloque de contacto */

/* Botón flotante “volver arriba” (si lo usas) */
#btnVolverArriba {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: linear-gradient(90deg, #ffcc33 0%, #ff8c2b 100%);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all .3s ease;
  z-index: 1000;
}

#btnVolverArriba.show {
  opacity: 1;
  visibility: visible;
}

#btnVolverArriba:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 207, 255, .3);
}

/* 10) RESPONSIVE */
/* Tablet */
@media (max-width: 991.98px) {
  .legal-hero {
    padding: 1.8rem 0 1rem;
  }

  .legal-content {
    max-width: 100%;
  }

  .legal-section {
    margin-bottom: 1.3rem;
  }

  .legal-hero .container {
    padding-top: .25rem;
  }
  .legal-title{
    margin-top: 100px !important;

  }
}

/* Móvil */
@media (max-width: 575.98px) {
  .legal-title {
    font-size: 1.45rem;
  }

  .legal-section p,
  .legal-section li {
    font-size: .97rem;
  }

  /* Centrar hero + meta en pantallas pequeñas */
  .legal-hero .container {
    text-align: center;
  }

  .legal-meta {
    justify-content: center;
  }
}

/* 11) MODO OSCURO DEL SO (forzamos claro por legibilidad) */
@media (prefers-color-scheme: dark) {

  body,
  .legal-page {
    background: #fff !important;
  }

  .legal-section p,
  .legal-section li {
    color: var(--c-body) !important;
  }
}
