/* ========================================
   IСВС HOME BANKING - COPIA EXACTA
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #FFFFFF;
  color: #333333;
  line-height: 1.5;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* ===== Contenedor principal ===== */
.contenedor-principal {
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  background: #FFFFFF;
  display: flex;
  flex-wrap: nowrap;
  position: relative;
  overflow: hidden;
}

/* ===== Lado izquierdo (imagen - 50% exacto) ===== */
.lado-imagen {
  flex: 1 1 50%;
  max-width: 50%;
  min-width: 0;
  background: #000000;
  position: relative;
  overflow: hidden;
  padding: 0;
  margin: 0;
}

.imagen-fondo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('media/Hombre2_709x854px.jpg');
  background-size: cover;
  background-position: top -40px center;
  background-repeat: no-repeat;
  z-index: 1;
}

@media (max-width: 768px) {
  .lado-imagen {
    display: none;
  }
}

/* ===== Lado derecho (formulario - 50% exacto) ===== */
.lado-formulario {
  flex: 1 1 50%;
  max-width: 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 60px;
  text-align: center;
  background: #FFFFFF;
}

/* Logo IСВС arriba a la derecha */
.logo-icbc-container {
  position: absolute;
  top: 30px;
  right: 80px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icbc {
  width: 65px;
  height: auto;
  display: block;
}

.logo-icbc-icono {
  width: 41px;
  height: 41px;
  display: block;
  margin-left: 8px;
  filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
}

/* ===== Título ===== */
.titulo {
  font-size: 24px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 40px;
  text-align: center;
}

/* ===== Formulario ===== */
#form-login {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 30px;
  width: 100%;
  max-width: 480px;
}

.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  align-items: flex-start;
}

.campo label {
  font-size: 14px;
  font-weight: 400;
  color: #666666;
  margin-left: 4px;
}

.campo input[type="text"],
.campo input[type="password"] {
  width: 100%;
  max-width: 480px;
  padding: 14px 16px;
  border: 1px solid #CCCCCC;
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  background: #FFFFFF;
  transition: border-color 0.3s;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}

.campo input[type="text"]:focus,
.campo input[type="password"]:focus {
  border-color: #999999;
}

.campo input.error {
  border-color: #D32F2F !important;
}

.input-clave input.error {
  border-color: #D32F2F !important;
}

/* Label de usuario en rojo cuando hay error */
#label-usuario.error {
  color: #D32F2F;
}

/* Label de clave en rojo cuando hay error */
#label-clave.error {
  color: #D32F2F;
}

/* Mensaje de error debajo del usuario */
.error-usuario {
  display: none;
  color: #D32F2F;
  font-size: 12px;
  font-weight: normal;
  margin-top: 6px;
  margin-left: 4px;
  align-items: center;
  gap: 6px;
}

.error-usuario.visible {
  display: flex;
}

/* Mensaje de error debajo de la clave */
.error-clave {
  display: none;
  color: #D32F2F;
  font-size: 12px;
  font-weight: normal;
  margin-top: 6px;
  margin-left: 4px;
  align-items: center;
  gap: 6px;
}

.error-clave.visible {
  display: flex;
}

/* Input contraseña con botón ver dentro del campo */
.input-clave {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-clave input[type="password"] {
  padding-right: 50px; /* espacio para el ojo dentro del campo */
}

.btn-ver-clave {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-ver-clave:hover .icono-ver-clave {
  opacity: 0.7;
}

.icono-ver-clave {
  width: 18px;
  height: 18px;
  color: #999999;
}

.icono-oculto,
.icono-visible {
  width: 18px;
  height: 18px;
  color: #999999;
}

/* Teclado virtual */
.teclado {
  display: flex;
  justify-content: flex-start;
  margin-top: -12px;
  width: 100%;
  max-width: 480px;
}

.enlace-teclado {
  font-size: 14px;
  font-weight: 600;
  color: #333333;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}

.enlace-teclado:hover {
  color: #555555;
}

/* Botón Ingresar */
.btn-ingresar {
  background: #E8E8E8;
  color: #666666;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: not-allowed;
  margin-top: 8px;
  transition: background 0.3s;
  width: 50%;
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.6;
  display: block;
}

.btn-ingresar:not([disabled]):hover {
  background: #DDDDDD;
  opacity: 0.8;
  cursor: pointer;
}

/* ===== Opciones ===== */
.opciones {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
  width: 100%;
  max-width: 480px;
  align-items: center;
}

.opcion-crear {
  display: flex;
  justify-content: center;
  width: 100%;
}

.opcion-clave {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 48px;
}

.opcion-ayuda {
  display: flex;
  justify-content: center;
  width: 100%;
}

.enlace-rojo {
  font-size: 16px;
  font-weight: 700;
  color: #D32F2F;
  text-decoration: none;
  cursor: pointer;
}

.enlace-rojo:hover {
  text-decoration: underline;
}

.enlace-normal {
  font-size: 14px;
  font-weight: 700;
  color: #333333;
  text-decoration: underline;
  cursor: pointer;
}

.enlace-normal:hover {
  color: #555555;
}

/* ===== Mensaje ===== */
#mensaje {
  margin-top: 15px;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
}

#mensaje.exito {
  color: #2E7D32;
  font-weight: 600;
}

#mensaje.error {
  color: #D32F2F;
  font-weight: 600;
}

/* ===== Footer ===== */
footer {
  padding: 30px 80px;
  text-align: center;
  color: #333333;
  font-size: 13px;
  line-height: 1.6;
  border-top: 1px solid #EEEEEE;
  max-width: 1440px;
  margin: 0 auto;
}

.footer-texto a {
  color: #333333;
  text-decoration: underline;
  font-weight: 600;
}

.footer-texto a:hover {
  color: #555555;
}

/* ===== Términos y condiciones (al final del lado derecho) ===== */
.terminos-footer {
  font-size: 13px;
  color: #333333;
  text-align: left;
  line-height: 1.6;
  margin-top: 30px;
  width: 100%;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.terminos-footer a {
  color: #333333;
  text-decoration: underline;
  font-weight: 600;
}

.terminos-footer a:hover {
  color: #555555;
}

/* Splash inicial */
.oculto-inicial {
  display: none !important;
}

/* ===== Overlay de carga ===== */
.overlay-carga {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #AAAAAA;
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.overlay-carga.visible {
  display: flex;
}

.tarjeta-carga {
  background: #FFFFFF;
  width: 143px;
  padding: 26px 22px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.spinner-carga {
  width: 56px;
  height: 56px;
  border: 4px solid transparent;
  border-top: 4px solid #D32F2F;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px auto;
}

.carga-texto {
  font-size: 14px;
  color: #333333;
  font-weight: 700;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== Mensaje de error de login ===== */
.mensaje-error-login {
  position: absolute;
  top: 90px;
  right: 80px;
  width: 320px;
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left: 6px solid #D32F2F;
  z-index: 100;
  overflow: hidden;
}

.contenido-error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}

.icono-error {
  width: 24px;
  height: 24px;
  background: #D32F2F;
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.texto-error {
  font-size: 14px;
  color: #333;
  line-height: 1.4;
}

.texto-error strong {
  display: block;
  margin-bottom: 2px;
}

.cerrar-error {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.cerrar-error:hover {
  color: #333;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  footer {
    padding: 30px 20px;
  }

  .lado-formulario {
    padding: 40px 30px;
  }
}
