<?php include 'includes/header.php'; ?>

<style>
/* ===== AUTO IMAGE BACKGROUND ===== */
.login-hero{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
    overflow:hidden;
    background:#020617;
}

/* background image layer */
.bg-layer{
    position:absolute;
    inset:0;
    background-size:cover;
    background-position:center;
    animation:bgZoom 12s ease-in-out infinite;
    transition:opacity 1.2s ease-in-out;
    z-index:1;
}

/* dark overlay */
.login-hero::after{
    content:"";
    position:absolute;
    inset:0;
    background:rgba(2,6,23,.75);
    z-index:2;
}

@keyframes bgZoom{
    from{ transform:scale(1); }
    to{ transform:scale(1.1); }
}

/* ===== GLASS LOGIN CARD ===== */
.login-card{
    position:relative;
    z-index:3;
    background:rgba(255,255,255,0.08);
    backdrop-filter:blur(18px);
    border:1px solid rgba(255,255,255,0.15);
    border-radius:22px;
    padding:40px 35px;
    width:100%;
    max-width:420px;
    box-shadow:0 30px 80px rgba(0,0,0,.45);
    animation:float 6s ease-in-out infinite;
}

@keyframes float{
    0%,100%{ transform:translateY(0); }
    50%{ transform:translateY(-10px); }
}

/* ===== INPUTS ===== */
.login-card .form-control{
    background:rgba(255,255,255,0.08);
    border:1px solid rgba(255,255,255,0.15);
    color:#fff;
    padding:14px 16px;
    border-radius:12px;
}
.login-card .form-control::placeholder{
    color:#94a3b8;
}

/* ===== BUTTON ===== */
.btn-gradient{
    background:linear-gradient(90deg,#22c55e,#38bdf8,#a855f7);
    border:none;
    border-radius:14px;
    padding:14px;
    font-weight:600;
}
.btn-gradient:hover{
    transform:translateY(-2px);
}

/* ===== LINKS ===== */
.login-links a{
    color:#94a3b8;
    font-size:14px;
    text-decoration:none;
}
.login-links a:hover{
    color:#3b82f6;
}
</style>

<section class="login-hero">

    <!-- background layer -->
    <div class="bg-layer" id="bgLayer"></div>

    <!-- login card -->
    <div class="login-card text-center text-white">

        <h3 class="fw-bold mb-2">
            Welcome to <span class="gradient-text">MoblugAPI</span>
        </h3>
        <p class="opacity-75 mb-4">
            Secure Login Dashboard
        </p>

        <form method="post" action="">
            <input type="email" name="email"
                   class="form-control mb-3"
                   placeholder="Email Address" required>

            <input type="password" name="password"
                   class="form-control mb-3"
                   placeholder="Password" required>

            <button class="btn btn-gradient w-100 text-white">
                <i class="fa fa-lock me-2"></i> Login
            </button>
        </form>

        <div class="login-links d-flex justify-content-between mt-4">
            <a href="register.php">Create Account</a>
            <a href="forgot-password.php">Forgot Password?</a>
        </div>

    </div>
</section>

<script>
/* ===== AUTO BACKGROUND IMAGE ROTATOR ===== */
const images = [
    "assets/bg/1.gif",
    "assets/bg/digital-transformation-digital-marketing-business-company-work-removebg-preview.png",
    "assets/bg/Image_20260116_180821.jpg",
    "assets/bg/pngtree-hand-emerging-from-laptop-surrounded-by-technology-and-global-network-icons-png-image_15089420.png"
];

let index = 0;
const bgLayer = document.getElementById("bgLayer");

function changeBackground(){
    bgLayer.style.opacity = 0;

    setTimeout(() => {
        bgLayer.style.backgroundImage = `url('${images[index]}')`;
        bgLayer.style.opacity = 1;
        index = (index + 1) % images.length;
    }, 600);
}

changeBackground();
setInterval(changeBackground, 6000);
</script>

<?php include 'includes/footer.php'; ?>
