/* Reset */
body, html {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* Imagen de fondo — ahora SIEMPRE CENTRADA */
.fondo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;

  background-size: contain;        /* LA CLAVE */
  background-repeat: no-repeat;
  background-position: center;     /* LA CLAVE */
  background-color: black;

  z-index: -1;
  transition: opacity 0.3s ease;
  animation: fadeIn 1.2s ease forwards;
}

/* Texto overlay */
.overlay-text {
  position: fixed;
  bottom: 10%;
  width: 100%;
  text-align: center;
  font-size: 3rem;
  font-weight: bold;
  color: rgba(9, 31, 226, 0.822);
  animation: fadeText 3s ease-in-out forwards;
}

/* --- Colores y estilo del toggle --- */
:root {
  --pill-bg: rgba(0,0,0,0.35);
  --pill-border: rgba(18, 186, 228, 0.856);
  --indicator-bg: rgba(18,186,228,0.856);
  --inactive-text: white;
  --active-text: white;
}

/* Contenedor */
.lang-switch {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 20;
}

/* Cápsula */
.lang-toggle {
  position: relative;
  display: flex;
  width: 120px;
  background: var(--pill-bg);
  border: 2px solid var(--pill-border);
  backdrop-filter: blur(6px);
  border-radius: 30px;
  padding: 4px;
}

/* Indicador */
.toggle-indicator {
  position: absolute;
  width: 56px;
  height: calc(100% - 8px);
  background: var(--indicator-bg);
  border-radius: 22px;
  transition: transform 0.28s ease;
  left: 4px;
  top: 4px;
}

/* Botones */
.lang-option {
  position: relative;
  z-index: 1;
  width: 56px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--inactive-text);
}

/* Activo */
.lang-option.active {
  color: var(--active-text);
}

/* Toggle ES / ENG */
.lang-toggle.es .toggle-indicator {
  transform: translateX(0);
}

.lang-toggle.eng .toggle-indicator {
  transform: translateX(56px);
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(1.02); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes fadeText {
  0%   { opacity: 0; transform: translateY(15px); }
  20%  { opacity: 1; transform: translateY(0); }
  80%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* Mobile */
@media (max-width: 768px) {
  .overlay-text {
    font-size: 1.7rem;
    bottom: 5%;
  }
}
