:root {
  --isatec-primary: #1E22FF;
  --isatec-secondary: #21D4F8;
  --isatec-dark: #0A1B5E;
  --isatec-light: #F7FAFC;
  --isatec-alt: #EDF5FF;
  --isatec-text: #1F2937;
  --isatec-success: #10B981;
  --glass-bg: rgba(10, 27, 94, 0.62);
  --glass-border: rgba(255, 255, 255, 0.14);
  --white-soft: rgba(255, 255, 255, 0.88);
  --input-bg: rgba(237, 245, 255, 0.13);
  --input-border: rgba(255, 255, 255, 0.14);
  --shadow-card: 0 28px 90px rgba(3, 7, 31, 0.62);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  background-color: var(--isatec-dark);
}

.login-page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: visible;
  isolation: isolate;
}

.login-page>.container-fluid {
  height: auto;
  min-height: 100vh !important;
  min-height: 100svh !important;
  overflow: visible;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -4;
  background-image:
    linear-gradient(115deg, rgba(10, 27, 94, 0.60), rgba(10, 27, 94, 0.40), rgba(30, 34, 255, 0.0)),
    url("../img/fondo.webp");
  background-size: cover;
  background-position: right;
  background-repeat: no-repeat;
}

.login-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(circle at 18% 22%, rgba(33, 212, 248, 0.28), transparent 8%),
    radial-gradient(circle at 82% 80%, rgba(30, 34, 255, 0.32), transparent 10%),
    linear-gradient(90deg, rgba(3, 7, 31, 0.52), rgba(3, 7, 31, 0.22));
  pointer-events: none;
}

.background-glow {
  position: fixed;
  z-index: -2;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.45;
}

.background-glow-1 {
  top: -90px;
  right: 12%;
  background: var(--isatec-secondary);
}

.background-glow-2 {
  bottom: -120px;
  left: 14%;
  background: var(--isatec-primary);
}

.login-shell {
  max-width: 1180px;
  height: 750px;
  min-height: 750px;
  max-height: none;
  border: 1px solid var(--glass-border);
  border-radius: 34px;
  overflow: hidden;
  background: rgba(6, 18, 57, 0.1);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
}

.brand-panel {
  position: relative;
  height: 100%;
  min-height: 0;
  padding: clamp(1.6rem, 3.2vw, 3.1rem);
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(10, 27, 94, 0.07), rgba(6, 18, 57, 0.05)),
    linear-gradient(45deg, rgba(33, 212, 248, 0.08), transparent 55%);
}

.brand-panel::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 8%;
  width: 1px;
  height: 84%;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.08), transparent);
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo-wrap {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.20), 0 16px 40px rgba(0, 0, 0, 0.20);
}

.brand-logo {
  max-width: 58px;
  max-height: 58px;
  object-fit: contain;
}

.brand-logo-fallback {
  display: none;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 18px;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  background: linear-gradient(135deg, var(--isatec-primary), var(--isatec-secondary));
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: rgba(247, 250, 252, 0.70);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before,
.section-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--isatec-success);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.8);
}

.brand-title {
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 1;
}

