.login-page {
  background: #fff;
}

.login {
  display: grid;
  grid-template-columns: 56.5% 1fr;
  min-height: 100vh;
}

/* Panel izquierdo: imagen con velo verde azulado */
.login__hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(32px, 5.2vw, 100px);
  color: #fff;
  background:
    linear-gradient(
      180deg,
      rgba(8, 72, 96, 0.92) 0%,
      rgba(14, 92, 110, 0.78) 45%,
      rgba(10, 70, 72, 0.55) 75%,
      rgba(6, 50, 40, 0.65) 100%
    ),
    var(--hero-bg) center / cover no-repeat;
  overflow: hidden;
}

.login__hero-content {
  max-width: 720px;
}

.login__logo {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  margin-bottom: 40px;
  border-radius: 16px;
  background: #fff;
  color: var(--green-600);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.login__brand {
  margin: 0 0 20px;
  font-size: clamp(40px, 3.6vw, 68px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.login__tagline {
  max-width: 520px;
  margin: 0;
  font-size: clamp(17px, 1.3vw, 24px);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.78);
}

.login__footer {
  position: absolute;
  left: clamp(32px, 5.2vw, 100px);
  bottom: 52px;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.28);
}

/* Panel derecho: formulario */
.login__panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: #fff;
}

.login__form {
  width: 100%;
  max-width: 500px;
}

.login__title {
  margin: 0 0 14px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.login__subtitle {
  margin: 0 0 54px;
  font-size: 18px;
  color: var(--ink-600);
}

.login__alert {
  margin: -24px 0 28px;
  padding: 12px 16px;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 14px;
}

.field {
  margin-bottom: 34px;
}

.field__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.field__header .field__label {
  margin-bottom: 0;
}

.field__label {
  display: block;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.field__control {
  position: relative;
  display: flex;
  align-items: center;
  height: 68px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--field-bg);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.field__control:focus-within {
  border-color: var(--green-600);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.12);
}

.field__control.is-invalid {
  border-color: var(--danger);
}

.field__icon {
  position: absolute;
  left: 22px;
  color: var(--ink-600);
  pointer-events: none;
}

.field__control input {
  width: 100%;
  height: 100%;
  padding: 0 20px 0 64px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--ink-900);
}

.field__control input::placeholder {
  color: var(--ink-400);
}

/* Evita el fondo amarillo de autocompletado en Chrome */
.field__control input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--field-bg) inset;
  -webkit-text-fill-color: var(--ink-900);
}

.field__error {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--danger);
}

.field__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--green-50);
  color: var(--green-700);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.field__toggle:hover {
  background: #dcfce7;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  height: 74px;
  margin-top: 8px;
  border: 0;
  border-radius: 16px;
  background: var(--green-600);
  color: #fff;
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 30px -10px rgba(22, 163, 74, 0.55);
  transition: background-color 0.15s, transform 0.15s;
}

.btn-primary:hover {
  background: var(--green-700);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled {
  cursor: progress;
}

/* Estado de carga mientras se consulta por AJAX */
.btn-primary__spinner,
.btn-primary__loading {
  display: none;
}

.btn-primary.is-loading {
  background: var(--green-700);
}

.btn-primary.is-loading .btn-primary__label,
.btn-primary.is-loading .btn-primary__icon {
  display: none;
}

.btn-primary.is-loading .btn-primary__spinner,
.btn-primary.is-loading .btn-primary__loading {
  display: inline-block;
}

.btn-primary__spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-primary:focus-visible,
.field__toggle:focus-visible {
  outline: 3px solid rgba(22, 163, 74, 0.35);
  outline-offset: 3px;
}

.login__version {
  margin: 56px 0 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-600);
}

/* Responsive */
@media (max-width: 960px) {
  .login {
    grid-template-columns: 1fr;
  }

  .login__hero {
    min-height: 280px;
    padding: 40px 24px 72px;
  }

  .login__logo {
    width: 56px;
    height: 56px;
    margin-bottom: 24px;
  }

  .login__footer {
    left: 24px;
    bottom: 24px;
  }

  .login__subtitle {
    margin-bottom: 36px;
  }
}

@media (max-width: 480px) {
  .login__panel {
    padding: 36px 16px;
  }

  .login__title {
    font-size: 32px;
  }

  .field__control {
    height: 60px;
  }

  .btn-primary {
    height: 64px;
  }
}
