/* TraDI — login liquid glass (CIDI + Tradi + cambio de contraseña) */

:root {
  --login-glass-fill: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.18) 42%,
    rgba(246, 250, 255, 0.14) 100%
  );
  --login-text: #0b1220;
  --login-text-soft: rgba(15, 23, 42, 0.72);
  --login-accent: #2563eb;
  --login-accent-2: #4f46e5;
  --login-radius: 32px;
  --login-font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Inter', 'Segoe UI', sans-serif;
}

html:has(.login-page) {
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

.login-page,
.login-page * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--login-font) !important;
}

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--login-text);
  overflow-x: hidden;
  overflow-y: auto;
  background: #07111f;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('../Images/login.jpg');
  background-size: cover;
  background-position: 46% 18%;
  background-repeat: no-repeat;
  transform: scale(1.04);
  filter: saturate(1.08) contrast(1.04);
}

.login-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 700px at 18% 22%, rgba(255, 255, 255, 0.12) 0%, transparent 55%),
    linear-gradient(90deg, rgba(4, 10, 22, 0.18) 0%, rgba(4, 10, 22, 0.04) 48%, rgba(8, 16, 32, 0.28) 100%),
    linear-gradient(180deg, rgba(4, 10, 22, 0.08) 0%, transparent 28%, rgba(4, 10, 22, 0.22) 100%);
}

.login-stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: stretch;
  gap: 20px;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.login-hero {
  flex: 1 1 70%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(16px, 3vw, 40px);
  color: #fff;
  animation: loginHeroIn 0.8s ease-out both;
}

.login-hero-inner {
  max-width: 560px;
}

.login-hero-logo {
  width: min(168px, 42vw);
  height: auto;
  display: block;
  margin-bottom: 18px;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}

.login-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: 10px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.login-hero-title {
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 10px;
  text-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.login-hero-tag {
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  max-width: 34ch;
  line-height: 1.5;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
}

.login-glass {
  position: relative;
  isolation: isolate;
  flex: 0 0 30%;
  width: 30%;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--login-radius);
  background: var(--login-glass-fill);
  backdrop-filter: blur(42px) saturate(185%) brightness(1.08);
  -webkit-backdrop-filter: blur(42px) saturate(185%) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    inset 1px 0 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.16);
  animation: loginGlassIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.52) 0%, rgba(255, 255, 255, 0.08) 22%, transparent 46%),
    radial-gradient(420px 220px at 80% -10%, rgba(147, 197, 253, 0.28) 0%, transparent 70%);
}

.login-glass::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-radius: inherit;
  opacity: 0.055;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.login-glass-body {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(22px, 3.2vw, 36px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

.login-heading {
  width: 100%;
  text-align: center;
  margin-bottom: 4px;
}

.login-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(15, 23, 42, 0.48);
  margin-bottom: 8px;
}

.login-title {
  font-size: clamp(1.7rem, 2.6vw, 2.05rem);
  font-weight: 590;
  letter-spacing: -0.035em;
  line-height: 1.15;
  color: var(--login-text);
  margin-bottom: 8px;
  text-wrap: balance;
}

.login-page-cidi .login-glass-body {
  align-items: center;
  text-align: center;
}

.login-page-cidi .login-title {
  width: 100%;
  text-align: center;
  font-weight: 500;
  font-size: clamp(1.85rem, 2.8vw, 2.25rem);
  letter-spacing: -0.045em;
  margin: 0 auto 4px;
  color: #111827;
}

.login-subtitle {
  font-size: 0.92rem;
  color: var(--login-text-soft);
  line-height: 1.45;
  margin-bottom: 20px;
}

.login-copy {
  margin-top: 18px;
  color: var(--login-text-soft);
  font-size: 0.9rem;
  line-height: 1.65;
}

.login-page-cidi .login-copy {
  max-width: 32ch;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.login-logos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.login-logos .logo {
  display: block;
  height: auto;
  max-width: 100%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
  transition: transform 0.25s ease;
}

.login-logos .logo:hover {
  transform: translateY(-3px);
}

.login-logos .logo:first-child {
  width: clamp(72px, 9vw, 108px);
}

.login-logos .logo:last-child {
  width: clamp(96px, 12vw, 132px);
}

.cidi-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 22px 0 0;
  padding: 16px 18px;
  border-radius: 20px;
  text-decoration: none;
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.38) 0%,
    rgba(255, 255, 255, 0.12) 100%
  );
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 8px 24px rgba(15, 23, 42, 0.06),
    inset 0 1px 1px rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.cidi-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.52) 0%,
    rgba(255, 255, 255, 0.2) 100%
  );
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow:
    0 12px 30px rgba(15, 23, 42, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    inset 0 -1px 0 rgba(255, 255, 255, 0.28);
}

