/* ============================================================
   CUSTOM CURSOR
============================================================ */
.cursor {
  position: fixed;
  width: 5px;
  height: 5px;
  background: rgba(168,196,255,0.95);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.cursor-outer {
  position: fixed;
  width: 28px;
  height: 28px;
  border: 0.5px solid rgba(168,196,255,0.4);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: width 0.18s ease, height 0.18s ease, border-color 0.18s ease, opacity 0.2s ease;
}

/* Accesibilidad del cursor (F-07): el cursor personalizado solo tiene sentido
   con un puntero fino (ratón) y sin preferencia de movimiento reducido. En
   táctil / puntero grueso o con reduce-motion restauramos el cursor nativo y
   ocultamos el personalizado (el JS también sale antes de animar). */
@media (hover: none), (pointer: coarse) {
  body { cursor: auto; }
  .cursor,
  .cursor-outer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body { cursor: auto; }
  .cursor,
  .cursor-outer { display: none; }
}

/* ============================================================
   HERO
============================================================ */
.hero {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: var(--ink);
  will-change: opacity;
}

.hero__bg {
  position: absolute;
  top: -15%;
  left: 0;
  width: 100%;
  height: 130%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  will-change: transform;
  /* Póster como fondo CSS: el atributo poster del <video> se distorsiona
     en algunos navegadores móviles al no respetar object-fit */
  background: url('../assets/images/hero/hero-bg.png') center / cover no-repeat;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(4,6,15,0.35)  0%,
    rgba(4,6,15,0.15) 40%,
    rgba(4,6,15,0.55) 75%,
    rgba(4,6,15,0.85) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.hero__scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(100,150,255,0.012) 3px,
    rgba(100,150,255,0.012) 4px
  );
  z-index: 2;
  pointer-events: none;
}

.hero__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 90% 85% at 50% 50%,
    transparent 0%,
    rgba(2,4,14,0.72) 100%
  );
  z-index: 3;
  pointer-events: none;
}

/* ============================================================
   STARS
============================================================ */
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(200,220,255,0.7);
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
}

.star--1 { top: 17%; left: 11%;  animation: twinkle 3.1s ease-in-out infinite 0s; }
.star--2 { top: 30%; left: 80%;  animation: twinkle 2.7s ease-in-out infinite 0.8s; }
.star--3 { top: 68%; left: 20%;  animation: twinkle 3.5s ease-in-out infinite 1.4s; }
.star--4 { top: 13%; right: 20%; animation: twinkle 2.9s ease-in-out infinite 2.1s; }

/* ============================================================
   FRAME CORNERS
============================================================ */
.frame-corner {
  position: absolute;
  z-index: 15;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

.frame-corner--tl { border-top: 0.5px solid var(--border); border-left: 0.5px solid var(--border); top: 16px; left: 16px; }
.frame-corner--tr { border-top: 0.5px solid var(--border); border-right: 0.5px solid var(--border); top: 16px; right: 16px; }
.frame-corner--bl { border-bottom: 0.5px solid var(--border); border-left: 0.5px solid var(--border); bottom: 16px; left: 16px; }
.frame-corner--br { border-bottom: 0.5px solid var(--border); border-right: 0.5px solid var(--border); bottom: 16px; right: 16px; }

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 28px 44px;
  z-index: 20;
  transition: background 0.3s ease, border-bottom-color 0.3s ease;
  border-bottom: 0.5px solid transparent;
}

.navbar.scrolled {
  background: rgba(4,6,15,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(168,196,255,0.1);
}

.nav__left  { display: flex; gap: 40px; justify-content: flex-end;  align-items: center; }
.nav__center { display: flex; align-items: center; justify-content: center; padding: 0 28px; }
.nav__right { display: flex; gap: 32px; justify-content: flex-start; align-items: center; }

.nav__owl {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
  filter:
    drop-shadow(0 0 12px rgba(245,166,35,0.4))
    drop-shadow(0 0 24px rgba(27,79,216,0.3));
  will-change: opacity;
}

/* ============================================================
   HERO CENTER
============================================================ */
.hero__center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: opacity;
}

.hero__divider {
  width: 60px;
  height: 0.5px;
  background: linear-gradient(90deg, transparent, rgba(168,196,255,0.5), transparent);
  margin: 14px auto;
}

/* ============================================================
   BOTTOM ELEMENTS
============================================================ */
.hero__bottom-left {
  position: absolute;
  bottom: 28px;
  left: 40px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero__bottom-left-line {
  width: 28px;
  height: 0.5px;
  background: rgba(168,196,255,0.3);
  flex-shrink: 0;
}

.hero__bottom-right {
  position: absolute;
  bottom: 28px;
  right: 40px;
  z-index: 20;
}

/* ============================================================
   LANGUAGE SWITCHER
============================================================ */
.hero__lang-switcher {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.hero__lang-label {
  font-family: 'Nunito', sans-serif;
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: rgba(168,196,255,0.75);
}

.hero__lang-btns {
  display: flex;
  gap: 8px;
}

.lang-btn {
  background: rgba(168,196,255,0.08);
  border: 0.5px solid rgba(168,196,255,0.40);
  border-radius: 20px;
  padding: 5px 16px;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(168,196,255,0.90);
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.lang-btn:hover {
  color: var(--text);
  border-color: rgba(168,196,255,0.65);
  background: rgba(168,196,255,0.14);
}

.lang-btn.active {
  color: var(--star);
  border-color: rgba(168,196,255,0.70);
  background: rgba(168,196,255,0.16);
}

/* ============================================================
   BOTTOM LEFT LINK
============================================================ */
.hero__bottom-left-text {
  text-decoration: none;
  transition: color 0.2s ease;
}

.hero__bottom-left-text:hover {
  color: var(--star);
}

/* ============================================================
   SCROLL INDICATOR
============================================================ */
.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  opacity: 0.65;
  z-index: 20;
  transition: opacity 0.25s ease;
}

.hero__scroll:hover {
  opacity: 1;
}

.hero__scroll-text {
  text-decoration: none;
}

.hero__scroll-line {
  width: 0.5px;
  height: 36px;
  background: rgba(168,196,255,0.12);
  position: relative;
  overflow: hidden;
}

.hero__scroll-pulse {
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(168,196,255,0),
    rgba(168,196,255,0.9) 50%,
    rgba(168,196,255,0)
  );
  animation: scrollPulse 1.8s ease-in-out infinite;
}

/* ============================================================
   NAV ACTIVE PAGE LINK
============================================================ */
.nav__link[aria-current="page"] {
  color: var(--text);
}

/* ============================================================
   NAV LINKS — page variant (subpages)
   Tamaño/peso unificado para TODAS las subpáginas (.navbar--page).
   Anula el .nav__link global de typography.css (que es para la home).
============================================================ */
.navbar--page .nav__link {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-nav);
}

