/* Login */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Open Sans", "Segoe UI", Helvetica, Arial, sans-serif;
  background-color: #fff;
  color: var(--azul);
}

/* ---------- Lienzo ---------- */
.login {
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 125px 20px 17px;
}

.login__bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("../../img/login.jpg") center / cover no-repeat;
  opacity: 0.23;
  pointer-events: none;
}

.login__content {
  position: relative;
  z-index: 1;
  width: 357px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- Encabezado ---------- */
.login__logo {
  display: block;
  width: 294px;
  height: 54px;
  max-width: 100%;
}

.login__title,
.login__subtitle {
  margin: 70px 0 0;          
  font-size: 40px;
  font-weight: 700;
  line-height: normal;
  color: var(--azul);
  white-space: nowrap;
}

.login__subtitle {
  margin-top: 10px;
  font-size: 30px;
}

/* ---------- Formulario ---------- */
.login__form {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.login__field {
  width: 100%;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--borde-campo);
  border-radius: 26px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  color: var(--texto-campo);
}

.login__field::placeholder { color: var(--texto-campo); }

.login__field:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(36, 59, 124, 0.12);
}

.login__form .login__field { margin-top: 14px; }
.login__form .login__field + .login__field { margin-top: 23px; }

/* ---------- Selector de área ---------- */
.login__area {
  width: 100%;
  margin-top: 14px;          
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login__area-label {
  padding-left: 18px;
  font-size: 12px;
  color: var(--texto-campo);
  white-space: nowrap;
}

.login__select-wrap {
  position: relative;
  width: 227px;
  flex: 0 0 auto;
}

.login__select {
  width: 100%;
  height: 40px;
  padding: 0 42px 0 26px;
  border: 1px solid var(--borde-campo);
  border-radius: 26px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  color: var(--texto-campo);
  appearance: none;
  cursor: pointer;
}

.login__select:focus {
  outline: none;
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(36, 59, 124, 0.12);
}

.login__select-arrow {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  pointer-events: none;
}

/* ---------- Paso 2 · selección de empresa ---------- */
.login__saludo {
  width: 100%;
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--azul);
  text-align: center;
}

.login__campo-label {
  align-self: flex-start;
  margin: 23px 0 6px 18px;
  font-size: 12px;
  color: var(--texto-campo);
}

.login__select-wrap--ancho { width: 100%; }

/* ---------- Recordarme ---------- */
.login__remember {
  align-self: flex-start;
  margin: 23px 0 0 13px;     
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--azul);
  cursor: pointer;
}

.login__checkbox {
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1px solid var(--borde-control);
  border-radius: 0;
  background: #fff;
  appearance: none;
  cursor: pointer;
  display: grid;
  place-content: center;
}

.login__checkbox::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--azul);
  border-bottom: 2px solid var(--azul);
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
}

.login__checkbox:checked::before { opacity: 1; }

.login__checkbox:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(36, 59, 124, 0.12);
}

/* ---------- Botones ---------- */
.login__btn {
  width: 180px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.login__btn--primary {
  margin-top: 44px;          
  background: var(--naranja);
}
.login__btn--primary:hover,
.login__btn--primary:focus-visible { background: var(--naranja-hover); }

.login__btn--secondary {
  margin-top: 31px;          
  background: var(--azul);
  border-color: #fff;
}
.login__btn--secondary:hover,
.login__btn--secondary:focus-visible { background: var(--azul-hover); }

/* ---------- Pie ---------- */
.login__footer {
  margin: 17px 0 0;          
  font-size: 10px;
  font-weight: 400;
  color: var(--azul);
  text-align: center;
}

/* ---------- Validación ---------- */
.login__field.is-invalid,
.login__select.is-invalid { border-color: #dc3545; }

.login__error {
  width: 100%;
  margin: 14px 0 0;
  padding: 10px 18px;
  border: 1px solid #e2b4b8;
  border-radius: 12px;
  background: #fdf2f3;
  font-size: 12px;
  line-height: 1.5;
  color: #8a1c26;
}

/* Sólo aparece cuando el servidor informa clave vencida */
.login__link-clave {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--azul);
  text-decoration: underline;
}

/* ---------- Responsive ---------- */
@media (max-height: 800px) {
  .login { padding-top: 60px; }
}

@media (max-width: 420px) {
  .login { padding: 40px 16px 24px; }
  .login__title { font-size: 30px; }
  .login__subtitle { font-size: 20px; }
  .login__area { flex-direction: column; align-items: stretch; gap: 8px; }
  .login__area-label { padding-left: 18px; }
  .login__select-wrap { width: 100%; }
  .login__remember { margin-left: 0; }
}

.login__aviso {
  width: 100%;
  margin: 14px 0 0;
  padding: 10px 14px;
  border: 1px solid #b7d9b9;
  border-radius: 8px;
  background: #eef7ef;
  color: #1e5b25;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}
