/* ==========================================================================
   Landing — refinamientos
   Se carga DESPUÉS de landing-experience.css. No cambia el lenguaje visual
   (botones 3D, vidrio, íconos 3D, tarjetas apiladas); solo corrige
   espaciados, escalas, alineación, responsive y suaviza animaciones.
   ========================================================================== */

:root {
  --refine-container: 1240px;
  --refine-gutter: clamp(1.25rem, 5vw, 5rem);
  --refine-edge: max(var(--refine-gutter), calc((100vw - var(--refine-container)) / 2));
  --refine-title: clamp(2.25rem, 1.45rem + 2.4vw, 3.5rem);
  --refine-body: clamp(1rem, 0.95rem + 0.22vw, 1.125rem);
  --refine-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 1. Hero
   ------------------------------------------------------------------------ */
/* Texto justificado generaba "ríos" de espacios; alineado se lee mejor. */
body .hero-left p {
  text-align: left;
  text-wrap: pretty;
}

@media (max-width: 860px) {
  body .hero-left p {
    text-align: center;
  }
}

/* 2. Accesos rápidos a servicios
   ------------------------------------------------------------------------ */
.hero-bottom-links a {
  transition: transform 260ms var(--refine-ease), box-shadow 260ms var(--refine-ease), border-color 260ms ease, background-color 260ms ease;
}

.hero-bottom-links a span {
  font-weight: 600;
  line-height: 1.3;
}

@media (min-width: 1081px) {
  /* Keep the seven service links in a single desktop row. */
  body .hero-bottom-links {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 0.55rem;
    overflow-x: auto;
    padding: 0.7rem max(1rem, calc((100vw - 92rem) / 2));
  }

  body .hero-bottom-links a {
    flex: 1 0 clamp(10rem, 12vw, 12.5rem);
    flex-direction: row;
    justify-content: space-between;
    gap: 0.5rem;
    min-width: 10rem;
    min-height: 4.4rem;
    padding: 0.5rem 0.75rem;
    text-align: left;
  }

  body .hero-bottom-links a img {
    width: auto;
    height: 2rem;
    margin: 0 0.25rem 0 0;
    object-fit: contain;
  }

  body .hero-bottom-links a span {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
  }

  body .hero-bottom-links a .chevron {
    flex: 0 0 auto;
    margin: 0;
  }

  body .hero-bottom-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
}

@media (max-width: 860px) {
  /* Dos columnas en lugar de seis filas de ancho completo. */
  body .hero-bottom-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0.75rem 1rem 1rem;
  }

  body .hero-bottom-links a {
    max-width: none;
    min-height: 3.75rem;
    padding: 0.625rem 0.75rem;
    gap: 0.625rem;
  }

  body .hero-bottom-links a:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  body .hero-bottom-links a img {
    flex: none;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
  }

  body .hero-bottom-links a span {
    font-size: 0.8125rem;
  }

  body .hero-bottom-links a .chevron {
    display: none;
  }
}

/* 3. Escala tipográfica uniforme en todas las secciones
   ------------------------------------------------------------------------ */
body .section :is(.section-complaint__content > h2, .section-choice__title) {
  font-size: var(--refine-title);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin-bottom: clamp(1rem, 2.5vh, 1.75rem);
}

body .section :is(.section-complaint__content > p, .section-choice__intro) {
  font-size: var(--refine-body);
  line-height: 1.7;
}

body .section .section-complaint__content > p + p {
  margin-top: 0.875rem;
}

body .section .section-certificate__reminder {
  font-size: var(--refine-body);
}

/* 4. Alineación horizontal común (escritorio)
   El borde izquierdo del contenido coincide en todas las secciones.
   ------------------------------------------------------------------------ */
@media (min-width: 1081px) {
  body .section-complaint:not(.section-certificate) {
    padding-left: var(--refine-gutter);
    padding-right: var(--refine-gutter);
  }

  body .section-complaint:not(.section-certificate) > .section-complaint__inner {
    width: min(100%, var(--refine-container));
    margin-inline: auto;
  }

  body .section-certificate .section-certificate__intro,
  body .section-choice {
    padding-left: var(--refine-edge);
  }

  /* El contenido no debe quedar bajo la barra superior fija (~60px). */
  body .section-certificate .section-complaint__content {
    padding-top: 4.5rem;
    padding-bottom: 1.5rem;
  }
}

@media (min-width: 1081px) and (max-height: 820px) {
  /* Laptops de poca altura: títulos y separaciones algo más compactos. */
  :root {
    --refine-title: clamp(2.125rem, 1.2rem + 2.2vw, 3rem);
  }

  body .section .section-complaint__content > p + p {
    margin-top: 0.625rem;
  }

  body .section .section-complaint__action {
    margin-top: 1.5rem;
  }
}

