/* ==========================================================================
   APERTURA CINEMATOGRÁFICA — PARTIDO JUSTICIALISTA & SISTEMA DE ASISTENCIA QR
   Dirección de Arte: Institucional, Emocional, Moderna y Democrática
   Paleta: Celeste (#75aadb), Blanco (#ffffff), Azul Profundo (#030c1e) y Oro (#fcbf4a)
   ========================================================================== */

:root {
  --pj-blue-900: #030a17;
  --pj-blue-800: #07152b;
  --pj-blue-700: #0e274d;
  --pj-blue-600: #173b70;
  --pj-celeste: #75aadb;
  --pj-celeste-light: #b9d8f8;
  --pj-celeste-glow: rgba(117, 170, 219, 0.4);
  --pj-white: #ffffff;
  --pj-gold: #fcbf4a;
  --pj-gold-dark: #d4a54b;
  --pj-gold-glow: rgba(252, 191, 74, 0.35);
  
  --text-primary: #ffffff;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  
  --glass-bg: rgba(7, 21, 43, 0.72);
  --glass-border: rgba(117, 170, 219, 0.25);
  --glass-hover: rgba(14, 39, 77, 0.85);

  --font-title: 'Cinzel', 'Playfair Display', 'Georgia', serif;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --ease-cinema: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-camera: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Reset y caja base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--pj-blue-900);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL HERO (VIEWPORT 100%)
   ========================================================================== */
.cinematic-stage {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: radial-gradient(circle at 60% 40%, #0d274f 0%, #030a17 80%);
}

/* ==========================================================================
   CAPA DE FONDO PANORÁMICO 21:9 Y CÁMARA LENTA
   ========================================================================== */
.panoramic-viewport {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}

.panoramic-media {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  object-fit: cover;
  object-position: center 60%;
  opacity: 0;
  transform: scale(1.02) translate3d(0, 0, 0);
  will-change: transform, opacity;
  animation: cameraMovement 16s var(--ease-camera) forwards;
  filter: contrast(1.04) brightness(0.96) saturate(1.08);
}

/* Animación cinematográfica de cámara lenta: fade-in + slow dolly zoom */
@keyframes cameraMovement {
  0% {
    opacity: 0;
    transform: scale(1.08) translate3d(-15px, 5px, 0);
  }
  15% {
    opacity: 1;
  }
  80% {
    transform: scale(1.02) translate3d(8px, -2px, 0);
  }
  100% {
    opacity: 1;
    transform: scale(1.0) translate3d(0, 0, 0);
  }
}

/* ==========================================================================
   ATMÓSFERA Y DEGRADADOS ÓPTICOS (SCRIM)
   ========================================================================== */
/* Canvas de partículas lumínicas de amanecer */
#particles-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.85;
}

/* Rayo anamórfico sutil en ángulo */
.anamorphic-flare {
  position: absolute;
  top: -20%;
  right: 15%;
  width: 70vw;
  height: 80vh;
  background: radial-gradient(ellipse at center, rgba(255, 235, 175, 0.18) 0%, rgba(117, 170, 219, 0.08) 45%, transparent 70%);
  transform: rotate(-18deg);
  z-index: 2;
  pointer-events: none;
  animation: flarePulse 9s ease-in-out infinite alternate;
}

@keyframes flarePulse {
  0% { opacity: 0.5; transform: rotate(-18deg) scale(0.95); }
  100% { opacity: 0.9; transform: rotate(-17deg) scale(1.05); }
}

/* Scrim gradual para legibilidad de textos y contraste WCAG AAA */
.scrim-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(3, 10, 23, 0.88) 0%,
    rgba(3, 10, 23, 0.72) 35%,
    rgba(3, 10, 23, 0.35) 65%,
    rgba(3, 10, 23, 0.65) 100%
  );
  z-index: 3;
  pointer-events: none;
}

.vignette-overlay {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 120px rgba(2, 6, 15, 0.85);
  z-index: 3;
  pointer-events: none;
}

/* ==========================================================================
   ENCABEZADO Y BARRA SUPERIOR
   ========================================================================== */
