﻿/* Custom Login CSS - Thay thế AdminLTE
   Dung lượng: ~8KB thay vì 15KB của AdminLTE
   Tối ưu cho trang login với giao diện hiện đại
*/

/* Reset và Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.login-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #e9ecef;
    min-height: 100vh;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
}

/* Đảm bảo chỉ áp dụng cho login page */
body:not(.login-page) {
    display: block !important;
    align-items: unset !important;
    justify-content: unset !important;
}

/* Login Container */
.login-box {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* Card Styles */
.card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.card-outline.card-primary {
    border-top: 4px solid #007bff;
}

/* Header */
.card-header {
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 30px 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.login-logo {
    max-width: 60px;
    height: 60px;
    object-fit: contain;
}

/* Card Body */
.card-body.login-card-body {
    padding: 30px;
}

.login-box-msg {
    text-align: center;
    margin: 0 0 25px 0;
    color: #6c757d;
    font-size: 16px;
    font-weight: 400;
}

/* Form Styles */
.form-floating {
    position: relative;
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 15px 45px 15px 15px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

    .form-control:focus {
        color: #212529;
        background-color: #fff;
        border-color: #86b7fe;
        outline: 0;
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

    .form-control::placeholder {
        color: transparent;
    }

.form-floating > label {
    position: absolute;
    top: 0;
    left: 15px;
    height: 100%;
    padding: 15px 0;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: #6c757d;
    font-size: 16px;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
    margin-bottom: 1rem;
}

    .input-group > .form-floating {
        flex: 1 1 auto;
        width: 1%;
        min-width: 0;
        margin-bottom: 0;
    }

.input-group-text {
    display: flex;
    align-items: center;
    padding: 15px 15px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: #6c757d;
    text-align: center;
    white-space: nowrap;
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    border-left: none;
    border-radius: 0 8px 8px 0;
}

/* Validation */
.text-danger {
    color: #dc3545 !important;
    font-size: 14px;
    margin-top: 5px;
    display: block;
}

/* Row and Columns */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -5px;
}

.col-8 {
    flex: 0 0 auto;
    width: 66.66666667%;
    padding: 0 5px;
}

.col-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
    padding: 0 5px;
}

.col-6 {
    flex: 0 0 auto;
    width: 50%;
    padding: 0 5px;
}

/* Form Check (Checkbox) */
.form-check {
    display: block;
    margin-bottom: 0.125rem;
    padding-left: 1.5em;
}

.form-check-input {
    width: 1em;
    height: 1em;
    margin-top: 0.25em;
    margin-left: -1.5em;
    vertical-align: top;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.25);
    border-radius: 0.25em;
    accent-color: #007bff;
    cursor: pointer;
}

.form-check-label {
    color: #6c757d;
    cursor: pointer;
    font-size: 14px;
}

.d-inline-flex {
    display: inline-flex !important;
}

.align-items-center {
    align-items: center !important;
}

/* Buttons */
.btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 8px;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    font-family: inherit;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
    font-weight: 500;
}

    .btn-primary:hover {
        color: #fff;
        background-color: #0056b3;
        border-color: #004085;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
    }

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
    font-weight: 500;
}

    .btn-danger:hover {
        color: #fff;
        background-color: #c82333;
        border-color: #bd2130;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    }

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
    font-weight: 500;
}

    .btn-secondary:hover {
        color: #fff;
        background-color: #5a6268;
        border-color: #545b62;
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
    }

.d-grid {
    display: grid !important;
}

.gap-2 {
    gap: 0.5rem !important;
}

/* Social Auth Links */
.social-auth-links {
    text-align: center;
    margin: 25px 0;
}

    .social-auth-links p {
        color: #6c757d;
        margin: 15px 0;
        font-size: 14px;
        position: relative;
    }

        .social-auth-links p::before,
        .social-auth-links p::after {
            content: '';
            position: absolute;
            top: 50%;
            width: 25%;
            height: 1px;
            background-color: #dee2e6;
        }

        .social-auth-links p::before {
            left: 0;
        }

        .social-auth-links p::after {
            right: 0;
        }

.d-flex {
    display: flex !important;
}

.flex-fill {
    flex: 1 1 auto !important;
}

/* Links */
a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

    a:hover {
        color: #0056b3;
        text-decoration: underline;
    }

.link-dark {
    color: #212529;
}

    .link-dark:hover {
        color: #0056b3;
    }

.text-center {
    text-align: center !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-1 {
    margin-bottom: 0.25rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.w-100 {
    width: 100% !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

/* Background utilities */
.bg-body-secondary {
    background-color: #e9ecef !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body.login-page {
        padding: 10px;
    }

    .login-box {
        width: 95% !important;
        max-width: 400px;
    }

    .card-body.login-card-body {
        padding: 20px;
    }

    .card-header {
        padding: 20px;
        min-height: 80px;
    }

    .login-logo {
        max-width: 50px;
        height: 50px;
    }

    .btn {
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 12px 16px !important;
        border-radius: 8px !important;
        font-weight: 500;
        transition: all 0.2s ease;
    }

        .btn:active {
            transform: scale(0.98);
            transition: transform 0.1s ease;
        }

    .form-control {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }

    .social-auth-links .btn {
        min-height: 44px !important;
        font-size: 16px !important;
        padding: 12px 16px !important;
    }

    .btn-primary {
        background: linear-gradient(45deg, #1877f2, #42a5f5);
        border: none;
        box-shadow: 0 2px 4px rgba(24, 119, 242, 0.3);
    }

        .btn-primary:hover {
            background: linear-gradient(45deg, #166fe5, #2196f3);
            box-shadow: 0 4px 8px rgba(24, 119, 242, 0.4);
        }
}

/* Focus states for accessibility */
.btn:focus,
.form-control:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Loading state */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

/* Smooth animations */
.btn,
.form-control,
.card {
    transition: all 0.2s ease;
}

    /* Custom focus ring */
    .btn:focus-visible {
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

/* Validation summary styles */
div[asp-validation-summary] {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 14px;
}

    div[asp-validation-summary] ul {
        margin: 0;
        padding-left: 1.2rem;
    }

    div[asp-validation-summary] li {
        margin-bottom: 4px;
    }

/* Image fluid utility */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Link utilities */
.link-offset-2 {
    text-underline-offset: 0.25rem;
}

.link-opacity-100 {
    --bs-link-opacity: 1;
}

.link-opacity-50-hover:hover {
    --bs-link-opacity: 0.5;
}
.login-notice {
    margin-top: 15px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #f39c12;
    border-radius: 8px;
    font-size: 13px;
    color: #856404;
    box-shadow: 0 2px 4px rgba(243, 156, 18, 0.1);
}

    .login-notice i {
        color: #f39c12;
        margin-right: 6px;
        font-size: 14px;
    }

    .login-notice strong {
        color: #d68910;
    }