.cidi-button:active {
  transform: translateY(0);
}

.logo-cidi {
  width: min(240px, 100%);
  height: auto;
  display: block;
}

.login-page #loginForm,
.login-page #changePassForm {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.login-page .input-group {
  position: relative;
  margin-bottom: 14px;
  min-width: 0;
}

.login-page .form-label {
  font-weight: 600;
  margin-bottom: 6px;
  color: #1e293b;
  font-size: 0.84rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.login-page .form-label-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #475569;
}

.login-page .form-label-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.login-page .inputField {
  width: 100%;
  min-width: 0;
  height: 46px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 14px;
  color: var(--login-text);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 14px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-page .inputField:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.14),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.login-page .inputField::placeholder {
  color: rgba(100, 116, 139, 0.9);
  font-size: 0.92rem;
}

.login-page .password-wrapper {
  position: relative;
  width: 100%;
}

.login-page .password-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.login-page .password-row .password-wrapper {
  flex: 1;
  min-width: 0;
}

.login-page .toggle-password {
  flex-shrink: 0;
  min-width: 96px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  color: #1d4ed8;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  white-space: nowrap;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.login-page .toggle-password:hover {
  background: rgba(37, 99, 235, 0.92);
  border-color: rgba(37, 99, 235, 0.92);
  color: #fff;
}

.login-page #button {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.05) 100%),
    linear-gradient(180deg, #4f8cff 0%, #2563eb 58%, #4f46e5 100%);
  height: 48px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 16px;
  margin: 8px 0 0;
  cursor: pointer;
  box-shadow:
    0 12px 28px rgba(37, 99, 235, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-page #button:hover {
  transform: translateY(-1px);
  box-shadow:
    0 16px 34px rgba(37, 99, 235, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.login-page .error-message {
  color: #b91c1c;
  font-size: 0.75rem;
  margin-top: 4px;
  display: none;
  font-weight: 500;
}

.login-page .login-alert,
.login-page .alert {
  width: 100%;
  padding: 10px 12px;
  margin: 0 0 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 14px;
  word-wrap: break-word;
  background: rgba(254, 226, 226, 0.72);
  border: 1px solid rgba(252, 165, 165, 0.7);
  color: #991b1b;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.login-page .alert {
  animation: loginShake 0.5s ease-in-out;
}

.login-page .helper-text {
  font-size: 0.78rem;
  color: var(--login-text-soft);
  margin-top: 6px;
  line-height: 1.4;
}

.login-page .login-secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.22);
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s ease, color 0.2s ease;
}

.login-page .login-secondary-link:hover {
  background: rgba(255, 255, 255, 0.4);
  color: #0f172a;
}

@keyframes loginHeroIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes loginGlassIn {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .login-glass {
    background: rgba(248, 251, 255, 0.92);
  }

  .login-page .inputField,
  .login-page .toggle-password,
  .cidi-button {
    background: #fff;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-hero,
  .login-glass,
  .login-page .alert {
    animation: none !important;
  }
}

@media (max-width: 960px) {
  .login-stage {
    flex-direction: column;
    justify-content: flex-end;
    gap: 12px;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .login-hero {
    flex: 1 1 auto;
    justify-content: flex-end;
    padding: 18px 8px 8px;
    min-height: 22vh;
  }

  .login-hero-title {
    font-size: clamp(1.7rem, 8vw, 2.4rem);
  }

  .login-glass {
    flex: 0 1 auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    max-height: 72vh;
  }

  .login-glass-body {
    padding: 22px 18px 20px;
  }
}

@media (max-width: 360px) {
  .login-page .password-row {
    flex-direction: column;
  }

  .login-page .toggle-password {
    width: 100%;
    min-height: 42px;
  }

  .logo-cidi {
    width: min(200px, 100%);
  }
}
