/* --- Responsive styles --- */
@media (max-width: 1024px) {
    .login-container {
        width: 90vw;
        max-width: 400px;
    }
    .logo-row {
        gap: 15px;
        margin-bottom: 15px;
    }
    .logo {
        width: 70px;
    }
}

@media (max-width: 768px) {
    /* Mobile Background Fix */
    body, body.dark-mode-variables {
        background-size: cover !important;
        background-attachment: scroll !important;
        background-position: top center !important;
    }

    .login-container {
        width: 90vw;
        padding: 24px;
        border-radius: 12px;
    }
    .logo-row {
        gap: 12px;
        margin-bottom: 15px;
    }
    .logo {
        width: 60px;
        margin: 0 8px;
    }
    .login-container h2 {
        font-size: 1.4rem;
        margin: 10px 0;
    }
    .system-desc {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }
    .login-container input,
    .login-container button {
        font-size: 16px;
        padding: 12px;
    }
    .forgot-password {
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    .login-container {
        width: 95vw;
        padding: 1.5rem;
        border-radius: 8px;
        box-shadow: 0px 2px 10px rgba(0,0,0,0.15);
    }
    .logo-row {
        gap: 10px;
        margin-bottom: 10px;
    }
    .logo {
        width: 50px;
        margin: 0 5px;
    }
    /* Fixed Dark Mode Toggle for Mobile */
    .dark-mode-toggle {
        top: 15px;
        right: 15px;
        width: 36px !important;
        height: 36px !important;
        font-size: 18px;
    }
    .login-container h2 {
        font-size: 1.3rem;
    }
    .login-title {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        width: 96vw;
        padding: 1.5rem;
        border-radius: 12px;
    }
    .logo-row {
        gap: 8px;
        margin-bottom: 1rem;
    }
    .logo {
        width: 45px;
        margin: 0 3px;
    }
    .login-container h2 {
        font-size: 1.3rem;
    }
    .system-desc {
        font-size: 0.85rem;
    }
    .login-title {
        font-size: 1rem;
    }
    .login-container input,
    .login-container button {
        font-size: 16px;
        padding: 12px;
    }
    .forgot-password {
        font-size: 0.85rem;
    }
    .remember-me {
        font-size: 0.9rem;
    }
}

/* --- logo row bro --- */
.logo {
    width: 80px;
    margin: 0 10px;
}

.logo-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

/* --- body bg --- */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: url("../images/knight_bg.png") no-repeat center center fixed;
    background-size: contain;
    background-color: #1e3c72;
    min-height: 100vh; /* Changed from height:100vh to min-height */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-y: auto; /* ALLOW SCROLLING */
    overflow-x: hidden; /* Prevent horizontal scroll */
}

body::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: linear-gradient(135deg, rgba(192,192,192,0.7), rgba(30,60,114,0.7));
    z-index: -1;  
}

/* --- container ng login --- */
.login-container {
    position: relative;
    z-index: 1; 
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.2);
    width: 350px;
    text-align: center;
}

/* --- system name --- */
.login-container h2 {
    margin-top: 10px;
    margin-bottom: 5px;
    color: #1e3c72;
    font-size: 20px;
    font-weight: bold;
}

/* --- login subtitle --- */
.login-title {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
}

/* --- form elements --- */
.login-container label {
    display: block;
    margin: 10px 0 5px;
    text-align: left;
    color: #555;
    font-weight: bold;
}

.login-container input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box;
}

.login-container input:focus {
    border-color: #4e54c8;
    box-shadow: 0 0 5px rgba(78, 84, 200, 0.5);
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: #4e54c8;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.3s;
}

.login-container button:hover {
    background: #3c40a8;
}

/* --- extra shit --- */
.extras {
    margin-top: 15px;
}

.forgot-password {
    color: #4e54c8;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

.forgot-password:hover {
    text-decoration: underline;
    color: #3c40a8;
}

/* --- system description --- */
.system-desc {
    font-size: 13px;
    color: #555;
    margin-bottom: 15px;
    font-style: italic;
}

/* --- password field with eye icon --- */
.password-container {
    position: relative;
    width: 100%;
}

.password-container input {
    width: 100%;
    padding-right: 40px;
    box-sizing: border-box;
}

.eye-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    user-select: none;
}

.eye-icon:hover {
    color: #007bff;
}

/* --- remember me checkbox ayusin --- */
.remember-me {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    margin: 10px 0 15px;
    font-size: 14px;
    color: #333;
    line-height: 1;
}

.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.remember-me label {
    margin: 0;
    cursor: pointer;
}

/* --- dark mode toggle button (FIXED) --- */
.dark-mode-toggle {
    position: absolute;
    top: 24px;
    right: 24px;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    padding: 0;
    margin: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    aspect-ratio: 1 / 1;
    transition: background 0.2s;
}
.dark-mode-toggle:hover {
    background: #f0f0f0;
}