.navbar--page .nav__link:hover,
.navbar--page .nav__link[aria-current="page"] {
  color: var(--text);
}

/* ============================================================
   NAV ACTIONS (subpages — agrupa idioma + CTA a la derecha)
============================================================ */
.nav__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: flex-end;
}

/* ============================================================
   NAV LANGUAGE SWITCHER (subpages)
============================================================ */
.nav__lang {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav__lang-btn {
  font-family: 'Nunito', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: rgba(168,196,255,0.38);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 7px;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1;
}

.nav__lang-btn:hover {
  color: rgba(168,196,255,0.82);
  background: rgba(168,196,255,0.07);
}

.nav__lang-btn--active {
  color: var(--star);
  background: rgba(168,196,255,0.08);
}

/* ============================================================
   MENÚ MÓVIL (hamburguesa) — compartido por home y subpáginas.
   El botón .nav__burger lo inyecta js/nav.js. Oculto en escritorio.
============================================================ */
.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  background: rgba(168,196,255,0.04);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  z-index: 30;
}
.nav__burger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav--open .nav__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav--open .nav__burger span:nth-child(2) { opacity: 0; }
.nav--open .nav__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 1080px) {
  .navbar .nav__burger { display: flex; }

  /* Fondo sólido al desplegar el menú: sin scroll la navbar es
     transparente y los enlaces quedaban ilegibles sobre el hero.
     z-index elevado para que el menú desplegado quede por encima del
     título del hero (.hero__center comparte z-index 20 y, al ir después
     en el DOM, tapaba los enlaces del menú). */
  .navbar.nav--open {
    z-index: 40;
    background: rgba(6,9,26,0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: rgba(168,196,255,0.1);
  }

  /* ── Subpáginas (.navbar--page) ── */
  .navbar.navbar--page {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    row-gap: 0;
  }
  .navbar--page .nav__brand   { order: 1; }
  .navbar--page .nav__burger  { order: 2; }
  .navbar--page .nav__links,
  .navbar--page .nav__actions {
    order: 3;
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.32s ease, opacity 0.25s ease, margin 0.32s ease;
  }
  .navbar--page .nav__actions { order: 4; gap: 14px; }
  .navbar--page.nav--open .nav__links {
    max-height: 60vh; opacity: 1; pointer-events: auto; margin-top: 14px;
  }
  .navbar--page.nav--open .nav__actions {
    max-height: 50vh; opacity: 1; pointer-events: auto; margin-top: 6px; padding-bottom: 6px;
  }
  .navbar--page .nav__links .nav__link {
    padding: 13px 2px;
    font-size: 13px;
    border-top: 1px solid rgba(168,196,255,0.07);
  }
  .navbar--page .nav__lang { justify-content: center; }
  .navbar--page .nav__cta-amber {
    display: inline-flex !important;
    justify-content: center;
    width: 100%;
  }

  /* ── Home (.navbar sin --page) ── */
  .navbar:not(.navbar--page) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .navbar:not(.navbar--page) .nav__center {
    order: 1; justify-content: flex-start; padding: 0; flex: 0 0 auto;
  }
  .navbar:not(.navbar--page) .nav__burger { order: 2; }
  .navbar:not(.navbar--page) .nav__left,
  .navbar:not(.navbar--page) .nav__right {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.32s ease, opacity 0.25s ease, margin 0.32s ease;
  }
  .navbar:not(.navbar--page) .nav__left  { order: 3; }
  .navbar:not(.navbar--page) .nav__right { order: 4; }
  .navbar.nav--open:not(.navbar--page) .nav__left  { max-height: 50vh; opacity: 1; pointer-events: auto; margin-top: 14px; }
  .navbar.nav--open:not(.navbar--page) .nav__right { max-height: 50vh; opacity: 1; pointer-events: auto; }
  .navbar:not(.navbar--page) .nav__left  .nav__link,
  .navbar:not(.navbar--page) .nav__right .nav__link,
  .navbar:not(.navbar--page) .nav__btn {
    padding: 13px 2px;
    justify-content: flex-start;
    border-top: 1px solid rgba(168,196,255,0.07);
  }
}

/* ── Consentimiento RGPD (checkbox compartido por los formularios) ── */
.consent { display: flex; align-items: flex-start; gap: 0.6rem; margin: 1rem 0 0.25rem; cursor: pointer; text-align: left; }
.consent input[type="checkbox"] { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); cursor: pointer; }
.consent input[type="checkbox"].invalid { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 3px; }
.consent__text { font-size: 0.85rem; color: var(--text-nav); line-height: 1.5; }
.consent__text a { color: var(--star); text-decoration: underline; }
.consent__text a:hover { color: var(--amber); }
