@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700&display=swap');
/* =======================================================
   ESTILOS PORTAL SIACOFT - DISEÑO CENTRADO "FLOTANTE"
   ACTUALIZADO CON ICONOS INTERNOS Y ALINEACIÓN DE CLAVE
   ======================================================= */

:root {
  --blue-gradient: linear-gradient(180deg, #112764 0%, #151e38 100%);
  --bg-page: #4b6da0;
  /* Color gris del fondo de la página */
  --bg-light-blue: #6e89a3;
  /* Color gris azulado del panel derecho */
  --white: #ffffff;
  --dark-blue: #1e3a8a;
  --text-main: #1e293b;
  --text-muted: #0e3e92;
  --icon-color: #94a3b8;
  /* Color para los iconos internos */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* EL SECRETO: El Body centra el contenedor en la pantalla */
body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-page);
  height: 100vh;
  display: flex;
  align-items: center;
  /* Centrado vertical */
  justify-content: center;
  /* Centrado horizontal */
  padding: 40px;
}

/* Contenedor principal */
.contenedor {
  display: flex;
  width: 1100px;
  max-width: 100%;
  height: 750px;
  max-height: 90vh;
  background: var(--white);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
}

/* --- PANEL IZQUIERDO --- */
.left-panel {
  flex: 1.2;
  background: var(--blue-gradient);
  color: var(--white);
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* CORRECCIÓN: Centrado horizontal del logo y textos */
  text-align: center;
  /* CORRECCIÓN: Alineación de texto al centro */
}

.logo-principal {
  width: 200px;
  height: 150px;
  margin-top: -40px;
  margin-bottom: 30px;
  display: block;
  /* Asegura que respete el centrado flex */
}

.left-panel h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.0;
  margin-bottom: 5px;
}

.left-panel h2 {
  font-size: 1.3rem;
}

.beneficios {
  list-style: none;
  margin: 10px 0;
}

.beneficios li {
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}

.beneficios li::before {
  content: '\F26A';
  font-family: 'bootstrap-icons';
  margin-right: 12px;
}

.portal-icon-container {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 25px;
  margin-top: 2px;
}

.img-portal {
  width: 70px;
  height: 70px;
}

/* --- PANEL DERECHO --- */
.right-panel {
  flex: 1;
  background-color: var(--bg-light-blue);
  display: flex;
  align-items: center;
  /* Centra la tarjeta blanca verticalmente */
  justify-content: center;
  /* Centra la tarjeta blanca horizontalmente */
  padding: 40px;
}

/* Tarjeta Blanca (Isla central) */
.card-login {
  width: 100%;
  /* Ajuste de altura para que no toque los bordes y se vea centrada */
  max-height: 90%;
  max-width: 380px;
  background-color: var(--white);
  border-radius: 50px;
  padding: 50px 40px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-img {
  width: 120px;
  height: 80px;
  /* margin: 10px auto 15px; */
  margin-top: 40px;
  opacity: 0.7;
}

.card-accesso .sub {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 35px;
}

/* --- FORMULARIO Y NUEVOS GRUPOS DE INPUT --- */
form {
  text-align: left;
}

/* Contenedor para Etiqueta y Link de olvido */
.label-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 15px;
}

label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.link-forgot {
  font-size: 0.8rem;
  color: #3b82f6;
  text-decoration: none;
  font-weight: 500;
}

.link-forgot:hover {
  text-decoration: underline;
}

/* Contenedor para icono + input */
.input-group-custom {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 50px;
  background-color: var(--white);
  transition: 0.3s;
}

/* Iconos de Usuario y Candado a la izquierda */
.icon-field {
  position: absolute;
  left: 20px;
  font-size: 1.1rem;
  color: var(--icon-color);
  pointer-events: none;
}

/* Input modificado para dar espacio al icono */
.input-group-custom input {
  width: 100%;
  padding: 16px 25px 16px 50px;
  /* Padding izquierdo para no tapar el icono */
  border: none;
  border-radius: 50px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  background: transparent;
  outline: none;
}

.input-group-custom:focus-within {
  border-color: var(--dark-blue);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

/* Icono del ojo a la derecha */
.icon-toggle {
  position: absolute;
  right: 20px;
  color: var(--icon-color);
  cursor: pointer;
  font-size: 1.1rem;
}

/* Botón Ingresar */
.btn-primary {
  width: 100%;
  padding: 18px;
  background-color: var(--dark-blue);
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
  cursor: pointer;
  transition: 0.3s;
}

.btn-primary:hover {
  background-color: #1e40af;
  transform: translateY(-2px);
}

.extras {
  margin-top: 25px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.extras a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer {
  display: block;
  margin-top: 40px;
  font-size: 0.7rem;
  color: #cbd5e1;
  text-align: center;
}

/* Responsivo */
@media (max-width: 900px) {
  body {
    padding: 10px;
  }

  .contenedor {
    flex-direction: column;
    height: auto;
    border-radius: 25px;
  }

  .left-panel,
  .right-panel {
    padding: 40px 20px;
  }

  .beneficios,
  .portal-icon-container {
    display: none;
  }

  .card-login {
    max-height: none;
    padding: 40px 25px;
  }
}


/* =======================================================
   REVISIÓN RESPONSIVA FINAL: PRIORIDAD FORMULARIO ABAJO AZUL
   ======================================================= */

@media (max-width: 768px) {
    body {
        padding: 0; /* Eliminamos espacio exterior para ganar amplitud */
        background-color: var(--white); /* Fondo limpio en móvil */
        height: auto;
        display: block; /* Permitir scroll natural */
    }

    .contenedor {
        display: flex;
        flex-direction: column-reverse; /* EL TRUCO: Login (Derecho) ARRIBA, Azul (Izquierdo) ABAJO */
        width: 100%;
        height: auto;
        min-height: 100vh;
        border-radius: 0; /* Sin bordes redondeados externos en móvil */
        box-shadow: none;
    }

    /* --- PANEL DE LOGIN (Ahora aparece primero) --- */
    .right-panel {
        flex: none;
        width: 100%;
        padding: 40px 25px;
        background-color: var(--white);
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .card-login {
        max-width: 100%;
        width: 100%;
        box-shadow: none; /* Diseño plano y limpio */
        padding: 0;
        margin-top: 0;
        height: auto;
        border-radius: 0;
    }

    /* --- PANEL AZUL (Ahora aparece abajo) --- */
    .left-panel {
        flex: none;
        width: 100%;
        padding: 50px 30px;
        background: var(--blue-gradient);
        text-align: center;
        align-items: center;
    }

    /* Ocultamos lo innecesario en móvil para no alargar mucho el scroll */
    .descripcion, .beneficios, .portal-icon-container {
        display: none;
    }

    .logo-principal {
        width: 120px;
        margin-bottom: 15px;
    }

    .left-panel h1 {
        font-size: 1.5rem;
        font-weight: 700;
    }

    /* Ajustes de los campos para dedos (Touch) */
    .input-group-custom input {
        font-size: 1rem; /* Evita que iOS haga zoom automático al clickear */
        padding: 16px 20px 16px 50px;
    }
    
    .btn-primary {
        padding: 20px;
        font-size: 1rem;
    }
}

/* Ajuste para tablets (Se mantiene el diseño original de 2 columnas) */
@media (min-width: 769px) and (max-width: 1100px) {
    .contenedor {
        width: 95%;
        height: 720px;
    }
}