/* Pantalla de ingreso, formularios, botones, diálogos y utilidades. */

/* ---------------- Login ---------------- */

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  display: flex;
  width: 100%;
  max-width: 920px;
  min-height: 520px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.login-side {
  flex: 1;
  background: #14304f;
  --logo-bg: #14304f;
  color-scheme: dark;
  border-right: 1px solid var(--border);
  color: white;
  padding: 44px 40px 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-logo {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.login-logo svg { width: 100%; height: 100%; }

.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.login-brand h1 { font-family: var(--font-head); font-size: 26px; margin: 0; letter-spacing: 0.5px; font-weight: 800; }
.login-side, .login-card { border-color: rgba(255,255,255,0.12); }

.login-tagline { color: #eef3f9; font-size: 15px; line-height: 1.4; margin: 0 0 4px; }
.login-sistema { color: #9fb4cc; font-size: 13px; margin: 0; }

/* Logotipo grande y tenue como marca de agua del panel */
.login-marca {
  position: absolute; right: -70px; bottom: -60px; width: 340px; height: 340px;
  opacity: 0.07; pointer-events: none;
}
.login-marca svg { width: 100%; height: 100%; }

.login-footer { position: absolute; left: 40px; bottom: 26px; font-size: 12px; color: #9fb4cc; }
.login-ayuda { margin: 18px 0 0; font-size: 12.5px; color: var(--text-faint); text-align: center; }

.login-form-side { flex: 1; background: var(--bg-1); padding: 56px 48px; display: flex; flex-direction: column; justify-content: center; }
.login-form-side h2 { margin: 0 0 26px; font-size: 24px; font-family: var(--font-head); }

.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 14px;
  font-family: var(--font-body);
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-faint); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.field-pass-wrap { position: relative; }
.field-pass-wrap .toggle-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: var(--text-dim); background: none; border: none; font-size: 15px;
}

.btn {
  border: none;
  border-radius: 9px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: #2568bd; }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.btn-teal { background: var(--teal); color: white; }
.btn-teal:hover { background: #4d8ad1; }
.btn-secondary { background: var(--bg-3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-3); }
.btn-danger { background: rgba(229,86,109,0.14); color: var(--red); }
.btn-danger:hover { background: rgba(229,86,109,0.24); }
.btn-redsolid { background: #d43a3a; color: white; }
.btn-redsolid:hover { background: #e04848; }
.btn-small { padding: 7px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.login-links { text-align: right; margin-top: -8px; margin-bottom: 20px; }
.login-links a { font-size: 13px; color: var(--teal); text-decoration: none; }

.form-error {
  background: rgba(229,86,109,0.12);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.form-error.visible { display: block; }
.form-error.ok { background: var(--teal-dim); color: var(--teal); }

@media (max-width: 720px) {
  .login-card { flex-direction: column; min-height: 0; }
  .login-side { padding: 26px 24px 20px; gap: 6px; }
  .login-footer, .login-marca { display: none; }
}

/* Cuadros de confirmación y de texto (js/vistas/dialogos.js) */
.modal-dialogo { max-width: 420px; }
.dialogo-msg { color: var(--text-dim); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
.modal-dialogo .field { margin-bottom: 4px; }

/* Utilidades de maquetación (antes escritas como estilos dentro del JS) */
.fila-flex { display: flex; align-items: center; gap: 8px; }
.acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 0; }
.w-auto { width: auto !important; }
.m-0 { margin: 0 !important; }
.mr-8 { margin-right: 8px; }
.mt-26 { margin-top: 26px; }
.scroll-x { overflow-x: auto; }
.toolbar.entre { justify-content: space-between; }
.ancho-total { grid-column: 1 / -1; }
.texto-tenue { font-size: 12px; color: var(--text-faint); }
.texto-tenue.normal { font-size: inherit; font-weight: 400; }
.aviso-peligro { color: var(--red); font-size: 13px; }
.ambar { color: var(--amber) !important; }
.est-meta-sep { margin: 12px 0 6px; }
.rl-dot.ok { background: var(--ok); }
.rl-dot.proc { background: var(--teal); }
.rl-dot.sin { background: var(--estado-sin); }

/* Indicador de carga */
.spin {
  display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--border-strong); border-top-color: var(--teal); border-radius: 50%;
  animation: girar 0.8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }

/* Íconos de la barra superior */
.tb-ico { vertical-align: -3px; color: var(--text-faint); flex-shrink: 0; }
