/* ============================================================
   LOGIN BANCO NACIÓN - CSS PROPIO DESDE CERO (1:1 referencia)
   Paso 1 y Paso 2 - Desktop + Mobile
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* --- RESET MÍNIMO --- */
html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: #333;
  background: #429edc;
  overflow-x: hidden;
}

/* --- OCULTAR ELEMENTOS NO USADOS --- */
.contEstado.ocultar,
#recuadroMensaje.ocultar,
#divDarBienvenida,
.ctdorCkeckRecordar,
#contAvatar,
#vistaSfa,
.login .pie { display: none !important; }

/* ========== HEADER ========== */
.bna-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 12px 24px;
  background: #0087ab;
  width: 100%;
}
.bna-header-logo img {
  height: 36px;
  width: auto;
  max-width: 180px;
  display: block;
  filter: brightness(0) invert(1);
  object-fit: contain;
}
.bna-header-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 20px;
}
.bna-header-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  align-items: center;
}
.bna-header-nav li { display: inline-block; }
.bna-header-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  padding: 6px 4px;
  display: inline-flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}
.bna-header-nav a:hover { text-decoration: underline; }

/* ========== LAYOUT PRINCIPAL ========== */
.bna-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.bna-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0 24px 20px;
  background-image: var(--bna-bg);
  background-size: cover;
  background-position: center top;
  background-color: #429edc;
}
.bna-main-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ========== CAJA FORMULARIO ========== */
.bna-login-box {
  width: 100%;
  max-width: 340px;
  margin: 48px 0 0 auto;
  padding: 24px 28px 22px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.bna-login-box .bna-title {
  text-align: left;
  margin: 0 0 20px;
  padding: 0;
}
.bna-login-box .bna-title img {
  max-height: 40px;
  width: auto;
  margin-bottom: 8px;
  display: block;
}
.bna-login-box .bna-title .bna-welcome {
  margin: 0;
  font-size: 15px;
  color: #0087ab;
  font-weight: 600;
}
.bna-login-box .bna-title .bna-welcome + .bna-welcome {
  font-size: 22px;
  font-weight: 700;
  margin-top: 2px;
}

/* --- Campo Usuario / Clave / Teléfono --- */
.bna-field {
  margin-bottom: 18px;
}
.bna-field:last-of-type { margin-bottom: 0; }
.bna-field-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.bna-field-row .bna-input-wrap { flex: 1; min-width: 0; }
.bna-field label {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #333;
}
.bna-field input[type="text"],
.bna-field input[type="password"],
.bna-field input[type="tel"] {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #b0b0b0;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1.3;
  background: #f8f8f8;
  color: #333;
  -webkit-appearance: none;
  appearance: none;
}
.bna-field input:focus {
  outline: none;
  border-color: #0087ab;
  background: #fff;
}
.bna-field input::placeholder { color: #888; }
.bna-field .bna-help {
  flex-shrink: 0;
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.bna-field .bna-help img {
  width: 20px;
  height: 20px;
  display: block;
}

/* --- Campo sin icono ? (ej. teléfono) --- */
.bna-field-solo .bna-input-wrap { flex: none; width: 100%; }

/* --- Teclado virtual (paso 2) --- */
.bna-teclado {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.bna-teclado label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}
.bna-teclado input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

/* --- Botón INGRESAR --- */
.bna-btn {
  display: block;
  width: 100%;
  margin: 18px 0 16px;
  padding: 14px 20px;
  background: #00addb;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.bna-btn:hover { background: #0199c4; }

/* --- Enlaces de ayuda --- */
.bna-links { margin: 0 0 4px; }
.bna-links a {
  display: block;
  color: #0087ab;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}
.bna-links a:hover { text-decoration: underline; }

/* --- Volver --- */
.bna-back {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e5e5e5;
  text-align: center;
}
.bna-back a {
  display: block;
  color: #224798;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 0;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.bna-back a:hover { text-decoration: underline; }

/* --- Mensaje OK --- */
.bna-msg-ok {
  background: #d4edda;
  color: #155724;
  padding: 12px 14px;
  border-radius: 6px;
  margin: 0 0 14px;
  font-size: 14px;
}

/* ========== FOOTER / ALERTA ========== */
.bna-footer {
  margin-top: auto;
  padding: 16px 20px;
  background: #fff;
}
.bna-footer p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #444;
  word-wrap: break-word;
}
.bna-footer .RedLinkLogoLogin img {
  max-width: 56px;
  height: auto;
  margin-top: 8px;
}

/* ========== MOBILE ========== */
@media (max-width: 768px) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .bna-header { padding: 12px 16px; }
  .bna-header-logo img { height: 30px; max-width: 150px; }
  .bna-header-nav ul { justify-content: center; gap: 4px 12px; }
  .bna-main { padding: 0 16px 16px; }
  .bna-login-box {
    margin: 24px auto 0;
    max-width: 100%;
    padding: 22px 20px 20px;
  }
  .bna-field input { min-height: 48px; font-size: 16px; padding: 14px; }
  .bna-btn { min-height: 52px; padding: 16px; }
  .bna-links a { min-height: 48px; padding: 10px 0; }
  .bna-back a { min-height: 48px; }
}

@media (max-width: 480px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .bna-header { flex-direction: column; align-items: flex-start; }
  .bna-header-nav ul { justify-content: flex-start; font-size: 12px; }
  .bna-header-nav a { padding: 8px 4px; min-height: 44px; }
  .bna-footer { padding: 16px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}
