/* ========================= */
/* 🔐 LAYOUT LOGIN */
/* ========================= */

.screen {
  height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

h2 {
  color: var(--text-primary);
}

/* ELEMENTOS BASE */
button {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  border-radius: 8px;
  border: none;
  background: rgba(26, 26, 46, 0.95);
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* FONDO ANIMADO */
.background {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.background-slide {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: backgroundScroll 30s linear infinite;
}

.background-slide:nth-child(1) { top: 0%; }
.background-slide:nth-child(2) { top: 100%; }
.background-slide:nth-child(3) { top: 200%; }
.background-slide:nth-child(4) { top: 300%; }

/* OVERLAY */
.background::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0.2)),
    linear-gradient(120deg, rgba(16,185,129,0.4), rgba(0,0,0,0.4));
  pointer-events: none;
}

/* LOGO WRAPPER — a la derecha */
.logo-wrapper {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  z-index: 3;
  display: flex;
  justify-content: center;
  order: 2;
  animation: none;
  margin-left: -60px;
}

/* centrar el fondo glass detrás del logo */
.logo-wrapper::before {
  left: 50%;
  border-radius: 0 60px 60px 0;
}

/* CARD LOGIN — a la izquierda */
.login-card {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  width: min(400px, 90vw);
  padding: 50px 40px;
  z-index: 4;
  order: 1;
}

.login-card::before {
  border-radius: 20px 0 0 20px;
}

/* CONTENIDO */
.card-content {
  position: relative;
  z-index: 5;
}

/* ANIMACIONES */
@keyframes backgroundScroll {
  100% {
    transform: translateY(-300%);
  }
}

/* MODAL RECUPERAR CONTRASEÑA */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal.is-open {
  display: flex;
}

.modal-content {
  width: min(440px, 100%);
  background: var(--bg-elevated);
  border-radius: 26px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-light);
  position: relative;
}

.modal-content h2 {
  margin: 0 0 18px;
  font-size: 1.35rem;
  color: var(--text-primary);
}

.modal-content input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border-medium);
  background: var(--bg-input);
  margin-bottom: 18px;
  color: var(--text-primary);
  font-size: 0.98rem;
}

.modal-content input:focus {
  outline: none;
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.modal-content button {
  background: rgba(16, 185, 129, 0.95);
  color: white;
}

#cerrarModal {
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

#cerrarModal:hover {
  color: var(--text-primary);
}

/* ERROR EN INPUTS */
.field .input-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* ========================= */
/* 📱 RESPONSIVE LOGIN */
/* ========================= */

@media (max-width: 768px) {
  .screen {
    flex-direction: column;
    justify-content: center;
    gap: 0;
    padding: 20px;
  }

  .logo-wrapper {
    display: none;
  }

  .login-card {
    width: 100%;
    padding: 40px 24px 30px;
  }

  .login-card::before {
    border-radius: 20px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 36px 18px 24px;
  }

  .login-card h2 {
    font-size: 1.2rem;
  }
}