/* 5. Botones: misma altura, tipografía y alineación en todas las secciones
   (se conserva el estilo 3D original).
   ------------------------------------------------------------------------ */
body .section .section-complaint__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.8rem 1.6rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.2;
}

body .section-certificate .section-complaint__content .section-certificate__actions {
  justify-content: flex-start;
  width: 100%;
}

@media (max-width: 860px) {
  body .section .section-complaint__action,
  body .section-certificate .section-complaint__content .section-certificate__actions {
    justify-content: center;
  }
}

/* 6. Catálogo de delitos: misma fuente que el resto del sitio y más legible
   ------------------------------------------------------------------------ */
body .crime-flip-card__name,
body .crime-flip-card__description {
  font-family: "Montserrat", sans-serif;
}

body .crime-flip-card__name {
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
}

body .crime-flip-card__description {
  font-size: 0.78rem;
  line-height: 1.4;
}

/* 7. Móvil y tablet: secciones
   ------------------------------------------------------------------------ */
@media (max-width: 1080px) {
  /* Denuncia Anónima se monta sobre esta sección con margen negativo; se
     reserva ese espacio para que el botón no quede cubierto. */
  body .section-digital {
    padding-bottom: calc(3rem + clamp(4rem, 10svh, 7rem));
  }
}

@media (max-width: 860px) {
  /* Mismo patrón centrado en todas las secciones. */
  body .section :is(.section-complaint__content > h2, .section-choice__title, .section-complaint__content > p, .section-choice__intro) {
    text-align: center;
    margin-inline: auto;
  }

  body .section-digital__catalogue-heading h3 {
    text-align: center;
  }

  body .section-digital__actions {
    text-align: center;
  }

  /* Menú lateral de la constancia: menos aire muerto entre opciones. */
  body :is(.section-certificate, .section-extravio) .section-certificate__side {
    min-height: 0;
    gap: 0.5rem;
    padding: 1rem;
  }

  body :is(.section-certificate, .section-extravio) .section-certificate__option {
    min-height: 0;
    padding: 0.875rem 1rem;
  }
}

/* 8. Barra superior de escritorio
   ------------------------------------------------------------------------ */
@media (min-width: 861px) {
  body .nav.has-scrolled {
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
  }

  body .nav__icons {
    max-width: calc(var(--refine-container) + 2 * var(--refine-gutter));
    margin-inline: auto;
    padding: 0.5rem var(--refine-gutter);
    border-radius: 0;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  body .nav__icons .fd-logo img {
    height: 2.25rem;
    width: auto;
  }

  body .nav__icons a.bottom,
  body .nav__icons button.bottom {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    transition: background-color 200ms ease, transform 200ms var(--refine-ease);
  }

  body .nav__icons a.bottom:hover,
  body .nav__icons a.bottom:focus-visible,
  body .nav__icons button.bottom:hover {
    background: rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
  }

  body .nav__icons a.bottom img {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
  }
}

/* 9. Botón de menú móvil: fondo de vidrio para que se distinga sobre
   cualquier sección (antes eran líneas grises sueltas sobre el texto).
   ------------------------------------------------------------------------ */
@media (max-width: 860px) {
  body #nav-mobile {
    z-index: 1100;
  }

  body #nav-mobile::before {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: -1;
    width: 3.25rem;
    height: 3.25rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    background: rgba(30, 30, 32, 0.62);
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    content: "";
    pointer-events: none;
    transition: opacity 300ms ease;
  }

  body #nav-mobile:has(#toggle:checked)::before {
    opacity: 0;
  }

  body #nav-mobile .mobile-nav-item:before {
    background-color: #e4e4e4;
  }

  /* Las líneas del ícono (los enlaces plegados) caben dentro del recuadro. */
  body #toggle:not(:checked) ~ .mobile-nav .mobile-nav-item {
    overflow: hidden;
  }

  body #toggle:not(:checked) ~ .mobile-nav .mobile-nav-item:nth-child(1) { width: 1.25rem; }
  body #toggle:not(:checked) ~ .mobile-nav .mobile-nav-item:nth-child(2) { width: 1.75rem; }
  body #toggle:not(:checked) ~ .mobile-nav .mobile-nav-item:nth-child(3) { width: 1.5rem; }
}

/* 10. Profundidad del apilado (escritorio, --stack-cover lo calcula el JS)
   ------------------------------------------------------------------------ */
