/* ============================================
   LOGIN CSS - Gộp từ login.css, login-fix.css, login-enhanced.css
   ============================================ */

/* ===== Base Styles ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-weight: 300;
}

body {
    font-family: 'Source Sans Pro', sans-serif;
    color: white;
    font-weight: 300;
}

body::placeholder {
    color: white;
    font-weight: 300;
}

.wrapper {
    background: #50a3a2;
    background: -webkit-linear-gradient(top left, #05428c 0%, #37517e  100%);
    background: -moz-linear-gradient(top left, #05428c 0%, #37517e  100%);
    background: -o-linear-gradient(top left, #05428c 0%, #37517e  100%);
    background: linear-gradient(to bottom right, #05428c 0%, #37517e  100%);

    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Cho phép cuộn dọc */
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto !important;
    -webkit-overflow-scrolling: touch; /* Mượt mà trên iOS */
}

.wrapper.form-success .container h1 {
    transform: translateY(85px);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 80px 0;
    text-align: center;
}

.container h1 {
    font-size: 40px;
    transition-duration: 1s;
    transition-timing-function: ease-in-out;
    font-weight: 200;
}

form {
    padding: 20px 0;
    position: relative;
    z-index: 2;
}

form input {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background-color: rgba(255, 255, 255, 0.2);
    width: 250px;
    border-radius: 3px;
    padding: 10px 15px;
    margin: 0 auto 10px auto;
    text-align: center;
    font-size: 18px;
    color: white;
    transition-duration: 0.25s;
    font-weight: 300;
}

form input:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

form input:focus {
    background-color: white;
    width: 300px;
    color: #53e3a6;
}

form button {
    border: 0;
    background-color: white;
    padding: 10px 15px;
    color: #53e3a6;
    border-radius: 3px;
    width: 250px;
    cursor: pointer;
    font-size: 18px;
    transition-duration: 0.25s;
}

form button:hover {
    background-color: rgb(245, 247, 249);
}

/* ===== Background Bubbles ===== */
.bg-bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1 !important;
    pointer-events: none !important;
}

.bg-bubbles li {
    position: absolute;
    list-style: none;
    display: block;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.15);
    bottom: -160px;
    animation: square 25s infinite;
    transition-timing-function: linear;
    border-radius: 50% !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.bg-bubbles li:nth-child(1) {
    left: 10%;
}

.bg-bubbles li:nth-child(2) {
    left: 20%;
    width: 80px;
    height: 80px;
    animation-delay: 2s;
    animation-duration: 17s;
}

.bg-bubbles li:nth-child(3) {
    left: 25%;
    animation-delay: 4s;
}

.bg-bubbles li:nth-child(4) {
    left: 40%;
    width: 60px;
    height: 60px;
    animation-duration: 22s;
    background-color: rgba(255, 255, 255, 0.25);
}

.bg-bubbles li:nth-child(5) {
    left: 70%;
}

.bg-bubbles li:nth-child(6) {
    left: 80%;
    width: 120px;
    height: 120px;
    animation-delay: 3s;
    background-color: rgba(255, 255, 255, 0.2);
}

.bg-bubbles li:nth-child(7) {
    left: 32%;
    width: 160px;
    height: 160px;
    animation-delay: 7s;
}

.bg-bubbles li:nth-child(8) {
    left: 55%;
    width: 20px;
    height: 20px;
    animation-delay: 15s;
    animation-duration: 40s;
}

.bg-bubbles li:nth-child(9) {
    left: 25%;
    width: 10px;
    height: 10px;
    animation-delay: 2s;
    animation-duration: 40s;
    background-color: rgba(255, 255, 255, 0.3);
}

.bg-bubbles li:nth-child(10) {
    left: 90%;
    width: 160px;
    height: 160px;
    animation-delay: 11s;
}

@keyframes square {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-700px) rotate(600deg);
    }
}

