let cigarettesPerDay = +prompt('How many cigarettes do you smoke per day?');
let onePackPrice = +prompt('How much does one pack cost?')

let cigarettesPerMonth = cigarettesPerDay * 30;
let packsPerMonth = cigarettesPerMonth / 20;

let totalPricePerMonth = packsPerMonth * onePackPrice;
alert(`You spend ${totalPricePerMonth} for cigarettes every month. Aren\'t you surprised?`)

var credentials = {
    login: 'admin',
    password: 'qwerty',
};

let login = document.querySelector('#login');
let password = document.querySelector('#password');
let loginBtn = document.querySelector('#login-btn');
let message = document.createElement('div');
message.id = 'message'

loginBtn.addEventListener('click', (e) => {
    e.preventDefault()
    if(login.value === credentials.login && password.value === credentials.password) {
        message.innerHTML = 'Successful login'
        message.className = 'success-message'
    } else {
        message.innerHTML = 'Data is wrong!'
        message.className = 'fail-message'
    }
    document.body.append(message)
});
