/* ===== CUSTOM LOGIN PAGE - VEC ===== */

/* Toàn bộ trang login */
.portlet-login:not(#p_p_id_com_liferay_login_web_portlet_FastLoginPortlet_) {
    padding: 30px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card chứa form */
.portlet-login .button-holder {
    margin-top: 16px;
}

.portlet-login .portlet-header {
    display: none;
}

.portlet-login .panel-body {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portlet-login .lfr-icon-item[href*=create_account] {
    display: none;
}

.portlet-login .c-mt-3.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
}

.portlet-login label[for="_com_liferay_login_web_portlet_LoginPortlet_rememberMe"] {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}

.portlet-login .taglib-icon-list li {
    float: none;
    margin: 0;
}

.portlet-login .vec-login-heading {
    margin-bottom: 28px;
}

/* Ẩn portlet header mặc định nếu có */
.portlet-login .portlet-topper {
    display: none !important;
}

/* Tiêu đề ĐĂNG NHẬP */
.portlet-login .portlet-login-title,
.portlet-login h1,
.portlet-login .h1 {
    text-align: center;
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* Subtitle */
.portlet-login .portlet-login-description,
.portlet-login .text-muted {
    text-align: center;
    color: #8a94a6 !important;
    font-size: 13px;
    margin-bottom: 32px;
    display: block;
}

/* Form group */
.portlet-login:not(#p_p_id_com_liferay_login_web_portlet_FastLoginPortlet_) .form-group {
    margin-bottom: 16px;
}

.portlet-login#p_p_id_com_liferay_login_web_portlet_FastLoginPortlet_ .form-group {
    margin-bottom: 0 !important;
}

.portlet-login#p_p_id_com_liferay_login_web_portlet_FastLoginPortlet_ label[for="_com_liferay_login_web_portlet_FastLoginPortlet_rememberMe"] {
    display: none !important;
}

/* Ẩn label vì dùng placeholder */
.portlet-login:not(#p_p_id_com_liferay_login_web_portlet_FastLoginPortlet_) .form-group label {
    display: none;
}

/* Input fields */
.portlet-login .form-control {
    background: #f7f9fc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    color: #2d3748 !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    height: auto !important;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.portlet-login .form-control:focus {
    background: #ffffff !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12) !important;
    outline: none;
}

.portlet-login .form-control::placeholder {
    color: #a0aec0 !important;
}

/* Input group (icon bên trái) */
.portlet-login .input-group {
    position: relative;
}

.portlet-login .input-group-item {
    position: relative;
}

.portlet-login .input-group .input-group-inset-item-forward,
.portlet-login .input-group .input-group-inset-item {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: #a0aec0;
    pointer-events: none;
}

.portlet-login .input-group .input-group-inset-item-backward {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    color: #a0aec0;
    pointer-events: auto;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

/* Button đăng nhập */
.portlet-login .btn-primary {
    background: #0090CF !important;
    background-image: none !important;
    border: none !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    font-size: 15px !important;
    padding: 13px 0 !important;
    width: 100% !important;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35) !important;
    margin-top: 8px;
}

.portlet-login .btn-primary:hover {
    background: #2563eb !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45) !important;
    transform: translateY(-1px);
}

.portlet-login .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3) !important;
}

/* Checkbox "Ghi nhớ đăng nhập" */
.portlet-login .checkbox,
.portlet-login .custom-control {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.portlet-login .checkbox label,
.portlet-login .custom-control-label {
    display: flex !important;
    align-items: center;
    color: #4a5568 !important;
    font-size: 13px;
    cursor: pointer;
    gap: 8px;
}

.portlet-login .custom-control-input:checked~.custom-control-label::before {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

/* Link quên mật khẩu */
.portlet-login a,
.portlet-login .portlet-login-forgot-password a {
    color: #3b82f6 !important;
    font-size: 13px;
    text-decoration: none !important;
    font-weight: 500;
}

.portlet-login a:hover {
    color: #2563eb !important;
    text-decoration: underline !important;
}

/* Alert lỗi */
.portlet-login .alert-danger {
    background: #fff5f5 !important;
    border: 1px solid #fed7d7 !important;
    border-radius: 10px !important;
    color: #c53030 !important;
    font-size: 13px;
    padding: 12px 16px !important;
    margin-bottom: 20px;
}

/* Ẩn các thứ không cần trên trang login */
.portlet-login .portlet-login-create-account,
.portlet-login .portlet-login-open-id,
.portlet-login .portlet-login-facebook,
.portlet-login .portlet-login-google-plus {
    display: none !important;
}

.vec-login-page .lfr-layout-structure-item-com-liferay-asset-publisher-web-portlet-assetpublisherportlet,
.vec-login-page .lfr-layout-structure-item-footer-v2 {
    display: none !important;
}

/* ===== END CUSTOM LOGIN PAGE ===== */

/* ===== LOADING SCREEN ===== */
#vec-loading-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#vec-loading-screen.hide {
    opacity: 0;
    visibility: hidden;
}

#vec-loading-screen .vec-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: vec-spin 0.7s linear infinite;
}

#vec-loading-screen .vec-loading-text {
    color: #a0aec0;
    font-size: 13px;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    letter-spacing: 0.5px;
}

@keyframes vec-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== END LOADING SCREEN ===== */

.portlet-login .portlet {
    max-width: 475px;
}

#_com_liferay_comment_page_comments_web_portlet_PageCommentsPortlet_discussionContainer {
    .cke_top, .cke_bottom {
        display: none !important;
    }

    .cke_contents {
        height: 85px !important;
    }

    .button-holder {
        margin-top: .5rem !important;
        margin-bottom: 0 !important;
    }

    .lfr-discussion-container, .comment-container {
        margin-bottom: 0.5rem !important;
    }

    .lfr-discussion-container:first-of-type {
        padding-top: .5rem !important;
    }

    .autofit-float-end.autofit-row>.autofit-col {
        justify-content: center;
    }

    .panel-body .autofit-float-end.autofit-row {
        margin-bottom: .5rem !important;
    }
}

#_com_liferay_login_web_portlet_FastLoginPortlet_fm {
    .panel-body {
        width: 100% !important;
    }
}