/* ===== Form Fix Styles (from login-fix.css) ===== */
/* Đảm bảo form có thể tương tác */
.js-validation-signin {
    position: relative !important;
    z-index: 99999 !important;
    pointer-events: auto !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.js-validation-signin * {
    pointer-events: auto !important;
    position: relative !important;
}

/* Đảm bảo tất cả input trong form có thể tương tác */
.js-validation-signin input[type="text"],
.js-validation-signin input[type="password"],
.js-validation-signin input[type="email"] {
    position: relative !important;
    z-index: 100000 !important;
    pointer-events: auto !important;
    cursor: text !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.js-validation-signin input:focus {
    outline: 2px solid #47b2e4 !important;
    outline-offset: 2px !important;
}

/* Đảm bảo button có thể click */
.js-validation-signin button[type="submit"],
.js-validation-signin .btn {
    position: relative !important;
    z-index: 100000 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.js-validation-signin button:hover {
    opacity: 0.9 !important;
}

/* Đảm bảo link có thể click */
.js-validation-signin a {
    position: relative !important;
    z-index: 100000 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Đảm bảo hero-static không chặn tương tác */
.hero-static {
    position: relative !important;
    z-index: 99998 !important;
    pointer-events: auto !important;
    min-height: 100vh !important;
    width: 100% !important;
    padding: 2rem 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.hero-static .d-flex {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
}

/* Đảm bảo block-content không chặn tương tác */
.block-content {
    position: relative !important;
    z-index: 99997 !important;
    pointer-events: auto !important;
}

/* Đảm bảo form controls có thể tương tác */
.form-control {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 100000 !important;
}

/* Đảm bảo btn có thể tương tác */
.btn {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 100000 !important;
}

/* Đảm bảo wrapper không chặn tương tác */
.wrapper {
    pointer-events: auto !important;
}

/* Fix cho các theme có thể ảnh hưởng */
.wrapper * {
    pointer-events: auto !important;
}

/* Đảm bảo không có element nào che phủ form */
.js-validation-signin::before,
.js-validation-signin::after {
    display: none !important;
}

/* ===== Enhanced Login Styles (from login-enhanced.css) ===== */
/* Enhanced Login Container */
.login-container {
    max-width: 450px !important;
    width: 80% !important;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1) !important;
    border-radius: 20px !important;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

.login-container .block-content {
    padding: 2.7rem 2rem !important;
    border-radius: 20px !important;
}

/* Enhanced Form Styling */
.login-form {
    position: relative;
    z-index: 99999 !important;
    pointer-events: auto !important;
}

.login-input {
    border: 2px solid #e9ecef !important;
    border-radius: 12px !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 1.1rem !important;
    transition: all 0.3s ease !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
    width: 100% !important;
    max-width: 100% !important;
}

.login-input:focus {
    border-color: #47b2e4 !important;
    box-shadow: 0 0 0 0.2rem rgba(71, 178, 228, 0.25) !important;
    transform: translateY(-2px) !important;
    background: #ffffff !important;
    width: 100% !important;
    max-width: 100% !important;
}

.login-input::placeholder {
    color: #6c757d !important;
    font-weight: 400 !important;
}

/* Khung password */
.password-wrapper {
    position: relative;
    width: 100%;
}

/* Tạo khoảng trống bên phải cho icon */
.password-wrapper .form-control {
    padding-right: 42px !important;
}

/* Icon con mắt CHUẨN */
.password-toggle {
    position: absolute !important;
    top: 50% !important;
    right: 12px !important;
    transform: translateY(-50%) !important;
    cursor: pointer !important;
    padding-top: 0; /* Fix for some robust frameworks */
    
    display: flex;
    align-items: center;
    justify-content: center;

    height: 24px;
    width: 24px;
    color: #6c757d;
    z-index: 100002 !important; /* Ensure it is above the input */
}

.password-toggle:hover {
    color: #0d6efd;
}

.password-toggle i {
    font-size: 18px;
}



.password-toggle:focus {
    outline: 2px solid #47b2e4 !important;
    outline-offset: 2px !important;
}

.password-toggle i {
    font-size: 0.85rem;
    line-height: 1;
}

/* Hide browser default password reveal/clear buttons */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

input[type="password"]::-webkit-credentials-auto-fill-button {
    display: none;
}

/* Enhanced Button */
.login-btn {
    border-radius: 12px !important;
    padding: 1rem 2rem !important;
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(71, 178, 228, 0.3) !important;
    border: none !important;
}

.login-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 25px rgba(71, 178, 228, 0.4) !important;
}

.login-btn:active {
    transform: translateY(-1px) !important;
}

/* Enhanced Links */
.login-link {
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    border: 1px solid #e9ecef !important;
}

.login-link:hover {
    background-color: #f8f9fa !important;
    border-color: #47b2e4 !important;
    color: #47b2e4 !important;
    transform: translateY(-1px) !important;
}

/* Enhanced Labels */
.login-form .form-label {
    font-size: 0.95rem !important;
    color: #495057 !important;
    margin-bottom: 0.75rem !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .login-container {
        width: 95% !important;
        margin: 1rem auto !important;
    }
    
    .login-container .block-content {
        padding: 2rem 1.5rem !important;
    }
    
    .login-input {
        font-size: 1rem !important;
        padding: 0.875rem 1rem !important;
    }
    
    .login-btn {
        font-size: 1rem !important;
        padding: 0.875rem 1.5rem !important;
    }

    /* Fix lỗi form bị che khuất trên mobile khi xoay ngang hoặc bật phím ảo */
    .hero-static {
        align-items: flex-start !important;
        padding-top: 4rem !important; /* Tăng padding top chút để đẹp hơn */
        padding-bottom: 2rem !important;
        height: auto !important;
        min-height: 100vh !important;
    }

    .wrapper {
        align-items: flex-start !important; /* Đảm bảo wrapper cũng start từ trên */
    }
}

/* Animation for form elements */
.login-form * {
    animation: fadeInUp 0.6s ease-out !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ensure form elements are interactive */
.login-form input,
.login-form button,
.login-form a {
    position: relative !important;
    z-index: 100000 !important;
    pointer-events: auto !important;
}
