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

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>{Lang::T('Login')} - {$_c['CompanyName']}</title>
    <link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
    <link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
    
    <!-- Google Font for Handwritten Style -->
    <link href="https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;700&display=swap" rel="stylesheet">

    <style>
        /* Body Styles */
        body {
            margin: 0;
            color: #edf3ff;
            background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)), url(https://therichpost.com/wp-content/uploads/2021/03/material-design-4k-2048x1152-1.jpg) fixed;
            background-size: cover;
            font: 600 16px/18px 'Open Sans', sans-serif;
            display: flex;
            align-items: center;
            justify-content: center;
            height: 100vh; /* Center vertically */
            background-position: center; /* Ensures the background is centered */
            background-repeat: no-repeat; /* Prevents repeating the background */
        }

        /* Centering the login box */
        .center-container {
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100vh; /* Full height of the viewport */
        }

        /* Login Box Styles */
        .login-box {
            width: 100%;
            max-width: 400px;
            background: #ffffff;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            padding: 40px;
            text-align: center;
            transition: box-shadow 0.3s ease-in-out;
            margin: 0 auto; /* Ensures it's centered horizontally */
        }

        /* Logo and Title */
        .site-logo img {
            width: 120px; /* Set the logo's width to a fixed value */
            height: auto; /* Keep the aspect ratio */
            margin-bottom: 20px; /* Adds space below the logo */
        }

        .company-name {
            font-family: 'Dancing Script', cursive; /* Apply the handwritten font */
            font-size: 36px;
            font-weight: 700;
            color: #4caf50; /* Darker green for the title */
            text-transform: uppercase;
            margin-bottom: 20px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        /* Form Inputs */
        .form-control,
        .btn {
            border-radius: 20px;
            box-shadow: none;
            transition: border-color 0.3s, box-shadow 0.3s;
        }

        .form-group {
            margin-bottom: 20px;
        }

        .btn-primary {
            background-color: #4caf50;
            border-color: #4caf50;
            font-size: 16px;
            transition: background-color 0.3s, border-color 0.3s;
        }

        .btn-primary:hover {
            background-color: #388e3c;
            border-color: #388e3c;
        }

        /* Input Focus Effects */
        .form-control:focus {
            border-color: #388e3c;
            box-shadow: 0 0 5px rgba(56, 142, 60, 0.6);
        }

        /* Forgot Password Link */
        .forgot-password {
            display: block;
            text-align: right;
            margin-top: 15px;
            font-size: 14px;
            color: #388e3c;
        }

        .forgot-password:hover {
            text-decoration: underline;
            color: #2e7d32;
        }

        /* Responsive Design */
        @media (max-width: 768px) {
            .login-box {
                padding: 25px;
            }

            .company-name {
                font-size: 28px;
            }

            .form-group input,
            .btn-primary {
                font-size: 14px;
                padding: 12px;
            }

            .login-box {
                max-width: 90%;  /* Adjust for smaller screens */
                padding: 20px;
            }
        }

        .form-input {
            width: 100%;
            padding: 15px;
            border: none;
            border-radius: 25px;
            background: rgba(255, 255, 255, .2);
            color: #fff;
            font-size: 16px;
            box-shadow: inset 0 0 5px rgba(255, 255, 255, 0.1);
            box-sizing: border-box;
            transition: background 0.3s ease, box-shadow 0.3s ease;
        }

        .form-input:focus {
            outline: none;
            background: rgba(255, 255, 255, .3);
            border: 2px solid #1161ee;
            box-shadow: 0 0 8px rgba(17, 97, 238, 0.6); /* Subtle glow effect */
        }

        .login-button {
            width: 100%;
            padding: 15px;
            border: none;
            border-radius: 25px;
            background: #1161ee;
            color: white;
            font-size: 16px;
            cursor: pointer;
            transition: background-color 0.2s ease, transform 0.2s ease;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .login-button:hover {
            background: #0a4ba1;
            transform: scale(1.05);
        }

        .notification {
            margin: 10px 0;
            color: #ff4d4d; /* Error message color */
            text-align: center;
        }

    </style>
</head>

<body>
    <div class="center-container">
        <div>
            <div class="form-head mb-4">
                <div class="site-logo text-center">
                    <img src="ui/ui/images/logo.png" alt="Company Logo" class="mb-3">
                    <h1 class="company-name">{$_c['CompanyName']}</h1> <!-- Handwritten-style Company Name -->
                </div>
                <hr>
            </div>
            <div class="login-box">
                <div class="login-box-body">
                    <p class="login-box-msg">{Lang::T('Enter Admin Area')}</p>
                    {if isset($notify)}
                        {$notify}
                    {/if}
                    <form action="{$_url}admin/post" method="post">
                        <div class="form-group">
                            <label for="username">{Lang::T('Username')}</label>
                            <input type="text" id="username" name="username" required class="form-control" placeholder="{Lang::T('Username')}">
                        </div>
                        <div class="form-group">
                            <label for="password">{Lang::T('Password')}</label>
                            <input type="password" id="password" name="password" required class="form-control" placeholder="{Lang::T('Password')}">
                        </div>
                        <button type="submit" class="btn btn-primary btn-block">{Lang::T('Login')}</button>
                    </form>
                    <div class="forgot-password">
                        <a href="#">{Lang::T('Forgot Password?')}</a>
                    </div>
                </div>
            </div>
        </div>    
    </div>
</body>

</html>