.landing-stack-card::after {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: #000;
  content: "";
  opacity: calc(var(--stack-cover, 0) * 0.22);
  pointer-events: none;
}

@media (min-width: 1081px) {
  .landing-stack-card {
    transform-origin: 50% 0;
    transform: scale(calc(1 - var(--stack-cover, 0) * 0.04));
  }
}

/* 10b. Paneles de requisitos: misma entrada lateral, pero más ágil
   (antes 1.5 s se sentía lenta, sobre todo en móvil).
   ------------------------------------------------------------------------ */
body .section .section-certificate__panel {
  transition: transform 750ms var(--refine-ease);
}

/* Validación de constancia de extravío: aprovecha el área visible del dispositivo. */
#extravio-details[data-active-view="validation"] {
  padding: 0;
}

body .section-extravio__validation {
  display: flex;
  align-items: stretch;
  height: 100svh;
  min-height: 0;
  padding: clamp(4rem, 8svh, 6rem) clamp(1.25rem, 5vw, 7rem) 0;
  box-sizing: border-box;
  overflow: hidden;
}

body .section-extravio__validation > .section-certificate__panel-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 7rem);
  flex: 1;
  width: 100%;
  height: 100%;
  max-width: none;
  min-height: 0;
  margin: 0;
  box-sizing: border-box;
}

body .section-extravio__validation-copy {
  width: 100%;
  max-width: 60rem;
  margin: 0;
  padding: 0;
}

body .section-extravio__validation-copy h3 {
  font-size: clamp(2.25rem, 3vw, 4rem);
}

body .section-extravio__validation-copy > p {
  max-width: 55rem;
  font-size: clamp(1.1rem, 1.4vw, 1.5rem);
  line-height: 1.5;
}

body .section-extravio__validation-prompt,
body .section-extravio__validate-button {
  width: 100%;
  max-width: 56rem;
}

body .section-extravio__validation-prompt {
  margin-top: clamp(1.75rem, 5svh, 4rem);
}

body .section-extravio__validation-prompt strong {
  font-size: clamp(1.1rem, 1.3vw, 1.5rem);
}

body .section-extravio__validation-actions {
  width: 100%;
  margin: clamp(1.5rem, 4svh, 3rem) 0 0;
}

body .section-extravio__validation .section-extravio__validate-button {
  min-height: clamp(4.25rem, 9svh, 6rem);
  padding: 1rem clamp(1.25rem, 2vw, 2rem);
  font-size: clamp(1.125rem, 1.35vw, 1.5rem);
}

body .section-extravio__agent {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: end;
  width: 100%;
  height: min(96svh, 52rem);
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
  transform: none;
}

body .section-extravio__validation-back {
  top: 0;
  right: 0;
}

@media (max-width: 1000px) {
  body .section-extravio__validation {
    height: auto;
    padding: 5rem clamp(1rem, 4vw, 2.5rem) 2rem;
    overflow: visible;
  }

  body .section-extravio__validation > .section-certificate__panel-inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    height: auto;
    gap: 1.5rem;
  }

  body .section-extravio__validation-copy {
    max-width: none;
  }

  body .section-extravio__validation-prompt,
  body .section-extravio__validate-button {
    max-width: none;
  }

  body .section-extravio__agent {
    position: static;
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
    align-self: end;
    width: min(100%, 34rem);
    height: min(46svh, 32rem);
    padding: 0;
    object-position: center bottom;
    transform: none;
  }

  body .section-extravio__validation-back {
    top: -3.75rem;
  }
}

@media (max-width: 700px) {
  body .section-extravio__validation-copy {
    padding: 0;
  }

  body .section-extravio__validation-copy h3 {
    font-size: clamp(2rem, 7vw, 2.8rem);
  }

  body .section-extravio__validation-copy > p {
    font-size: 1rem;
  }

  body .section-extravio__validation .section-extravio__validate-button--compact {
    padding-inline: 1rem;
    font-size: 1rem;
  }

  body .section-extravio__agent {
    width: min(90%, 22rem);
    height: min(40svh, 24rem);
  }
}

/* 11. Pie de página y chatbot
   ------------------------------------------------------------------------ */
body footer .phone {
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  transition: background-color 200ms ease;
}

body footer .phone:hover {
  background: rgba(255, 255, 255, 0.08);
}

body footer .phone svg {
  margin: 0;
}

body .chatbot-wrapper {
  right: 1.25rem;
  bottom: 1.25rem;
}

body .chatbot-bubble {
  width: 60px;
  height: 60px;
}

@media (prefers-reduced-motion: reduce) {
  .landing-stack-card::after {
    display: none;
  }

  .landing-stack-card {
    transform: none;
  }
}
