/* ============================================================
   VARIABLES
============================================================ */

:root {
  --blue-dark: #12345b;
  --blue: #0875c9;
  --blue-soft: #eaf4fc;
  --blue-line: #cfe3f4;
  --text-soft: #6785a4;
  --red: #ed1b2f;

  --green-login: #55ad50;
  --green-login-hover: #489c44;
}

/* ============================================================
   RESET
============================================================ */

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family: Arial, Helvetica, sans-serif;

  color: var(--blue-dark);

  background: #edf6fd;
}

/* ============================================================
   CONTENEDOR PRINCIPAL
============================================================ */

.login-page {
  min-height: 100vh;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 26px 18px 22px;

  background:
    radial-gradient(
      circle at 17% 8%,
      rgba(255, 255, 255, 0.98) 0,
      rgba(255, 255, 255, 0.3) 34%,
      transparent 60%
    ),
    linear-gradient(145deg, #eef7fe 0%, #e7f3fc 48%, #f5faff 100%);
}

.login-container {
  width: 100%;
  max-width: 1065px;
}

/* ============================================================
   TARJETA PRINCIPAL
============================================================ */

.login-card {
  position: relative;

  display: grid;
  grid-template-columns: 44% 56%;

  min-height: 600px;

  overflow: hidden;

  border-radius: 14px;

  background: #fff;

  box-shadow: 0 10px 35px rgba(21, 73, 112, 0.12);
}

/* ============================================================
   PANEL INSTITUCIONAL
============================================================ */

.left-panel {
  position: relative;

  min-width: 0;

  overflow: hidden;

  padding: 48px 52px 46px;

  background: radial-gradient(
    circle at 70% 16%,
    rgba(255, 255, 255, 0.98) 0,
    rgba(238, 248, 255, 0.92) 45%,
    rgba(220, 238, 252, 0.9) 100%
  );
}

.left-content {
  position: relative;
  z-index: 2;

  max-width: 430px;
}

/* ============================================================
   LOGO INSTITUCIONAL
============================================================ */

.logo-container {
  margin-bottom: 23px;
}

.logo {
  display: block;
  margin: 0 auto;
  width: 178px;
  max-width: 100%;
  height: auto;
}

/* ============================================================
   IDENTIDAD INSTITUCIONAL
============================================================ */

.institution-title {
  text-align: left;
}

.institution-title h1 {
  margin: 0;

  color: var(--blue-dark);

  font-size: 23px;
  line-height: 1.08;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.45px;
}

.government-text {
  margin-top: 7px;
    text-align: center;
  color: #718eac;

  font-size: 21px;
  font-weight: 400;
}

.title-line {
  display: flex;

  width: 100%;
  max-width: 400px;
  height: 6px;

  margin-top: 17px;

  overflow: hidden;

  border-radius: 2px;
}

.title-line .red {
  width: 60%;

  background: var(--red);
}

.title-line .blue {
  width: 40%;

  background: var(--blue);
}

/* ============================================================
   MENSAJE INSTITUCIONAL
============================================================ */

.institution-message {
  position: relative;
  z-index: 2;

  max-width: 370px;

  margin-top: 35px;
  padding-left: 2px;
}

.institution-message-label {
  color: #56789a;

  font-size: 13px;
  font-weight: 800;

  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.institution-message p {
  margin: 8px 0 0;

  color: #7895b1;

  font-size: 15px;
  line-height: 1.45;
}

/* ============================================================
   DECORACIÓN PANEL IZQUIERDO
============================================================ */

.left-decoration {
  position: absolute;
  z-index: 1;

  left: -125px;
  bottom: -125px;

  width: 610px;
  height: 225px;

  border-radius: 50%;

  background: #d5eafa;

  transform: rotate(9deg);
}

.left-decoration::before {
  content: "";

  position: absolute;

  left: 5px;
  bottom: 58px;

  width: 520px;
  height: 70px;

  border-radius: 50%;

  background: #e8f4fd;
}

.left-decoration::after {
  content: "";

  position: absolute;

  left: 100px;
  bottom: 74px;

  width: 190px;
  height: 8px;

  background: rgba(8, 117, 201, 0.22);

  transform: rotate(17deg);
}

/* ============================================================
   PANEL DERECHO
============================================================ */

.right-panel {
  position: relative;

  min-width: 0;

  display: flex;
  align-items: center;

  padding: 38px 44px;

  overflow: hidden;

  background: #fff;
}

/* ============================================================
   CAJA DE LOGIN
============================================================ */

.login-box {
  position: relative;
  z-index: 3;

  width: 100%;
  max-width: 510px;

  margin: 0 auto;
  padding: 30px 35px 26px;

  border-radius: 13px;

  background: #fff;

  box-shadow: 0 4px 22px rgba(29, 84, 125, 0.09);
}

/* ============================================================
   ENCABEZADOS
============================================================ */

.welcome-text {
  margin-bottom: 5px;

  color: #718aa6;

  font-size: 14px;
  font-weight: 700;

  letter-spacing: 1.6px;
}

.login-box h2 {
  margin: 0;

  color: #102f55;

  font-size: 36px;
  line-height: 1.08;
  font-weight: 800;
}

.login-description {
  margin: 7px 0 26px;

  color: #708aa5;

  font-size: 15px;
  line-height: 1.35;
}

/* ============================================================
   VISTAS DE LOGIN
============================================================ */

.login-view {
  opacity: 0;
  visibility: hidden;

  transform: translateY(8px);

  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    visibility 0.3s ease;
}

.login-view.active {
  opacity: 1;
  visibility: visible;

  transform: translateY(0);
}

#loginNormal {
  display: none;
}

#loginNormal.active {
  display: block;
}

