/* ==========================================================
   SESS - SISTEMA DE SERVICIO SOCIAL
   LOGIN INSTITUCIONAL - VERSIÓN 5.1
   ========================================================== */

:root {
  --sess-guinda: #691b32;
  --sess-guinda-dark: #3e1022;
  --sess-rosa: #b0174b;
  --sess-text: #142033;
  --sess-muted: #8793a8;
  --sess-border: #dbe1eb;
  --sess-field: #f6f7fa;
}

/* ==========================================================
   ESTRUCTURA GENERAL
   ========================================================== */

html {
  min-height: 100%;
}

body.sess-login-page {
  margin: 0;
  min-height: 100vh;
  background: #f4f5f7;
  font-family: "Source Sans Pro", Arial, sans-serif;
}

.sess-login-page *,
.sess-login-page *::before,
.sess-login-page *::after {
  box-sizing: border-box;
}

.sess-login-page .wrapper,
.sess-login-page .content-wrapper {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh !important;
  background: transparent !important;
}

.sess-login-page .wrapper {
  overflow: visible;
}

.sess-login-page .sess-login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: 100vh;
}

/* ==========================================================
   PANEL INSTITUCIONAL IZQUIERDO
   ========================================================== */

.sess-login-page .sess-brand-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;

  min-width: 0;
  min-height: 100vh;
  padding: 48px 40px 42px;
  overflow: hidden;
  isolation: isolate;

  background:
    radial-gradient(
      ellipse at 38% 52%,
      rgba(169, 33, 75, 0.3),
      transparent 52%
    ),
    linear-gradient(145deg, #721d38 0%, #5c1730 48%, #3e1022 100%);
}

/* Figura geométrica discreta */

.sess-login-page .sess-brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 52%,
    rgba(28, 5, 18, 0.13) 52%,
    rgba(28, 5, 18, 0.13) 100%
  );
}

.sess-login-page .sess-brand-panel::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 32%;
  height: 32%;
  z-index: -1;
  pointer-events: none;

  background: rgba(255, 255, 255, 0.018);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

/* ==========================================================
   LOGOTIPO INSTITUCIONAL SUPERIOR
   ========================================================== */

.sess-login-page .sess-institutional-header {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
}

.sess-login-page .sess-government-logo {
  display: block;
  width: min(100%, 390px);
  height: auto;
  max-height: 100px;
  object-fit: contain;
}

/* ==========================================================
   LOGOTIPO CENTRAL SESS
   ========================================================== */

.sess-login-page .sess-brand-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
  min-height: 0;
}

.sess-login-page .sess-main-logo {
  display: block;

  /* Logotipo ligeramente más grande */
  width: min(92%, 520px);
  height: auto;
  max-height: 310px;

  object-fit: contain;

  filter: drop-shadow(0 14px 25px rgba(0, 0, 0, 0.12));
}

/* ==========================================================
   PIE INSTITUCIONAL
   ========================================================== */

.sess-login-page .sess-institutional-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-shrink: 0;
}

.sess-login-page .sess-footer-logo {
  display: block;
  width: min(100%, 490px);
  height: auto;
  max-height: 80px;
  object-fit: contain;
}

/* ==========================================================
   PANEL DERECHO
   ========================================================== */

.sess-login-page .sess-form-panel {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 0;
  min-height: 100vh;
  padding: 45px 30px;

  overflow: hidden;
  isolation: isolate;

  background: linear-gradient(135deg, #f9fafb 0%, #f2f3f5 52%, #f8f9fa 100%);
}

/* Figuras geométricas más suaves */

.sess-login-page .sess-form-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background:
    linear-gradient(
      140deg,
      transparent 0%,
      transparent 38%,
      rgba(219, 221, 226, 0.17) 38%,
      rgba(219, 221, 226, 0.17) 49%,
      transparent 49%
    ),
    linear-gradient(
      40deg,
      transparent 0%,
      transparent 76%,
      rgba(255, 255, 255, 0.45) 76%
    );
}

/* ==========================================================
   TARJETA DE INICIO DE SESIÓN
   ========================================================== */

.sess-login-page .sess-login-card {
  position: relative;

  width: 100%;
  max-width: 420px;

  padding: 38px 36px 29px;

  border: 1px solid rgba(226, 229, 234, 0.7);
  border-radius: 19px;

  background: #ffffff;

  box-shadow:
    0 20px 48px rgba(27, 35, 47, 0.1),
    0 4px 14px rgba(27, 35, 47, 0.025);
}

