@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Playfair+Display:wght@400;500;600&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

.museo-header {
  width: 100%;
  background-color: #1a1a1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 0;
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  overflow: hidden; /* Contains the wave */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.bg-wave-header {
  position: absolute;
  bottom: -1px; /* Align with bottom */
  left: 0;
  width: 100%;
  height: 60px; /* Adjust height of the wave */
  z-index: -1; /* Behind the content */
  pointer-events: none;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.header-left {
  display: flex;
  align-items: center;
}

.logo-header {
  height: 50px; /* Tamaño optimizado para el header */
  width: auto;
  background-color: #ffffff; /* Fondo blanco para que el logo resalte sobre el gris oscuro */
  padding: 6px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), 0 0 8px rgba(227, 6, 19, 0.15); /* Sombra con un toque del rojo institucional */
  border: 2px solid #e30613; /* Borde rojo que define el espacio del logo */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10; /* Above the sliding icon */
}

.logo-header:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 12px rgba(227, 6, 19, 0.25);
  background-color: #fdfdfd;
}

.header-nav ul {
  list-style: none;
  display: flex;
  gap: 25px;
  margin: 0;
  padding: 0;
}

.header-nav a {
  color: #e2e8f0;
  text-decoration: none;
  font-weight: 800;
  font-size: 1rem;
  transition: color 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.header-nav a:hover {
  color: #e30613;
}

.header-nav a.block_nav {
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.7;
}

body {
  background: #0a0f18;
  color: #e2e8f0;
  margin: 0;
  min-height: 100vh;
  padding-top: 80px; /* Espacio para el header fijo */
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bg-wave {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  display: block;
  z-index: 0;
  pointer-events: none;
}

.hero-container {
  width: 100%;
  height: calc(100vh - 80px);
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
  overflow: hidden;
  min-height: 80vh;
}

.hero-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 50px 0;
  width: min(1200px, 100%);
  min-height: 560px;
  position: relative;
  --level2-offset-x: clamp(180px, 20vw, 240px);
  --level3-offset-x: clamp(320px, 33vw, 400px);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.form_main {
  width: 260px;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #1e293b;
  color: #f1f5f9;
  padding: 25px;
  box-shadow: 0px 0px 40px rgba(0, 0, 0, 0.5);
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  position: absolute;
  top: 50%;
  left: 50%;
  margin: 0;
  z-index: 1;
  user-select: none;
  overflow: hidden;
  text-decoration: none; /* Added for link support */
  /* Smooth and solid transition */
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              filter 0.5s ease,
              box-shadow 0.5s ease,
              z-index 0s; /* Immediate z-index change to prevent overlap */
  will-change: transform, filter, box-shadow;
}

.form_main:focus-visible {
  outline: 2px solid #e30613;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.28), 0px 20px 40px rgba(0, 0, 0, 0.45);
}

.form_main::before {
  position: absolute;
  content: "";
  width: 300px;
  height: 300px;
  background-color: #e30613;
  transform: rotate(45deg);
  left: -180px;
  bottom: 0px;
  z-index: 1;
  border-radius: 30px;
}

.logo {
  position: relative;
  z-index: 2;
  width: 140px; /* Adjusted size */
  height: auto;
  margin: 20px auto;
  display: block;
  /* Orange-Red Filter for SVG */
  filter: invert(27%) sepia(91%) saturate(3052%) hue-rotate(346deg) brightness(96%) contrast(106%);
  transition: filter 0.5s ease, transform 0.5s ease;
}

.logo_inheader{
  position: relative;
  z-index: 5; /* Lower than logo-header */
  width: 60px; /* Slightly smaller for a cleaner fit */
  height: auto;
  margin-left: 15px; /* Space after logo */
  display: inline-block;
  /* Clean White Filter for contrast with Red Wave */
  filter: invert(100%) brightness(100%) contrast(100%);
  transition: all 0.3s ease;
  vertical-align: middle;
  opacity: 0; /* Start hidden for animation */
  animation: slideOutFromLogo 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.5s; /* Delay for visual impact */
}

@keyframes slideOutFromLogo {
  0% {
    transform: translateX(-120px); /* Start hidden behind the logo */
    opacity: 0;
  }
  30% {
    opacity: 0; /* Keep hidden while strictly behind the logo */
  }
  100% {
    transform: translateX(0); /* Final position */
    opacity: 0.9;
  }
}

.logo_inheader:hover {
  opacity: 1;
  transform: scale(1.05);
}

.nav-icon {
  width: 20px;
  height: auto;
  vertical-align: middle;
  margin-left: 5px;
  filter: invert(100%); /* Default white for dark background */
  transition: filter 0.3s ease;
}

.header-nav a:hover .nav-icon {
  filter: invert(14%) sepia(87%) saturate(6295%) hue-rotate(351deg) brightness(91%) contrast(104%); /*Institutional Red */
}

/* Remove extra glow when active */
.level-1 .logo {
  filter: invert(27%) sepia(91%) saturate(3052%) hue-rotate(346deg) brightness(110%) contrast(110%)
          ; /* Reduced and kept subtle */
}

.form_main:first-child {
  margin-left: 0 !important;
}

/* Specific zoom levels - ensuring solid look and smooth blur transitions */
.form_main.level-1 {
  transform: translate(-50%, -50%) scale(1.3) !important;
  opacity: 1 !important;
  filter: blur(0);
  z-index: 100;
  box-shadow: 0px 30px 60px rgba(0, 0, 0, 0.6); /* Pure neutral shadow */
  border-color: #e30613;
}

.form_main.level-2 {
  transform: translate(-50%, -50%) scale(1.05);
  opacity: 1;
  filter: blur(3px);
  z-index: 50;
}

.form_main.level-3 {
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 1;
  filter: blur(8px) grayscale(0.4);
  z-index: 10;
}

/* Infinite carousel offsets (desktop) */
.form_main.level-2.prev { transform: translate(calc(-50% - var(--level2-offset-x)), -50%) scale(1.05); }
.form_main.level-2.next { transform: translate(calc(-50% + var(--level2-offset-x)), -50%) scale(1.05); }
.form_main.level-3.prev { transform: translate(calc(-50% - var(--level3-offset-x)), -50%) scale(0.85); }
.form_main.level-3.next { transform: translate(calc(-50% + var(--level3-offset-x)), -50%) scale(0.85); }

/* Adjust title visibility in cards */
.title_text {
  font-size: 1.6rem;
  color: #FFFF;
  font-weight: 700;
  margin: 5px 0 10px 0;
  z-index: 2;
  font-family: 'Poppins', sans-serif;
  text-align: center;
  letter-spacing: 0.5px;
}

.buttons-container {
  width: 100%;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  z-index: 2;
  margin-top: 10px;
}

.inputContainer {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.inputIcon {
  position: absolute;
  left: 3px;
}

.inputField {
  width: 100%;
  height: 30px;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid rgb(173, 173, 173);
  margin: 10px 0;
  color: black;
  font-size: .8em;
  font-weight: 500;
  box-sizing: border-box;
  padding-left: 30px;
}

.inputField:focus {
  outline: none;
  border-bottom: 2px solid #e30613;
}

.inputField::placeholder {
  color: #94a3b8;
  font-size: 1em;
  font-weight: 500;
}

.forgotLink {
  z-index: 2;
  font-size: .7em;
  font-weight: 500;
  color: #cbd5e1;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 20px;
}

.hero_nav_level1{
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  width: 100%;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, 
    rgba(0, 0, 0, 0.7) 0%, 
    rgba(0, 0, 0, 0.5) 50%, 
    rgba(227, 6, 19, 0.3) 100%);
  z-index: 1;
}

.hero-content .titulo {
  position: relative;
  z-index: 2;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 600;
  color: #e30613;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 20px 40px;
  font-family: 'Poppins', sans-serif;
}

@keyframes titleGlow {
  0% {
    text-shadow: 
      0 0 20px rgba(0, 0, 0, 0.5),
      0 0 40px rgba(227, 6, 19, 0.3),
      2px 2px 4px rgba(0, 0, 0, 0.8);
  }
  100% {
    text-shadow: 
      0 0 30px rgba(0, 0, 0, 0.6),
      0 0 60px rgba(227, 6, 19, 0.5),
      2px 2px 8px rgba(0, 0, 0, 0.9);
  }
}

/* Estilos para la sección de contenido */
section {
  max-width: 1200px;
  margin: 60px auto;
  padding: 40px 20px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}

section h2 {
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  line-height: 1.9;
  color: #e2e8f0;
  text-align: justify;
  margin: 0;
  font-weight: 400;
  font-family: 'Crimson Text', serif;
  letter-spacing: 0.02em;
  text-indent: 2em;
}

h3 {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  color: #f1f5f9;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(1.5rem, 2.8vw, 2rem);
}

section p {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.8;
  color: #e2e8f0;
  margin: 0;
  font-family: 'Crimson Text', serif;
}

.footer_nav_level1{
  width: 100%;
  min-height: 100px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding: 18px 20px;
  bottom: 0;
  left: 0;
  z-index: 1;
  box-sizing: border-box;
  text-align: center;
}

.footer_nav_level1 p {
  margin: 6px 0;
  color: #cbd5e1;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
}

/* Transiciones suaves entre páginas */
.page-transition {
  animation: pageFadeIn 0.8s ease-out forwards;
}

.page-transition-out {
  animation: pageFadeOut 0.6s ease-in forwards;
}

@keyframes pageFadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes pageFadeOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

/* Animaciones específicas para elementos */
.hero-transition {
  animation: heroSlideIn 1s ease-out forwards;
}

.content-transition {
  animation: contentSlideUp 1.2s ease-out forwards;
}

@keyframes heroSlideIn {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes contentSlideUp {
  0% {
    opacity: 0;
    transform: translateY(40px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Transiciones para enlaces de navegación */
.nav-link-transition {
  position: relative;
  transition: all 0.3s ease;
}

.nav-link-transition::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #e30613;
  transition: width 0.3s ease;
}

.nav-link-transition:hover::after {
  width: 100%;
}

/* Prevenir parpadeo durante transición */
.page-loading {
  pointer-events: none;
}

.page-loading * {
  pointer-events: none !important;
}

/* ===== MEDIA QUERIES ===== */

/* Large screens */
@media (min-width: 1920px) {
  .header-container,
  section,
  h3 {
    max-width: 1440px;
  }

  .hero-stack {
    padding: 40px 0;
    gap: 0;
    width: min(1400px, 100%);
    --level2-offset-x: clamp(220px, 16vw, 300px);
    --level3-offset-x: clamp(400px, 29vw, 520px);
  }

  .form_main {
    width: 290px;
    min-height: 410px;
  }
}

/* Medium-large screens */
@media (max-width: 1366px) {
  .header-container {
    max-width: 1100px;
  }

  .header-nav ul {
    gap: 16px;
  }

  .form_main {
    width: 220px;
    min-height: 330px;
  }

  .hero-stack {
    --level2-offset-x: clamp(160px, 18vw, 210px);
    --level3-offset-x: clamp(290px, 28vw, 350px);
  }

  .logo {
    width: 115px;
  }

  .title_text {
    font-size: 1.5em;
  }
}

/* Medium screens */
@media (max-width: 1200px) {
  body {
    padding-top: 92px;
  }

  .header-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 0 14px;
  }

  .header-nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 14px;
  }

  .hero-container {
    height: auto;
    min-height: calc(100vh - 92px);
    padding: 20px 14px 30px;
    box-sizing: border-box;
  }

  .hero-stack {
    flex-wrap: nowrap;
    gap: 0;
    padding: 18px 0;
    width: min(1000px, 100%);
    min-height: 520px;
    --level2-offset-x: clamp(130px, 16vw, 180px);
    --level3-offset-x: clamp(250px, 25vw, 300px);
  }

  .form_main {
    width: 210px;
    min-height: 300px;
    margin: 0 !important;
  }
}

/* Tablets and small screens */
@media (max-width: 768px) {
  .hero-content .titulo {
    font-size: clamp(2rem, 6vw, 3.5rem);
    padding: 15px 25px;
  }

  section {
    margin: 40px 20px;
    padding: 30px 20px;
    border-radius: 15px;
  }
  
  section h2 {
    font-size: 1.1rem;
    line-height: 1.7;
    text-align: justify;
    font-family: 'Crimson Text', serif;
    text-indent: 1.5em;
  }

  body.museo-home {
    padding-top: 126px;
    overflow: hidden;
    height: 100vh;
  }

  .museo-header {
    padding: 10px 0 14px;
  }

  .header-container {
    gap: 10px;
  }

  .header-left {
    width: 100%;
    justify-content: center;
  }

  .logo-header {
    height: 42px;
    padding: 5px 12px;
  }

  .logo_inheader {
    width: 45px;
    margin-left: 8px;
    animation: none;
    opacity: 0.9;
  }

  .header-nav ul {
    gap: 8px 12px;
  }

  .header-nav a {
    font-size: 0.92rem;
  }

  .hero-container,
  .hero_nav_level1 {
    min-height: calc((var(--mobile-vh, 1vh) * 100) - 126px);
    height: calc((var(--mobile-vh, 1vh) * 100) - 126px);
    padding: 0 12px;
    box-sizing: border-box;
    align-items: center;
  }

  .hero-stack {
    flex-wrap: nowrap;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 8px 0;
    width: 100%;
    min-height: 500px;
    position: relative;
    transition: transform 0.24s cubic-bezier(0.25, 0.8, 0.25, 1);
    --level2-offset-y: clamp(62px, calc(var(--mobile-vh, 1vh) * 8.5), 96px);
    --level3-offset-y: clamp(118px, calc(var(--mobile-vh, 1vh) * 15.5), 168px);
  }

  .hero-stack.is-dragging {
    transition: none;
  }

  .form_main {
    width: min(320px, 82vw);
    min-height: 240px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: 0 !important;
    transition: transform 0.38s cubic-bezier(0.25, 0.8, 0.25, 1),
                filter 0.32s ease,
                box-shadow 0.32s ease;
  }

  .form_main:first-child {
    margin: 0 !important;
  }

  .form_main.level-1 {
    transform: translate(
      -50%,
      calc(-50% + (var(--mobile-drag-y, 0px) * 0.92))
    ) scale(1.12) !important;
    filter: blur(0) !important;
    z-index: 100;
  }

  .form_main.level-2 {
    transform: translate(
      -50%,
      calc(-50% + (var(--mobile-drag-y, 0px) * 0.72))
    ) scale(0.94) !important;
    filter: blur(2px) !important;
    z-index: 50;
  }

  .form_main.level-3 {
    transform: translate(
      -50%,
      calc(-50% + (var(--mobile-drag-y, 0px) * 0.52))
    ) scale(0.78) !important;
    filter: blur(6px) grayscale(0.35) !important;
    z-index: 10;
  }

  .form_main.level-2.prev { transform: translate(-50%, calc(-50% - var(--level2-offset-y) + (var(--mobile-drag-y, 0px) * 0.72))) scale(0.94) !important; }
  .form_main.level-2.next { transform: translate(-50%, calc(-50% + var(--level2-offset-y) + (var(--mobile-drag-y, 0px) * 0.72))) scale(0.94) !important; }
  .form_main.level-3.prev { transform: translate(-50%, calc(-50% - var(--level3-offset-y) + (var(--mobile-drag-y, 0px) * 0.52))) scale(0.78) !important; }
  .form_main.level-3.next { transform: translate(-50%, calc(-50% + var(--level3-offset-y) + (var(--mobile-drag-y, 0px) * 0.52))) scale(0.78) !important; }

  .form_main.level-1,
  .form_main.level-2,
  .form_main.level-3 {
    margin: 0 !important;
  }

  .logo {
    width: 95px;
    margin: 12px auto;
  }

  .title_text {
    font-size: 1.4rem;
  }

  .hero-content .titulo {
    font-size: clamp(1.7rem, 7vw, 2.5rem);
    padding: 12px 18px;
  }

  section {
    margin: 22px 12px;
    padding: 20px 14px;
    border-radius: 14px;
  }

  section h2 {
    font-size: 1rem;
    line-height: 1.65;
    text-indent: 1em;
  }

  section p {
    font-size: 1rem;
    line-height: 1.65;
  }

  h3 {
    font-size: 1.35rem;
    padding: 0 14px;
  }

  .footer_nav_level1 {
    padding: 14px 12px;
  }

  .footer_nav_level1 p {
    font-size: 0.86rem;
    margin: 4px 0;
  }
}

/* Mobile phones */
@media (max-width: 480px) {
  body.museo-home {
    padding-top: 142px;
    overflow: hidden;
    height: 100vh;
  }

  .museo-header {
    padding: 8px 0 12px;
  }

  .logo-header {
    height: 36px;
    border-width: 1px;
    border-radius: 10px;
  }

  .logo_inheader {
    width: 34px;
  }

  .header-nav a {
    font-size: 0.82rem;
  }

  .header-nav ul {
    gap: 6px 10px;
  }

  .hero-container,
  .hero_nav_level1 {
    min-height: calc((var(--mobile-vh, 1vh) * 100) - 142px);
    height: calc((var(--mobile-vh, 1vh) * 100) - 142px);
    padding: 0 8px;
    align-items: center;
  }

  .hero-stack {
    min-height: 410px;
    --level2-offset-y: clamp(48px, calc(var(--mobile-vh, 1vh) * 7.8), 82px);
    --level3-offset-y: clamp(92px, calc(var(--mobile-vh, 1vh) * 13.8), 140px);
  }

  .form_main {
    width: min(230px, 86vw);
    min-height: 205px;
    padding: 14px;
    border-radius: 18px;
    margin: 0 !important;
  }

  .form_main.level-1 { transform: translate(-50%, calc(-50% + (var(--mobile-drag-y, 0px) * 0.92))) scale(1.08) !important; }
  .form_main.level-2 { transform: translate(-50%, calc(-50% + (var(--mobile-drag-y, 0px) * 0.72))) scale(0.88) !important; }
  .form_main.level-3 { transform: translate(-50%, calc(-50% + (var(--mobile-drag-y, 0px) * 0.52))) scale(0.72) !important; }

  .form_main.level-2.prev { transform: translate(-50%, calc(-50% - var(--level2-offset-y) + (var(--mobile-drag-y, 0px) * 0.72))) scale(0.88) !important; }
  .form_main.level-2.next { transform: translate(-50%, calc(-50% + var(--level2-offset-y) + (var(--mobile-drag-y, 0px) * 0.72))) scale(0.88) !important; }
  .form_main.level-3.prev { transform: translate(-50%, calc(-50% - var(--level3-offset-y) + (var(--mobile-drag-y, 0px) * 0.52))) scale(0.72) !important; }
  .form_main.level-3.next { transform: translate(-50%, calc(-50% + var(--level3-offset-y) + (var(--mobile-drag-y, 0px) * 0.52))) scale(0.72) !important; }

  .form_main.level-1,
  .form_main.level-2,
  .form_main.level-3 {
    margin: 0 !important;
  }

  .form_main::before {
    width: 220px;
    height: 220px;
    left: -130px;
  }

  .title_text {
    font-size: 1.3rem;
  }

  .logo {
    width: 80px;
  }

  section {
    margin: 18px 10px;
    padding: 16px 12px;
    border-radius: 12px;
  }

  section h2,
  section p {
    font-size: 0.95rem;
    line-height: 1.55;
    text-indent: 0;
  }

  h3 {
    font-size: 1.15rem;
    padding: 0 12px;
  }

  .hero-content .titulo {
    padding: 10px 14px;
  }

  .footer_nav_level1 p {
    font-size: 0.8rem;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .form_main,
  .hero-stack {
    transition: none !important;
  }
}