.top-nav-bar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  animation: fadeInTop 1.2s ease-out 0.8s backwards;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(7, 21, 43, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1.15rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pj-celeste-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand-badge .sun-icon {
  color: var(--pj-gold);
  filter: drop-shadow(0 0 6px var(--pj-gold-glow));
  font-size: 1.1rem;
}

.controls-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: rgba(7, 21, 43, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  padding: 0.5rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
}

.btn-icon:hover, .btn-icon:focus-visible {
  background: rgba(14, 39, 77, 0.9);
  color: var(--pj-white);
  border-color: var(--pj-celeste);
  transform: translateY(-1px);
  box-shadow: 0 0 15px var(--pj-celeste-glow);
  outline: none;
}

/* ==========================================================================
   CUERPO PRINCIPAL DEL HERO (LAYOUT PANORÁMICO)
   ========================================================================== */
.hero-stage-content {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  align-items: center;
  gap: 3.5rem;
  padding: 0 4rem;
  flex: 1;
  max-width: 1680px;
  margin: 0 auto;
  width: 100%;
}

/* ==========================================================================
   EMBLEMA OFICIAL DEL PARTIDO PERONISTA
   ========================================================================== */
.emblem-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.2rem 1.8rem;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(252, 191, 74, 0.35);
  border-radius: 20px;
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.55),
    inset 0 0 25px rgba(252, 191, 74, 0.08),
    0 0 30px rgba(117, 170, 219, 0.15);
  animation: emblemEntrance 2.2s var(--ease-cinema) 2s backwards;
  transform-origin: center left;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.emblem-wrapper:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 
    0 20px 45px rgba(0, 0, 0, 0.65),
    0 0 35px rgba(252, 191, 74, 0.25);
}

.emblem-svg-container {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: flex;
  justify-content: center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.45));
}

.emblem-svg-container img {
  width: 100%;
  height: auto;
  display: block;
}

.emblem-caption {
  margin-top: 1.25rem;
  text-align: center;
}

.emblem-caption .caption-title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--pj-gold);
  text-shadow: 0 0 10px var(--pj-gold-glow);
}

.emblem-caption .caption-sub {
  font-size: 0.78rem;
  color: var(--pj-celeste-light);
  letter-spacing: 0.08em;
  margin-top: 0.2rem;
  text-transform: uppercase;
}

