@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* --- Base Reset & Font --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

/* --- Animated Gradient Background --- */
@keyframes gradientAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(-45deg, #282828, #918181, #74647a, #64556e);
    background-size: 400% 400%;
    animation: gradientAnimation 15s ease infinite;
    padding: 20px;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* --- Login Form Container - Enhanced Glassmorphism --- */
.login-wrapper {
    position: relative; /* Needed for pseudo-elements */
    width: 90%;
    max-width: 430px;
    background: rgba(255, 255, 255, 0.15); /* Lighter, more translucent */
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 40px 45px;
    border-radius: 20px; /* Slightly larger radius */
    backdrop-filter: blur(18px); /* Stronger blur */
    -webkit-backdrop-filter: blur(18px); /* Safari support */
    text-align: center;
    color: #ffffff; /* White text for contrast against dark bg */
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.2); /* Softer, deeper shadow */
    transition: all 0.4s ease;
    overflow: hidden; /* Clip pseudo-elements */
}

/* Optional: Subtle inner glow/border effect */
.login-wrapper::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px; /* Position slightly outside */
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.3));
    z-index: -1; /* Behind the main content */
    border-radius: inherit; /* Match parent border-radius */
    opacity: 0.7;
}


/* --- Logo --- */
.logo-container {
    margin-bottom: 30px;
}
.login-logo {
    width: 100%;
    max-width: 200px; /* Adjust as needed */
    height: auto;
    display: block;
    margin: 0 auto 10px auto; /* Center and add space below */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); /* Subtle shadow for logo */
}

/* Optional Title Below Logo */
.form-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* --- Input Fields --- */
.input-box {
    margin: 30px 0;
    position: relative;
}

.input-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.2); /* Slightly transparent */
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 15px 20px 15px 55px; /* Increased padding */
    border-radius: 30px;
    outline: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: #ffffff; /* White text */
    font-weight: 500;
}

.input-box input::placeholder {
    color: rgba(255, 255, 255, 0.75); /* Lighter placeholder */
    font-size: 0.95rem;
    font-weight: 400;
}

/* Enhanced Focus Effect */
.input-box input:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2); /* Subtle glow on focus */
}

.input-box input:focus + .focus-border::before,
.input-box input:focus + .focus-border::after {
    width: 50%; /* Animate border lines */
}

/* Animated border for focus */
.focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    z-index: 99;
}
.focus-border::before,
.focus-border::after {
    content: "";
    position: absolute;
    bottom: 0;
    width: 0;
    height: 100%;
    background-color: #fff; /* White animated border */
    transition: width 0.4s ease;
}
.focus-border::before {
    left: 50%;
}
.focus-border::after {
    right: 50%;
}


/* Hide Edge/IE password reveal */
.input-box input::-ms-reveal { display: none; }

.input-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    color: rgba(19, 18, 18, 0.8); /* Icon color */
    transition: color 0.3s ease;
}

.input-box input:focus ~ i { /* Target icon when input is focused */
    color: #ffffff;
}


/* --- Options (Remember Me / Forgot Password) --- */
.options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 30px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.options input[type="checkbox"] {
    accent-color: #ffffff; /* White checkbox */
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin-right: 5px;
}

.options a {
    color: #fff; /* White link */
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.options a:hover {
    text-decoration: underline;
    color: #eee;
    text-shadow: 0 0 5px rgba(255,255,255,0.5); /* Subtle glow on hover */
}

/* --- Login Button --- */
.login-btn {
    width: 100%;
    padding: 13px 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%); /* Subtle white gradient */
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.35s ease;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.login-btn:hover {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.2) 100%);
    border-color: rgba(255, 255, 255, 0.7);
    transform: translateY(-3px) scale(1.02); /* Lift and slight zoom */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.login-btn:active {
    transform: translateY(0) scale(1); /* Press effect */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 100%);
}

/* --- Error Message Styling --- */
.error {
    /* Style defined in <style> tag in index.php for direct PHP access */
    /* Example: color: #ff5252; margin-top: 15px; font-weight: 500; */
     text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

/* --- Optional: Registration Link --- */
.register-link {
    margin-top: 30px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.register-link a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.register-link a:hover {
    text-decoration: underline;
    color: #eee;
    text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* --- Media Query for Smaller Screens --- */
@media (max-width: 500px) {
    .login-wrapper {
        padding: 35px 30px; /* Adjust padding */
        max-width: 100%;
        border-radius: 15px;
        backdrop-filter: blur(12px); /* Slightly less blur */
        -webkit-backdrop-filter: blur(12px);
    }

    .input-box input {
        padding: 14px 15px 14px 48px; /* Adjust padding */
        font-size: 0.95rem;
    }
     .input-box i {
        left: 18px;
        font-size: 1.2rem;
    }

    .options {
        flex-direction: column; /* Stack 'Remember Me' and 'Forgot Password' */
        align-items: flex-start;
        gap: 12px; /* Add gap between stacked items */
        margin: 15px 0 25px;
    }

    .login-btn {
        padding: 12px 0;
        font-size: 1rem;
    }

    .login-logo {
        max-width: 160px; /* Smaller logo on mobile */
    }

    .form-title {
        font-size: 1.6rem;
    }
}