/* ==========================================================
   ENCABEZADO DE TARJETA
   ========================================================== */

.sess-login-page .sess-login-heading {
  margin-bottom: 32px;
  text-align: center;
}

.sess-login-page .sess-login-heading h2 {
  margin: 0 0 8px;

  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;

  color: var(--sess-text);
}

.sess-login-page .sess-login-heading p {
  margin: 0;
  font-size: 12px;
  color: var(--sess-muted);
}

.sess-login-page .sess-heading-line {
  display: block;

  width: 36px;
  height: 3px;

  margin: 17px auto 0;
  border-radius: 5px;

  background: linear-gradient(90deg, var(--sess-guinda), var(--sess-rosa));
}

/* ==========================================================
   CAMPOS DEL FORMULARIO
   ========================================================== */

.sess-login-page .sess-login-card .form-group {
  margin-bottom: 20px;
}

.sess-login-page .sess-login-card label {
  display: block;
  margin-bottom: 8px;

  font-size: 12px;
  font-weight: 700;

  color: var(--sess-text);
}

.sess-login-page .sess-input-wrap {
  position: relative;

  display: flex;
  align-items: center;

  width: 100%;
}

.sess-login-page .sess-input-wrap .form-control {
  display: block;

  width: 100%;
  height: 46px;

  padding: 0 43px 0 42px;

  border: 1px solid var(--sess-border);
  border-radius: 9px;

  background: var(--sess-field);
  box-shadow: none;

  color: var(--sess-text);
  font-size: 13px;
  font-weight: 700;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.sess-login-page .sess-input-wrap .form-control::placeholder {
  color: #98a2b3;
  font-weight: 400;
}

.sess-login-page .sess-input-wrap .form-control:focus {
  outline: none;

  border-color: #a7194c;
  background: #ffffff;

  box-shadow: 0 0 0 3px rgba(167, 25, 76, 0.1);
}

/* ICONOS */

.sess-login-page .sess-input-icon {
  position: absolute;

  left: 15px;
  top: 50%;
  transform: translateY(-50%);

  color: #89919c;
  font-size: 14px;

  pointer-events: none;
  z-index: 2;
}

/* MOSTRAR CONTRASEÑA */

.sess-login-page .sess-password-toggle {
  position: absolute;

  right: 8px;
  top: 50%;
  transform: translateY(-50%);

  display: flex;
  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;

  padding: 0;
  border: none;
  border-radius: 6px;

  background: transparent;
  color: #77869c;

  cursor: pointer;
}

.sess-login-page .sess-password-toggle:hover {
  color: var(--sess-guinda);
  background: #f1edf0;
}

.sess-login-page .sess-password-toggle:focus-visible {
  outline: 2px solid var(--sess-rosa);
  outline-offset: 2px;
}

/* ==========================================================
   AUTOCOMPLETADO CHROME
   ========================================================== */

.sess-login-page input:-webkit-autofill,
.sess-login-page input:-webkit-autofill:hover,
.sess-login-page input:-webkit-autofill:focus {
  -webkit-text-fill-color: #142033 !important;

  -webkit-box-shadow: 0 0 0 1000px #f6f7fa inset !important;

  box-shadow: 0 0 0 1000px #f6f7fa inset !important;

  caret-color: #142033;
  font-weight: 700;

  transition: background-color 9999s ease-out 0s;
}

/* ==========================================================
   BOTÓN INICIAR SESIÓN
   ========================================================== */

.sess-login-page .sess-btn-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  width: 100%;
  min-height: 47px;

  margin-top: 5px;
  padding: 12px 18px;

  border: none;
  border-radius: 9px;

  background: linear-gradient(105deg, #751733 0%, #a9154a 100%);

  color: #ffffff;

  font-size: 13px;
  font-weight: 700;

  cursor: pointer;

  box-shadow: 0 8px 17px rgba(117, 23, 51, 0.17);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.sess-login-page .sess-btn-login:hover {
  color: #ffffff;
  filter: brightness(1.08);
  transform: translateY(-1px);

  box-shadow: 0 10px 20px rgba(117, 23, 51, 0.22);
}

.sess-login-page .sess-btn-login:active {
  transform: translateY(0);
}

.sess-login-page .sess-btn-login:focus-visible {
  outline: 3px solid rgba(169, 21, 74, 0.35);
  outline-offset: 3px;
}

/* ==========================================================
   PRERREGISTRO UNIDAD RECEPTORA
   ========================================================== */

.sess-login-page .sess-register-section {
  margin-top: 25px;
  padding-top: 23px;

  border-top: 1px solid #edf0f3;

  text-align: center;
}

.sess-login-page .sess-register-section h3 {
  margin: 0 0 10px;

  font-size: 16px;
  font-weight: 700;

  color: var(--sess-text);
}

.sess-login-page .sess-register-section p {
  margin: 0 0 19px;

  font-size: 12px;
  line-height: 1.65;

  color: #7d899a;
}

/* Botón más visible */

.sess-login-page .sess-btn-register {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;

  width: 100%;
  min-height: 47px;

  padding: 12px 14px;

  border: 1.5px solid #a71b4c;
  border-radius: 9px;

  background: #fff8fa;
  color: #95183e;

  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.sess-login-page .sess-btn-register i {
  font-size: 15px;
  flex-shrink: 0;
}

.sess-login-page .sess-btn-register:hover {
  background: #95183e;
  color: #ffffff;

  transform: translateY(-1px);

  box-shadow: 0 7px 15px rgba(117, 23, 51, 0.13);
}

.sess-login-page .sess-btn-register:focus-visible {
  outline: 3px solid rgba(169, 21, 74, 0.3);
  outline-offset: 3px;
}

/* ==========================================================
   PIE DE TARJETA
   ========================================================== */

.sess-login-page .sess-card-footer {
  margin-top: 23px;
  padding-top: 17px;

  border-top: 1px solid #edf0f3;

  text-align: center;

  font-size: 10px;
  color: #95a0b0;
}

.sess-login-page .sess-card-footer i {
  margin-right: 4px;
  color: #9a3656;
}

/* ==========================================================
   MENSAJES DE ERROR
   ========================================================== */

.sess-login-page #error-message:empty {
  display: none;
}

.sess-login-page #error-message:not(:empty) {
  margin-top: 12px;
  font-size: 12px;
}

/* ==========================================================
   TABLET
   ========================================================== */

@media (max-width: 991px) {
  .sess-login-page .sess-brand-panel {
    padding: 35px 20px;
  }

  .sess-login-page .sess-government-logo {
    max-width: 290px;
  }

  .sess-login-page .sess-main-logo {
    width: 94%;
    max-height: 240px;
  }

  .sess-login-page .sess-footer-logo {
    max-width: 320px;
  }

  .sess-login-page .sess-form-panel {
    padding: 30px 18px;
  }

  .sess-login-page .sess-login-card {
    padding: 32px 25px 25px;
  }
}

/* ==========================================================
   MÓVIL
   ========================================================== */

@media (max-width: 767px) {
  .sess-login-page .sess-login-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  .sess-login-page .sess-brand-panel {
    min-height: 315px;
    padding: 22px 20px 36px;
    gap: 22px;
  }

  .sess-login-page .sess-government-logo {
    max-width: 240px;
    max-height: 65px;
  }

  .sess-login-page .sess-brand-center {
    flex: 0 0 auto;
  }

  .sess-login-page .sess-main-logo {
    width: min(84%, 285px);
    max-height: 135px;
  }

  .sess-login-page .sess-footer-logo {
    max-width: 310px;
    max-height: 48px;
  }

  .sess-login-page .sess-form-panel {
    flex: 1;
    min-height: auto;
    padding: 0 16px 35px;
    overflow: visible;
  }

  .sess-login-page .sess-login-card {
    margin-top: -17px;
    padding: 29px 24px 25px;

    border-radius: 18px;
    z-index: 1;
  }

  .sess-login-page .sess-login-heading h2 {
    font-size: 24px;
  }

  .sess-login-page .sess-register-section {
    margin-top: 22px;
  }
}

/* ==========================================================
   PANTALLAS PEQUEÑAS
   ========================================================== */

@media (max-width: 380px) {
  .sess-login-page .sess-brand-panel {
    min-height: 285px;
    gap: 17px;
  }

  .sess-login-page .sess-main-logo {
    max-height: 115px;
  }

  .sess-login-page .sess-login-card {
    padding: 25px 19px 22px;
  }

  .sess-login-page .sess-btn-register {
    font-size: 11px;
  }
}

/* ==========================================================
   ACCESIBILIDAD
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
  .sess-login-page *,
  .sess-login-page *::before,
  .sess-login-page *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
