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

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>WAK POS - Login</title>
    <script src="<?php echo base_url(); ?>js/jquery-1.2.6.min.js" type="text/javascript"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Arial, sans-serif;
            min-height: 100vh;
            background:
                linear-gradient(135deg, rgba(26, 26, 46, 0.88) 0%, rgba(22, 33, 62, 0.88) 50%, rgba(15, 52, 96, 0.88) 100%),
                url('<?php echo base_url(); ?>images/backimg.jpg') center center / cover no-repeat fixed;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
        }

        /* ── Animated floating orbs ── */
        .orb {
            position: absolute;
            border-radius: 50%;
            filter: blur(60px);
            opacity: 0.18;
            animation: floatOrb linear infinite;
            pointer-events: none;
        }

        .orb-1 {
            width: 500px;
            height: 500px;
            background: #f47f20;
            top: -150px;
            left: -150px;
            animation-duration: 18s;
        }

        .orb-2 {
            width: 350px;
            height: 350px;
            background: #0f3460;
            bottom: -100px;
            right: -80px;
            animation-duration: 14s;
            animation-direction: reverse;
        }

        .orb-3 {
            width: 250px;
            height: 250px;
            background: #f47f20;
            bottom: 20%;
            left: 10%;
            animation-duration: 20s;
            animation-delay: -5s;
        }

        @keyframes floatOrb {
            0% {
                transform: translate(0, 0) scale(1);
            }

            25% {
                transform: translate(40px, -30px) scale(1.05);
            }

            50% {
                transform: translate(20px, 40px) scale(0.95);
            }

            75% {
                transform: translate(-30px, 20px) scale(1.02);
            }

            100% {
                transform: translate(0, 0) scale(1);
            }
        }

        /* ── Animated particles ── */
        .particles {
            position: absolute;
            inset: 0;
            pointer-events: none;
            overflow: hidden;
        }

        .particle {
            position: absolute;
            width: 3px;
            height: 3px;
            background: rgba(244, 127, 32, 0.6);
            border-radius: 50%;
            animation: floatParticle linear infinite;
        }

        @keyframes floatParticle {
            0% {
                transform: translateY(100vh) scale(0);
                opacity: 0;
            }

            10% {
                opacity: 1;
            }

            90% {
                opacity: 1;
            }

            100% {
                transform: translateY(-100px) scale(1);
                opacity: 0;
            }
        }

        /* ── Login card ── */
        .login_wrapper {
            position: relative;
            z-index: 10;
            width: 100%;
            max-width: 460px;
            padding: 20px;
            animation: cardEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }

        @keyframes cardEntrance {
            from {
                opacity: 0;
                transform: translateY(40px) scale(0.95);
            }

            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .login_card {
            background: rgba(255, 255, 255, 0.06);
            backdrop-filter: blur(24px);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 24px;
            padding: 48px 52px;
            box-shadow:
                0 30px 60px rgba(0, 0, 0, 0.5),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
        }

        /* ── Logo section ── */
        .login_logo {
            text-align: center;
            margin-bottom: 28px;
        }

        .logo_img_wrap {
            display: inline-block;
            padding: 14px 20px;
            border-radius: 20px;
            background: rgba(255, 255, 255, 0.07);
            border: 1px solid rgba(244, 127, 32, 0.25);
            box-shadow:
                0 0 30px rgba(244, 127, 32, 0.2),
                0 8px 24px rgba(0, 0, 0, 0.3);
            margin-bottom: 20px;
            animation: logoPulse 3s ease-in-out infinite;
            position: relative;
        }

        /* Glow ring */
        .logo_img_wrap::before {
            content: '';
            position: absolute;
            inset: -3px;
            border-radius: 22px;
            border: 2px solid rgba(244, 127, 32, 0.4);
            animation: ringPulse 3s ease-in-out infinite;
        }

        .logo_img_wrap::after {
            content: '';
            position: absolute;
            inset: -8px;
            border-radius: 26px;
            border: 1px solid rgba(244, 127, 32, 0.15);
            animation: ringPulse 3s ease-in-out infinite 0.3s;
        }

        @keyframes logoPulse {

            0%,
            100% {
                box-shadow: 0 0 30px rgba(244, 127, 32, 0.2), 0 8px 24px rgba(0, 0, 0, 0.3);
                transform: translateY(0);
            }

            50% {
                box-shadow: 0 0 50px rgba(244, 127, 32, 0.4), 0 12px 32px rgba(0, 0, 0, 0.4);
                transform: translateY(-4px);
            }
        }

        @keyframes ringPulse {

            0%,
            100% {
                opacity: 0.4;
                transform: scale(1);
            }

            50% {
                opacity: 1;
                transform: scale(1.03);
            }
        }

        .login_logo h1 {
            color: #ffffff;
            font-size: 20px;
            font-weight: 700;
            letter-spacing: 1px;
            text-transform: uppercase;
            margin-bottom: 12px;
            animation: fadeSlideUp 0.8s ease 0.3s both;
        }

        /* ── Store name badge ── */
        .store_badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: linear-gradient(135deg, rgba(244, 127, 32, 0.2), rgba(224, 95, 0, 0.15));
            border: 1px solid rgba(244, 127, 32, 0.5);
            border-radius: 50px;
            padding: 8px 20px;
            margin-bottom: 4px;
            animation: fadeSlideUp 0.8s ease 0.5s both;
            position: relative;
            overflow: hidden;
        }

        /* Shimmer effect */
        .store_badge::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
            animation: shimmer 3s ease infinite 1s;
        }

        @keyframes shimmer {
            0% {
                left: -100%;
            }

            100% {
                left: 200%;
            }
        }

        .store_badge .badge_dot {
            width: 7px;
            height: 7px;
            background: #f47f20;
            border-radius: 50%;
            animation: dotPulse 1.5s ease infinite;
            flex-shrink: 0;
        }

        @keyframes dotPulse {

            0%,
            100% {
                opacity: 1;
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(244, 127, 32, 0.5);
            }

            50% {
                opacity: 0.7;
                transform: scale(1.3);
                box-shadow: 0 0 0 4px rgba(244, 127, 32, 0);
            }
        }

        .store_badge span {
            color: #f47f20;
            font-size: 14px;
            font-weight: 700;
            letter-spacing: 0.5px;
            white-space: nowrap;
        }

        /* ── Form ── */
        @keyframes fadeSlideUp {
            from {
                opacity: 0;
                transform: translateY(16px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .form_group {
            margin-bottom: 18px;
            animation: fadeSlideUp 0.6s ease both;
        }

        .form_group:nth-child(1) {
            animation-delay: 0.6s;
        }

        .form_group:nth-child(2) {
            animation-delay: 0.7s;
        }

        .form_group label {
            display: block;
            color: rgba(255, 255, 255, 0.6);
            font-size: 12px;
            font-weight: 600;
            margin-bottom: 8px;
            letter-spacing: 0.8px;
            text-transform: uppercase;
        }

        .form_group input {
            width: 100%;
            background: rgba(255, 255, 255, 0.07);
            border: 1.5px solid rgba(255, 255, 255, 0.12);
            border-radius: 12px;
            padding: 13px 16px;
            color: #ffffff;
            font-size: 15px;
            outline: none;
            transition: all 0.3s ease;
        }

        .form_group input:focus {
            border-color: #f47f20;
            background: rgba(255, 255, 255, 0.1);
            box-shadow: 0 0 0 3px rgba(244, 127, 32, 0.2);
        }

        .form_group input::placeholder {
            color: rgba(255, 255, 255, 0.25);
        }

        /* ── Login button ── */
        .login_btn {
            width: 100%;
            background: linear-gradient(135deg, #f47f20, #e05f00);
            color: #ffffff;
            border: none;
            border-radius: 12px;
            padding: 14px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            letter-spacing: 1px;
            text-transform: uppercase;
            margin-top: 8px;
            transition: all 0.3s ease;
            box-shadow: 0 6px 20px rgba(244, 127, 32, 0.45);
            position: relative;
            overflow: hidden;
            animation: fadeSlideUp 0.6s ease 0.8s both;
        }

        .login_btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
            transition: left 0.5s ease;
        }

        .login_btn:hover::before {
            left: 100%;
        }

        .login_btn:hover {
            background: linear-gradient(135deg, #ff8f30, #f47f20);
            box-shadow: 0 8px 28px rgba(244, 127, 32, 0.65);
            transform: translateY(-2px);
        }

        .login_btn:active {
            transform: translateY(0);
        }

        /* ── Footer ── */
        .login_footer {
            text-align: center;
            margin-top: 32px;
            padding-top: 24px;
            border-top: 1px solid rgba(255, 255, 255, 0.07);
            animation: fadeSlideUp 0.6s ease 1s both;
        }

        .login_footer a {
            color: rgba(255, 255, 255, 0.45);
            font-size: 13px;
            text-decoration: none;
            transition: all 0.2s;
            letter-spacing: 0.5px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .login_footer a:hover {
            color: rgba(255, 255, 255, 0.7);
        }

        .login_footer a:hover strong {
            color: #ff9f40 !important;
        }

        .error_message {
            background: rgba(220, 53, 69, 0.15);
            border: 1px solid rgba(220, 53, 69, 0.35);
            border-radius: 10px;
            padding: 10px 14px;
            color: #ff6b7a;
            font-size: 13px;
            margin-bottom: 18px;
            text-align: center;
        }
    </style>
</head>

<body>

    <!-- Floating orbs -->
    <div class="orb orb-1"></div>
    <div class="orb orb-2"></div>
    <div class="orb orb-3"></div>

    <!-- Floating particles -->
    <div class="particles" id="particles"></div>

    <?php echo form_open('login', array('id' => 'login_form')); ?>

    <div class="login_wrapper">
        <div class="login_card">

            <div class="login_logo">
                <div class="logo_img_wrap">
                    <img src="<?php echo base_url(); ?>images/menubar/logo.png" alt="WAK Logo" style="width:120px;height:68px;object-fit:contain;display:block;">
                </div>
                <h1>WAK POS</h1>
                <div class="store_badge">
                    <div class="badge_dot"></div>
                    <span><?php echo $this->config->item('company'); ?></span>
                </div>
            </div>

            <?php if (validation_errors()): ?>
                <div class="error_message"><?php echo validation_errors(); ?></div>
            <?php endif; ?>

            <div class="form_group">
                <label><?php echo $this->lang->line('login_username'); ?></label>
                <?php echo form_input(array(
                    'name'         => 'username',
                    'value'        => set_value('username'),
                    'placeholder'  => 'Enter your username',
                    'autocomplete' => 'username'
                )); ?>
            </div>

            <div class="form_group">
                <label><?php echo $this->lang->line('login_password'); ?></label>
                <?php echo form_password(array(
                    'name'         => 'password',
                    'value'        => set_value('password'),
                    'placeholder'  => 'Enter your password',
                    'autocomplete' => 'current-password'
                )); ?>
            </div>

            <?php echo form_submit('loginButton', 'Login', array('class' => 'login_btn')); ?>

            <div class="login_footer">
                <a href="http://www.waksoftware.com" target="_blank">
                    ⚡ Powered by <strong style="color:#f47f20;margin-left:3px;">WAK Software Ltd.</strong>
                </a>
            </div>

        </div>
    </div>

    <?php echo form_close(); ?>

    <script>
        // Generate floating particles
        (function() {
            var container = document.getElementById('particles');
            for (var i = 0; i < 25; i++) {
                var p = document.createElement('div');
                p.className = 'particle';
                p.style.left = Math.random() * 100 + '%';
                p.style.width = p.style.height = (Math.random() * 3 + 1) + 'px';
                p.style.animationDuration = (Math.random() * 15 + 8) + 's';
                p.style.animationDelay = (Math.random() * 10) + 's';
                p.style.opacity = Math.random() * 0.6 + 0.2;
                container.appendChild(p);
            }
        })();

        $(document).ready(function() {
            $("#login_form input:first").focus();
        });
    </script>

</body>

</html>