.brand-heading {
  margin-top: clamp(1.6rem, 3vh, 2.4rem);
  max-width: 500px;
  font-size: clamp(1.3rem, 2.45vw, 2rem);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.brand-copy {
  max-width: 540px;
  margin-top: 1.05rem;
  color: rgba(247, 250, 252, 0.78);
  font-size: 0.95rem;
  line-height: 1.65;
}

.stat-card {
  height: 100%;
  min-height: 118px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(33, 212, 248, 0.42);
  background: rgba(255, 255, 255, 0.10);
}

.stat-card i {
  display: inline-flex;
  margin-bottom: 0.7rem;
  color: var(--isatec-secondary);
  font-size: 1.35rem;
}

.stat-card strong,
.stat-card span {
  display: block;
}

.stat-card strong {
  margin-bottom: 0.32rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.stat-card span {
  color: rgba(247, 250, 252, 0.68);
  font-size: 0.78rem;
  line-height: 1.5;
}

.brand-footer {
  margin-top: 1.8rem;
  color: rgba(247, 250, 252, 0.58);
  font-size: 0.76rem;
}

.form-panel {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100%;
  min-height: 0;
  padding: clamp(1.2rem, 3vw, 3.2rem);
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 18%, rgba(33, 212, 248, 0.15), transparent 31%),
    rgba(6, 18, 57, 0.34);
}

.auth-card {
  display: flex;
  flex-direction: column;
  width: min(100%, 500px);
  height: auto;
  max-height: none;
  margin-block: auto;
  padding: clamp(1.15rem, 2.3vw, 1.75rem);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  overflow: visible;
  background: var(--glass-bg);
  box-shadow: 0 22px 70px rgba(3, 7, 31, 0.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.forms-stage {
  position: relative;
  width: 100%;
  min-height: auto;
  overflow: visible;
  padding-right: 0;
}

.brand-panel::-webkit-scrollbar {
  width: 6px;
}

.auth-form {
  width: 100%;
  transition: opacity 0.38s ease, transform 0.38s ease, visibility 0.38s ease;
}

.auth-form:not(.active) {
  position: absolute;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.form-login.active {
  transform: translateX(0);
}

.form-login:not(.active) {
  transform: translateX(-34px) scale(0.985);
}

.form-recovery {
  transform: translateX(34px) scale(0.985);
}

.form-recovery.active {
  transform: translateX(0) scale(1);
}

.form-intro h2 {
  margin: 0.55rem 0 0.45rem;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.form-intro p {
  margin: 0;
  color: rgba(247, 250, 252, 0.68);
  font-size: 0.91rem;
  line-height: 1.55;
}

.form-label {
  color: rgba(247, 250, 252, 0.78);
  font-size: 0.84rem;
  font-weight: 600;
}

.custom-input {
  border-radius: 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  overflow: hidden;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.custom-input:focus-within {
  border-color: rgba(33, 212, 248, 0.68);
  box-shadow: 0 0 0 0.24rem rgba(33, 212, 248, 0.12);
  background: rgba(237, 245, 255, 0.17);
}

.custom-input .input-group-text,
.custom-input .form-control,
.custom-input .form-select {
  min-height: 54px;
  border: 0;
  color: #fff;
  background: transparent;
}

.custom-input .input-group-text {
  padding-left: 1rem;
  padding-right: 0.8rem;
  color: var(--isatec-secondary);
}

.custom-input .form-control,
.custom-input .form-select {
  padding-left: 0.25rem;
  padding-right: 1rem;
  font-size: 0.92rem;
  box-shadow: none;
}

.custom-input .form-select {
  cursor: pointer;
  background-image: none;
}

.custom-input .form-control::placeholder {
  color: rgba(247, 250, 252, 0.48);
}

.custom-input .form-control:focus,
.custom-input .form-select:focus {
  box-shadow: none;
}

.custom-input select option {
  color: var(--isatec-text);
}

.password-toggle {
  cursor: pointer;
}

.password-toggle:hover {
  color: #fff;
}

.btn-isatec {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 56px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  font-size: 0.96rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--isatec-primary), var(--isatec-secondary));
  box-shadow: 0 18px 38px rgba(30, 34, 255, 0.30);
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.22s ease;
}

.btn-isatec:hover,
.btn-isatec:focus-visible {
  color: #fff;
  transform: translateY(-2px);
  filter: saturate(1.08);
  box-shadow: 0 24px 46px rgba(30, 34, 255, 0.40);
}

.btn-isatec i {
  font-size: 1.25rem;
}

.link-recovery {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 0.25rem;
  border: 0;
  color: rgba(247, 250, 252, 0.76);
  font-size: 0.88rem;
  font-weight: 600;
  background: transparent;
  transition: color 0.2s ease, transform 0.2s ease;
}

.link-recovery:hover,
.link-recovery:focus-visible {
  color: var(--isatec-secondary);
  transform: translateY(-1px);
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
  box-shadow: none;
}

.was-validated .custom-input:has(.form-control:invalid),
.was-validated .custom-input:has(.form-select:invalid) {
  border-color: rgba(255, 99, 132, 0.75);
  box-shadow: 0 0 0 0.24rem rgba(255, 99, 132, 0.10);
}

.toast {
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

/* =========================================================
   FOOTER INSTITUCIONAL
========================================================= */

.brand-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;

  width: 100%;
  margin-top: 1.8rem;
  padding-top: 1.15rem;

  border-top: 1px solid rgba(255, 255, 255, 0.08);

  color: rgba(247, 250, 252, 0.52);
  font-size: 0.72rem;
  line-height: 1.4;
}

.brand-footer span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-footer span:first-child {
  color: rgba(247, 250, 252, 0.62);
}

.brand-footer i {
  color: var(--isatec-success);
  font-size: 0.9rem;
  filter: drop-shadow(0 0 7px rgba(16, 185, 129, 0.35));
}


/* =========================================================
   MENSAJE DE SEGURIDAD
========================================================= */

.security-message {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(247, 250, 252, 0.48);
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
}

.security-message i {
  flex: 0 0 auto;
  color: var(--isatec-success);
  font-size: 0.95rem;
  filter: drop-shadow(0 0 7px rgba(16, 185, 129, 0.35));
}

.security-message span {
  display: inline-block;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1199.98px) {
  .login-shell {
    max-width: 1040px;
  }

  .brand-heading {
    font-size: clamp(1.3rem, 2.8vw, 1.85rem);
  }

  .brand-footer {
    font-size: 0.68rem;
  }
}

@media (max-width: 991.98px) {
  .login-shell {
    max-width: 560px;
    height: 750px;
    min-height: 650px;
    max-height: none;
    border-radius: 28px;
  }

  .brand-panel {
    display: none !important;
  }

  .form-panel {
    width: 100%;
    height: 100%;
    padding: clamp(1rem, 4vw, 2rem);
  }

  .auth-card {
    width: 100%;
  }

  .security-message {
    margin-top: 1.25rem;
    padding-top: 1rem;
    font-size: 0.7rem;
  }
}

@media (max-width: 575.98px) {
  .login-page>.container-fluid {
    padding: 0.5rem !important;
  }

  .login-shell {
    height: 650px;
    min-height: 650px;
    max-height: none;
    border-radius: 24px;
  }

  .form-panel {
    height: 100%;
    padding: 0.75rem;
  }

  .auth-card {
    padding: 0.95rem;
    border-radius: 22px;
  }

  .form-intro {
    margin-bottom: 1.1rem !important;
  }

  .form-intro h2 {
    font-size: 1.45rem;
  }

  .form-intro p {
    font-size: 0.86rem;
  }

  .custom-input .input-group-text,
  .custom-input .form-control,
  .custom-input .form-select,
  .btn-isatec {
    min-height: 50px;
  }

  .security-message {
    gap: 0.4rem;
    margin-top: 1.1rem;
    padding-top: 0.95rem;
    font-size: 0.67rem;
  }

  .security-message i {
    font-size: 0.88rem;
  }
}

@media (max-height: 679.98px) {
  .brand-stats {
    margin-top: 1rem !important;
  }

  .stat-card {
    min-height: 104px;
    padding: 0.85rem;
  }

  .brand-copy {
    line-height: 1.5;
  }

  .form-intro {
    margin-bottom: 1rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}