:root {
  --brand-teal-700: #006879;
  --brand-teal-600: #007F91;
  --action-blue-700: #084BB8;
  --action-blue-600: #0B5FEA;
  --neutral-950: #0B1F3A;
  --neutral-700: #526581;
  --neutral-500: #72839B;
  --neutral-300: #B8C5D4;
  --neutral-200: #D9E2EC;
  --neutral-100: #EEF3F8;
  --neutral-050: #F5F8FC;
  --surface-base: #FFFFFF;
  --danger-700: #B4232D;
  --danger-100: #FDEBEC;
  --success-700: #087A55;
  --success-100: #E5F7EF;
  --focus-ring: #74A7FF;
  --shadow-modal: 0 16px 40px rgba(11, 31, 58, .18);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: "Inter", system-ui, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  color: var(--neutral-950);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  font-family: inherit;
}

/* ---------- Fondo con patrón clínico ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background-color: var(--neutral-950);
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .10) 1.4px, transparent 0);
  background-size: 26px 26px;
  position: relative;
}

.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 25% 20%, rgba(0, 127, 145, .35), transparent 55%),
    radial-gradient(ellipse at 80% 80%, rgba(11, 95, 234, .30), transparent 55%);
}

/* ---------- Tarjeta flotante ---------- */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: var(--surface-base);
  border-radius: 20px;
  box-shadow: var(--shadow-modal);
  padding: 40px 36px 32px;
}

@media (max-width: 480px) {
  .login-card {
    padding: 32px 24px 26px;
  }
}

.login-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--brand-teal-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.brand-mark img {
  width: 64%;
  height: 64%;
  object-fit: contain;
  display: block;
}

.brand-lockup {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--neutral-950);
}

/* ---------- Mensajes flash ---------- */
.flashMessages:empty {
  display: none;
}

.flashMessages {
  margin: 4px 0 22px;
}

.flashMessages .error,
.flashMessages .flash-error,
.flashMessages .flash-success {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 1px 2px rgba(11, 31, 58, .06);
}

.flashMessages .error::before,
.flashMessages .flash-error::before,
.flashMessages .flash-success::before {
  font: normal 900 14px "Font Awesome 6 Free";
  flex: none;
  line-height: 1.5;
}

.flashMessages .error,
.flashMessages .flash-error {
  background: var(--danger-100);
  color: var(--danger-700);
  border: 1px solid var(--danger-700);
}

.flashMessages .error::before,
.flashMessages .flash-error::before {
  content: "\f06a";
}

.flashMessages .flash-success {
  background: var(--success-100);
  color: var(--success-700);
  border: 1px solid var(--success-700);
}

.flashMessages .flash-success::before {
  content: "\f058";
}

/* ---------- Campos ---------- */
.campo-login {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.campo-login label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--neutral-700);
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--neutral-300);
  border-radius: 8px;
  background: var(--surface-base);
  padding: 0 12px;
  height: 44px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.input-wrap:focus-within {
  border-color: var(--action-blue-600);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.input-wrap i {
  flex: none;
  color: var(--neutral-500);
  font-size: 14px;
  width: 16px;
  text-align: center;
}

.input-wrap .campo-form {
  flex: 1;
  min-width: 0;
}

.login-input,
input[type="text"].login-input,
input[type="password"].login-input {
  border: none;
  outline: none;
  width: 100%;
  height: 44px;
  font-family: inherit;
  /* 16px mínimo: por debajo de eso, iOS/Chrome móvil hacen zoom automático
     al enfocar el input y no siempre regresan al tamaño original. */
  font-size: 16px;
  color: var(--neutral-950);
  background: transparent;
  text-align: left;
  padding: 0;
}

.login-input::placeholder {
  color: var(--neutral-500);
}

.toggle-pass {
  flex: none;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--neutral-500);
  display: flex;
  align-items: center;
  padding: 4px;
}

.toggle-pass:hover {
  color: var(--action-blue-600);
}

/* El macro de WTForms mete el <input> y sus errores en el mismo bloque
   (.campo-form dentro de .input-wrap) -- sin esto, el mensaje de error
   queda apretado contra el ícono, dentro del propio recuadro del campo. */
.validators {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
}

.campo-login:has(.validations-error) {
  margin-bottom: 32px;
}

.validations-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--danger-700);
  margin-top: 6px;
}

.validations-error::before {
  font: normal 900 11px "Font Awesome 6 Free";
  content: "\f06a";
  flex: none;
}

/* ---------- Botón de acceso ---------- */
.grupo_submit {
  margin-top: 8px;
}

.btn-sesion {
  width: 100%;
  height: 46px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--action-blue-600);
  color: var(--surface-base);
  font-family: inherit;
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 1px 2px rgba(11, 31, 58, .12);
  transition: background-color .15s ease;
}

.btn-sesion:hover {
  background: var(--action-blue-700);
}

.btn-sesion:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ---------- Enlaces legales ---------- */
.politicas-privacidad {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.politicas-privacidad a {
  font-size: 12px;
  color: var(--neutral-700);
  text-decoration: none;
}

.politicas-privacidad a:hover {
  color: var(--action-blue-600);
  text-decoration: underline;
}