/* --- Help Page Button Fix --- */
.dashboard-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: #1e3c72;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.dashboard-btn:hover {
    background-color: #162a52;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.dashboard-btn:active {
    transform: translateY(0);
}

/* Mobile adjustments for the button */
@media (max-width: 600px) {
    .dashboard-btn {
        width: 100%; /* Full width button on mobile */
        padding: 14px; /* Larger touch target */
        font-size: 1rem;
    }
}


/* --- dark mode styles --- */
body.dark-mode-variables {
    background: url("../images/knight_bg.png") no-repeat center center fixed;
    background-size: contain;
    background-color: #181c24;
    color: #e0e0e0;
}

body.dark-mode-variables::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    background: linear-gradient(135deg, rgba(24,28,36,0.85), rgba(30,60,114,0.7));
    z-index: -1;  
}

body.dark-mode-variables .login-container {
    background: #23283a;
    color: #e0e0e0;
    box-shadow: 0px 4px 20px rgba(0,0,0,0.5);
}

body.dark-mode-variables .login-container h2 {
    color: #b3c6ff;
}

body.dark-mode-variables .login-title {
    color: #e0e0e0;
}

body.dark-mode-variables .login-container label {
    color: #b3b3b3;
}

body.dark-mode-variables .login-container input {
    background: #23283a;
    color: #e0e0e0;
    border: 1px solid #444;
}

body.dark-mode-variables .login-container input:focus {
    border-color: #7a80ff;
    box-shadow: 0 0 5px rgba(122, 128, 255, 0.3);
}

body.dark-mode-variables .login-container button {
    background: #7a80ff;
    color: #fff;
}

body.dark-mode-variables .login-container button:hover {
    background: #4e54c8;
}

body.dark-mode-variables .forgot-password {
    color: #7a80ff;
}

body.dark-mode-variables .forgot-password:hover {
    color: #b3c6ff;
}

body.dark-mode-variables .system-desc {
    color: #b3b3b3;
}

body.dark-mode-variables .remember-me {
    color: #e0e0e0;
}

body.dark-mode-variables .eye-icon {
    color: #b3b3b3;
}

body.dark-mode-variables .eye-icon:hover {
    color: #7a80ff;
}

/* --- Flash Messages / Alert Styling --- */
.flash-messages {
    margin-bottom: 20px;
    width: 100%;
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error,
.alert-danger {
    background-color: #fee;
    color: #c33;
    border: 2px solid #fcc;
    border-left: 5px solid #dc3545;
}

.alert-error::before,
.alert-danger::before {
    content: "\f071"; /* Font Awesome exclamation-triangle icon */
    font-family: "FontAwesome";
    font-size: 18px;
    color: #dc3545;
    margin-right: 5px;
}

.alert-success {
    background-color: #efe;
    color: #3c3;
    border: 2px solid #cfc;
    border-left: 5px solid #28a745;
}

.alert-success::before {
    content: "\f00c"; /* Font Awesome check icon */
    font-family: "FontAwesome";
    font-size: 18px;
    color: #28a745;
    margin-right: 5px;
}

.alert-info {
    background-color: #eef;
    color: #33c;
    border: 2px solid #ccf;
    border-left: 5px solid #17a2b8;
}

.alert-info::before {
    content: "\f05a"; /* Font Awesome info-circle icon */
    font-family: "FontAwesome";
    font-size: 18px;
    color: #17a2b8;
    margin-right: 5px;
}

.alert-warning {
    background-color: #ffc;
    color: #cc0;
    border: 2px solid #ffc;
    border-left: 5px solid #ffc107;
}

.alert-warning::before {
    content: "\f12a"; /* Font Awesome exclamation icon */
    font-family: "FontAwesome";
    font-size: 18px;
    color: #ffc107;
    margin-right: 5px;
}

/* Dark mode styles for alerts */
body.dark-mode-variables .alert-error,
body.dark-mode-variables .alert-danger {
    background-color: #3a1f1f;
    color: #ff6b6b;
    border-color: #5a2a2a;
    border-left-color: #dc3545;
}

body.dark-mode-variables .alert-success {
    background-color: #1f3a1f;
    color: #6bff6b;
    border-color: #2a5a2a;
    border-left-color: #28a745;
}

body.dark-mode-variables .alert-info {
    background-color: #1f1f3a;
    color: #6b9bff;
    border-color: #2a2a5a;
    border-left-color: #17a2b8;
}

body.dark-mode-variables .alert-warning {
    background-color: #3a3a1f;
    color: #ffd93d;
    border-color: #5a5a2a;
    border-left-color: #ffc107;
}