/* ===== Reset/Setup ===== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
}

/* ===== Fondo ===== */
.main-background {
  background-image: url("Fondo.PNG");
  background-size: cover;
  background-position: center;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100svh; /* usa svh para móviles modernos */
  padding: clamp(12px, 2vw, 24px);
}

/* ===== Card principal =====
   Escala desde tu base 900×500 sin quedar enano en 1920.
   - Ancho: mínimo 900px, crece hasta ~1200px, pero nunca más del 92vw.
   - Alto: mínimo 500px, crece en proporción hasta ~680px o 80vh (lo que limite primero).
*/
.login-card {
  display: flex;
  width: clamp(900px, 62vw, min(92vw, 1200px));
  height: clamp(500px, 52vh, 680px);
  border-radius: 25px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  background-color: #ffffff;
  animation: zoomIn 0.6s ease forwards;
  opacity: 0;
}

/* Animación sutil de entrada */
@keyframes zoomIn {
  0% { opacity: 0; transform: scale(0.97); }
  100% { opacity: 1; transform: scale(1); }
}

/* ===== Columnas ===== */
.login-left,
.login-right {
  flex: 1 1 0;
  min-width: 0; /* evita overflow de texto */
}

/* Lado izquierdo */
.login-left {
  padding: clamp(24px, 3vw, 48px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 16px);
}

/* Logo y título escalan suavemente */
.logo {
  width: clamp(170px, 14vw, 240px);
  height: auto;
  margin-bottom: clamp(8px, 1.2vw, 16px);
}

.titulo {
  font-size: clamp(20px, 1.8vw, 28px);
  color: #19105f;
  margin: 0 0 clamp(8px, 1.2vw, 16px) 0;
}

/* Inputs: crecen, pero con límites */
form input[type="text"],
form input[type="password"] {
  width: clamp(280px, 22vw, 360px);
  padding: clamp(10px, 1.1vw, 14px) clamp(14px, 1.2vw, 18px);
  margin: clamp(8px, 1.1vw, 12px) 0;
  font-size: clamp(14px, 1.1vw, 16px);
  text-align: center;
  border-radius: 50px;
  border: 1px solid #ccc;
  transition: border-color 0.3s;
  box-sizing: border-box;
}

form input[type="text"]:focus,
form input[type="password"]:focus {
  border-color: #00508d;
  outline: none;
}

/* Separador rosa */
#div1 {
  height: 3px;
  width: clamp(48px, 5vw, 72px);
  background-color: #ed206b;
  margin: 0 auto clamp(10px, 1.2vw, 14px);
  border-radius: 2px;
}

/* Botón */
#submitBtn {
  width: clamp(280px, 22vw, 360px);
  padding: clamp(10px, 1.1vw, 14px) clamp(14px, 1.2vw, 18px);
  margin: clamp(14px, 1.5vw, 20px) 0 0 0;
  background-color: #00508d;
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: clamp(14px, 1.1vw, 16px);
  box-shadow: 0 8px 15px rgba(0, 80, 141, 0.2);
  transition: background-color 0.2s ease, transform 0.06s ease;
  display: block;
}

#submitBtn:hover { background-color: #1f66b4; }
#submitBtn:active { transform: translateY(1px); }

/* Errores */
.error-text {
  color: red;
  font-size: clamp(12px, 1vw, 14px);
  height: 18px;
  margin-top: clamp(4px, .6vw, 8px);
  text-align: center;
}

/* Lado derecho con formas */
.login-right {
  background-color: #813400;
  color: #f5eae3;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-right::before,
.login-right::after {
  content: "";
  position: absolute;
  opacity: 0.06;
  pointer-events: none;
}

.login-right::before {
  width: clamp(380px, 32vw, 680px);
  height: clamp(380px, 32vw, 680px);
  background-color: #f5eae3;
  border-radius: 50%;
  top: -18%;
  left: -12%;
  transform: rotate(45deg);
}

.login-right::after {
  width: clamp(260px, 22vw, 480px);
  height: clamp(260px, 22vw, 480px);
  background-color: #f5eae3;
  border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
  bottom: -14%;
  right: -10%;
  transform: rotate(-25deg);
}

.design-text {
  position: relative;
  text-align: center;
  padding: clamp(16px, 2vw, 24px);
  z-index: 1;
  max-width: min(80%, 34rem);
}

.design-text h1 {
  font-size: clamp(28px, 3vw, 40px);
  margin: 0 0 clamp(6px, .8vw, 10px) 0;
  color: #f5eae3;
}

.design-text p {
  font-size: clamp(14px, 1.2vw, 18px);
  color: #f5eae3;
  opacity: 0.9;
  margin: 0;
}

/* ===== Modal de carga ===== */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

.custom-modal-content {
  background-color: #fff;
  margin: 15% auto;
  padding: 20px 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-modal {
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

/* Overlay de loading centrado */
#loadingOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 9998;
  justify-content: center;
  align-items: center;
}

#loadingSpinner {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #00508d;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Ajustes para pantallas muy grandes (≥1920) ===== */

@media (min-width: 1920px) {
  .login-card {
    width: clamp(980px, 50vw, 1320px);
    height: clamp(560px, 52vh, 740px);
  }
}