/* ============================================================
   BOTÓN VOLVER
============================================================ */

.back-login {
  display: inline-flex;
  align-items: center;

  gap: 5px;

  margin-bottom: 14px;
  padding: 0;

  border: 0;

  background: transparent;

  color: #3976a5;

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;
}

.back-login:hover {
  color: #075da8;
}

/* ============================================================
   FORMULARIO
============================================================ */

.form-field {
  margin-bottom: 16px;
}

.form-label {
  display: block;

  margin-bottom: 7px;

  color: #16385f;

  font-size: 13px;
  font-weight: 700;
}

.password-label {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;
}

.password-label a {
  color: #3d6d99;

  font-size: 12px;
  font-weight: 700;

  text-decoration: none;
}

.password-label a:hover {
  text-decoration: underline;
}

/* ============================================================
   INPUTS
============================================================ */

.custom-input {
  height: 45px;

  overflow: hidden;

  border: 1px solid #cbdfee;
  border-radius: 7px;

  background: #fff;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.custom-input:focus-within {
  border-color: var(--blue);

  box-shadow: 0 0 0 3px rgba(8, 117, 201, 0.1);
}

.custom-input .input-group-text {
  width: 43px;

  justify-content: center;

  border: 0;

  background: transparent;

  color: #6386a7;

  font-size: 18px;
}

.custom-input .form-control {
  border: 0;

  color: #244e75;

  font-size: 14px;

  box-shadow: none;
}

.custom-input .form-control::placeholder {
  color: #91abc2;
}

.custom-input .form-control:focus {
  box-shadow: none;
}

/* ============================================================
   MOSTRAR / OCULTAR CONTRASEÑA
============================================================ */

.password-toggle {
  width: 42px;

  border: 0;

  background: transparent;

  color: #6789a8;

  cursor: pointer;
}

.password-toggle:focus {
  outline: none;
}

/* ============================================================
   RECORDARME
============================================================ */

.remember-check {
  display: flex;
  align-items: center;

  gap: 3px;

  margin: 2px 0 17px;
}

.remember-check .form-check-input {
  width: 17px;
  height: 17px;

  border-color: #89a9c4;

  cursor: pointer;
}

.remember-check .form-check-label {
  margin-left: 4px;

  color: #547798;

  font-size: 12px;

  cursor: pointer;
}

/* ============================================================
   BOTÓN INGRESAR DEL FORMULARIO
============================================================ */

