/* ========================================
   LOGIN MODAL POPUP ON HOMEPAGE
   Shows login form as overlay popup
   ======================================== */

/* Modal Overlay */
.login-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.login-modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Modal Container */
.login-modal-container {
    width: 100%;
    max-width: 380px;
    /* Reduced from 450px */
    animation: modalSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modal Card */
.login-modal-card {
    background: white;
    border-radius: 16px;
    /* Slightly smaller radius */
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    position: relative;
}

/* Modal Header */
.login-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 20px;
    /* Reduced from 40px 30px */
    text-align: center;
    color: white;
    position: relative;
}

.login-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.login-modal-logo {
    width: 65px;
    /* Reduced from 80px */
    height: 65px;
    margin: 0 auto 12px;
    /* Reduced margin */
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.login-modal-logo img {
    width: 50px;
    /* Reduced from 65px */
    height: 50px;
    object-fit: contain;
}

.login-modal-header h3 {
    margin: 0 0 5px;
    /* Reduced margin */
    font-size: 1.3rem;
    /* Reduced from 1.6rem */
    font-weight: 700;
}

.login-modal-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.85rem;
    /* Reduced from 0.9rem */
}

/* Modal Body */
.login-modal-body {
    padding: 25px 20px;
    /* Reduced from 30px */
}

.login-modal-form .form-group {
    margin-bottom: 15px;
    /* Reduced from 20px */
}

.login-modal-form label {
    display: block;
    margin-bottom: 6px;
    /* Reduced from 8px */
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
    /* Reduced from 0.9rem */
}

.login-modal-form .form-control {
    width: 100%;
    padding: 10px 12px;
    /* Reduced from 12px 15px */
    border: 2px solid #e8ecef;
    border-radius: 8px;
    /* Reduced from 10px */
    font-size: 0.9rem;
    /* Reduced from 0.95rem */
    transition: all 0.3s;
}

.login-modal-form .form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Password Toggle */
.password-toggle-wrapper {
    position: relative;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
    transition: color 0.3s;
}

.password-toggle-btn:hover {
    color: #667eea;
}

.password-toggle-btn:focus {
    outline: none;
}

.login-modal-form .btn-login {
    width: 100%;
    padding: 12px;
    /* Reduced from 14px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    /* Reduced from 10px */
    font-size: 0.95rem;
    /* Reduced from 1rem */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.login-modal-form .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.login-modal-form .btn-login:active {
    transform: translateY(0);
}

/* Role Badges */
.login-modal-roles {
    display: flex;
    justify-content: center;
    gap: 6px;
    /* Reduced from 8px */
    margin-top: 10px;
    /* Reduced from 15px */
    flex-wrap: wrap;
}

.login-modal-role-badge {
    padding: 3px 8px;
    /* Reduced from 4px 10px */
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    /* Reduced from 15px */
    font-size: 0.75rem;
    /* Reduced from 0.8rem */
    color: #667eea;
    font-weight: 500;
}

/* Alert */
.login-modal-alert {
    padding: 10px 12px;
    /* Reduced from 12px 15px */
    border-radius: 8px;
    /* Reduced from 10px */
    margin-bottom: 15px;
    /* Reduced from 20px */
    font-size: 0.85rem;
    /* Reduced from 0.9rem */
}

.login-modal-alert.error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .login-modal-container {
        max-width: 100%;
    }

    .login-modal-header {
        padding: 30px 20px;
    }

    .login-modal-body {
        padding: 25px 20px;
    }

    .login-modal-logo {
        width: 70px;
        height: 70px;
    }

    .login-modal-logo img {
        width: 55px;
        height: 55px;
    }

    .login-modal-header h3 {
        font-size: 1.4rem;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
}