@keyframes emblemEntrance {
  0% {
    opacity: 0;
    transform: translateX(-40px) scale(0.92);
    filter: blur(8px);
  }
  60% {
    opacity: 0.85;
    filter: blur(0px);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

/* ==========================================================================
   TEXTO INSTITUCIONAL Y SISTEMA DE ASISTENCIA QR
   ========================================================================== */
.hero-narrative {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  animation: contentEmergence 2.2s var(--ease-cinema) 3.5s backwards;
}

@keyframes contentEmergence {
  0% {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.event-highlight {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  width: fit-content;
  background: rgba(252, 191, 74, 0.15);
  border: 1px solid rgba(252, 191, 74, 0.45);
  color: var(--pj-gold);
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 0 15px rgba(252, 191, 74, 0.12);
}

.hero-title {
  font-family: var(--font-title);
  font-size: clamp(2.4rem, 4.5vw, 4.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--pj-white);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero-title span.celeste-accent {
  background: linear-gradient(135deg, #ffffff 10%, #75aadb 60%, #4a90e2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-lead {
  font-size: clamp(1.05rem, 1.35vw, 1.35rem);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 740px;
  font-weight: 400;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.hero-lead strong {
  color: var(--pj-white);
  font-weight: 600;
}

/* ==========================================================================
   BOTÓN HERO DE LOGIN CINEMATOGRÁFICO
   ========================================================================== */
.cta-container {
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
}

.btn-login-cinematic {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  padding: 1.15rem 3.4rem;
  background: linear-gradient(135deg, rgba(18, 51, 102, 0.92) 0%, rgba(10, 31, 66, 0.95) 50%, rgba(6, 21, 45, 0.98) 100%);
  border: 2px solid var(--pj-gold);
  border-radius: 9999px;
  color: var(--pj-white);
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(252, 191, 74, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.3);
  transition: all 0.35s var(--ease-cinema);
}

.btn-login-cinematic .btn-glow-aura {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(252, 191, 74, 0.25) 0%, transparent 65%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.btn-login-cinematic .btn-icon-lock {
  font-size: 1.35rem;
  transition: transform 0.3s ease;
}

.btn-login-cinematic .btn-text {
  position: relative;
  z-index: 1;
  color: var(--pj-gold);
  text-shadow: 0 0 14px var(--pj-gold-glow);
}

.btn-login-cinematic .btn-arrow {
  position: relative;
  z-index: 1;
  font-size: 1.35rem;
  color: var(--pj-gold);
  transition: transform 0.3s ease;
}

.btn-login-cinematic:hover,
.btn-login-cinematic:focus-visible {
  transform: translateY(-3px) scale(1.03);
  background: linear-gradient(135deg, rgba(24, 66, 130, 0.95) 0%, rgba(13, 42, 90, 0.98) 50%, rgba(8, 29, 61, 1) 100%);
  border-color: #ffe699;
  box-shadow: 
    0 18px 45px rgba(0, 0, 0, 0.7),
    0 0 45px rgba(252, 191, 74, 0.7),
    inset 0 1px 2px rgba(255, 255, 255, 0.5);
  outline: none;
}

.btn-login-cinematic:hover .btn-glow-aura {
  opacity: 1;
}

.btn-login-cinematic:hover .btn-icon-lock {
  transform: scale(1.15) rotate(-10deg);
}

.btn-login-cinematic:hover .btn-arrow {
  transform: translateX(6px);
}

/* ==========================================================================
   BARRA DE PIE INFORMATIVA (METRICAS Y ESTADO)
   ========================================================================== */
.bottom-info-strip {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 4rem;
  background: linear-gradient(0deg, rgba(3, 10, 23, 0.95) 0%, rgba(3, 10, 23, 0.6) 100%);
  border-top: 1px solid rgba(117, 170, 219, 0.15);
  font-size: 0.84rem;
  color: var(--text-muted);
  animation: fadeInBottom 1.2s ease-out 1.2s backwards;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.footer-powered-by {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--pj-celeste-light);
  opacity: 0.8;
  font-weight: 500;
}

.footer-logo-desarrollar {
  height: 38px;
  width: auto;
  max-width: 190px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 3px 10px rgba(252, 191, 74, 0.45));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.footer-logo-desarrollar:hover {
  transform: translateY(-2px) scale(1.04);
  filter: drop-shadow(0 6px 16px rgba(252, 191, 74, 0.75));
}

/* ==========================================================================
   ANIMACIONES GENERALES
   ========================================================================== */
@keyframes fadeInTop {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInBottom {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MÓVILES)
   ========================================================================== */
@media (max-width: 1080px) {
  .hero-stage-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1rem 2rem 2.5rem;
    text-align: center;
  }
  
  .emblem-wrapper {
    flex-direction: row;
    gap: 1.5rem;
    max-width: 480px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
    transform-origin: center center;
  }
  
  .emblem-svg-container {
    max-width: 90px;
  }
  
  .emblem-caption {
    margin-top: 0;
    text-align: left;
  }
  
  .hero-narrative {
    align-items: center;
  }
  
  .cta-container {
    justify-content: center;
    width: 100%;
  }

  .bottom-info-strip {
    flex-direction: column;
    gap: 0.8rem;
    padding: 1rem 1.5rem;
    text-align: center;
  }
}

@media (max-width: 680px) {
  .top-nav-bar {
    padding: 1rem 1.2rem;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  
  .brand-badge {
    justify-content: center;
    font-size: 0.75rem;
  }
  
  .controls-group {
    justify-content: center;
  }
  
  .hero-stage-content {
    padding: 0.5rem 1rem 2rem;
  }
  
  .emblem-wrapper {
    width: 100%;
    padding: 1rem;
    gap: 1rem;
  }
  
  .emblem-svg-container {
    max-width: 70px;
  }
  
  .btn-login-cinematic {
    width: 100%;
    padding: 1rem 1.8rem;
    font-size: 1.1rem;
    gap: 0.8rem;
  }
  
  .hero-title {
    font-size: 2.1rem;
  }
}

/* ==========================================================================
   SOPORTE ACCESIBLE: PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .panoramic-media,
  .emblem-wrapper,
  .hero-narrative,
  .anamorphic-flare,
  .top-nav-bar,
  .bottom-info-strip {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  #particles-canvas {
    display: none !important;
  }
}

/* ==========================================================================
   ESTADO PAUSADO VÍA JS
   ========================================================================== */
body.motion-paused .panoramic-media,
body.motion-paused .anamorphic-flare {
  animation-play-state: paused !important;
}
