/******************************************************************/
/******************************************************************/
/* For the Login.aspx and secure_login.aspx pages */
/* Version: 0.0.1                                                 */
/******************************************************************/
/******************************************************************/

body {
    /* Use forward slash for absolute path from root */
    background-image: url('/images/OSPM_Page_BG_6x1200.jpg');
    background-repeat: repeat;
    background-position: top left;
    background-attachment: scroll;
    background-color: #f5f5f5; /* Fallback color */
    min-height: 100vh;
    font-family: Arial, sans-serif;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative; /* Add this to make it a positioning context */
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.form-control {
    border-radius: 10px;
    border: 2px solid #e1e5e9;
    padding: 12px 15px;
    font-size: 14px;
    transition: all 0.3s ease;
}

    .form-control:focus {
        border-color: #2E86AB;
        box-shadow: 0 0 0 0.2rem rgba(46, 134, 171, 0.25);
    }

.btn-login {
    background: linear-gradient(135deg, #2E86AB 0%, #4A9BC7 100%);
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    width: 100%;
}

    .btn-login:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(46, 134, 171, 0.4);
        background: linear-gradient(135deg, #1B5E7F 0%, #2E86AB 100%);
        color: white;
    }

.forgot-links {
    font-size: 12px;
    color: #2E86AB;
    text-decoration: none;
}

    .forgot-links:hover {
        color: #4A9BC7;
        text-decoration: underline;
    }

.fullscreen-tip {
    background: var(--section-light-blue);
    border: 1px solid var(--section-dark-blue);
    border-radius: 8px;
    padding: 10px;
    font-size: 11px;
    color: #1976d2;
    text-align: center;
    margin-top: 1rem;
}

/* Message that appears ABOVE the login card */
.login-message-below {
    position: absolute; /* Scrolls with the page */
    top: calc(50% - 280px); /* Just above the card */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    padding: 12px 20px;
    animation: fadeIn 0.3s ease-out;
    z-index: 1000;
}

/* Animation for smooth appearance */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Success message styling */
.login-message-below.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Error message styling */
.login-message-below.alert-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Maintain header height */
header.navbar-light {
    min-height: 42px;
    display: block; /* Show on desktop and mobile */
}

.password-toggle-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-toggle-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    padding: 5px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .password-toggle-btn:hover {
        color: #495057;
    }

.password-input-with-toggle {
    padding-right: 40px !important;
}

.password-toggle-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}

/* Mobile styles - keep gradient background for tablets and phones */
@media (max-width: 768px) {
    body {
        background: linear-gradient(135deg, #2E86AB 0%, #87CEEB 50%, #F0F8FF 100%);
        background-image: none; /* Override the desktop background image */
    }

    /* Show header only on mobile/tablets */
    header.navbar-light {
        display: block;
    }

    /* Adjust message positioning for mobile - position above card */
    .login-message-below {
        position: absolute; /* Keep absolute for mobile too */
        width: 100%;
        max-width: 400px;
        padding-left: 20px;
        padding-right: 20px;
        top: calc(50% - 300px); /* Just above the card on mobile */
    }
}

@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem;
        margin: 10px;
    }

    .login-title {
        font-size: 1.25rem;
    }

    /* Further adjust message for small screens */
    .login-message-below {
        position: absolute; /* Keep absolute for small screens too */
        width: calc(100% - 20px); /* Account for 10px margin on each side */
        max-width: calc(400px - 20px); /* Match the card's max-width minus margins */
        left: 50%;
        transform: translateX(-50%);
        padding-left: 20px;
        padding-right: 20px;
        top: calc(50% - 280px); /* Just above the card on small screens */
    }
}