.btn-login {
  height: 45px;

  border: 0;
  border-radius: 7px;

  background: var(--green-login);

  color: #fff;

  font-size: 16px;
  font-weight: 700;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.btn-login:hover {
  background: var(--green-login-hover);

  color: #fff;

  transform: translateY(-1px);
}

.btn-login:active {
  transform: translateY(0);
}

/* ============================================================
   DECORACIÓN PANEL DERECHO
============================================================ */

.right-decoration {
  position: absolute;

  right: -160px;
  bottom: -160px;

  width: 470px;
  height: 220px;

  border-radius: 50%;

  background: rgba(222, 240, 252, 0.65);

  transform: rotate(-9deg);
}

/* ============================================================
   FOOTER DE SEGURIDAD
============================================================ */

.security-footer {
  position: relative;
  z-index: 5;

  min-height: 105px;

  display: flex;
  align-items: center;

  gap: 26px;

  margin-top: 14px;
  padding: 17px 28px;

  overflow: hidden;

  border: 1px solid #d4e6f4;
  border-radius: 11px;

  background: rgba(255, 255, 255, 0.9);

  box-shadow: 0 5px 20px rgba(22, 76, 113, 0.08);
}

.security-footer::before {
  content: "";

  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 3px;

  background: linear-gradient(90deg, var(--blue) 0 40%, var(--red) 40% 100%);
}

.security-footer-heading {
  min-width: 220px;
}

.security-footer-title {
  color: #15385f;

  font-size: 15px;
  font-weight: 800;
}

.security-footer-subtitle {
  margin-top: 4px;

  color: #7893ad;

  font-size: 11px;
  line-height: 1.35;
}

.footer-item {
  display: flex;
  align-items: center;

  gap: 11px;

  flex: 1;

  color: #4f7192;

  font-size: 11px;
  line-height: 1.35;
}

.footer-icon {
  width: 38px;
  height: 38px;

  flex: 0 0 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #c5deef;
  border-radius: 50%;

  background: #edf7fd;

  color: #1667a7;

  font-size: 17px;
}

.footer-separator {
  width: 1px;
  height: 46px;

  flex: 0 0 1px;

  background: #d9e7f1;
}

/* ============================================================
   MENSAJE DE ERROR
============================================================ */

.login-alert {
  width: 100%;
  max-width: 510px;
  margin: 0 auto 14px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid #f0c7c7;
  border-radius: 8px;
  background: #fff5f5;
  color: #8f3030;
}

.login-alert-icon {
  flex: 0 0 auto;
  padding-top: 1px;
  font-size: 17px;
}

.login-alert-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.login-alert-content strong {
  font-size: 13px;
  font-weight: 800;
}

.login-alert-content span {
  font-size: 12px;
  line-height: 1.4;
}

/* ============================================================
   RESPONSIVE - TABLET
============================================================ */

@media (max-width: 991px) {
  .login-page {
      padding: 20px;
  }

  .login-card {
      display: flex;
      flex-direction: column;
  }

  .right-panel {
      order: 1;
  }

  .left-panel {
      order: 2;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .left-panel {
    min-height: 365px;

    padding: 34px 40px;
  }

  .left-content {
    max-width: none;
  }

  .logo {
    width: 155px;
  }

  .institution-title h1 {
    font-size: 25px;
  }

  .right-panel {
    padding: 28px;
  }

  .login-box {
    max-width: 650px;
  }

  .security-footer {
    flex-wrap: wrap;

    gap: 18px;
  }

  .security-footer-heading {
    width: 100%;
    min-width: 0;
  }

  .footer-item {
    min-width: 0;
  }
}

/* ============================================================
   RESPONSIVE - MÓVIL
============================================================ */

@media (max-width: 767px) {
  .login-page {
    padding: 10px;
  }

  .left-panel {
    min-height: 330px;

    padding: 27px 24px 34px;
  }

  .logo {
    width: 145px;
  }

  .institution-title h1 {
    font-size: 23px;
  }

  .government-text {
    font-size: 18px;
  }

  .title-line {
    max-width: 290px;
  }

  .institution-message {
    margin-top: 25px;
  }

  .right-panel {
    padding: 12px;
  }

  .login-box {
    padding: 24px 17px 22px;
  }

  .login-box h2 {
    font-size: 31px;
  }

  .login-description {
    margin-bottom: 22px;
  }

  .security-footer {
    align-items: flex-start;
    flex-direction: column;

    gap: 16px;

    padding: 22px 20px 18px;
  }

  .security-footer-heading {
    width: 100%;
  }

  .footer-item {
    width: 100%;
  }

  .footer-separator {
    display: none;
  }
}
