/* ============================================================
   LOGIN.CSS — Style riêng cho trang đăng nhập 
   ============================================================ */

body.page-login * {
    font-family: 'Be Vietnam Pro', sans-serif;
    box-sizing: border-box;
}

body.page-login {
    background-color: #f1f5f9;
    margin: 0;
    overflow: hidden; /* Prevent scrolling entirely on desktop */
}

/* Base Layout */
.auth-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ── Màn hình trái (Left Panel) ── */
.auth-left {
    flex: 0 0 58%; /* Tăng chút xíu bên trái để bên phải hẹp lại, đẩy form ra gần viền hơn */
    background: linear-gradient(135deg, #1e40af, #3b82f6); 
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 80px; 
    position: relative;
    overflow: hidden;
}

/* Đường line uốn lượn trang trí nền */
.auth-left-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.auth-left-bg::before,
.auth-left-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
}

.auth-left-bg::before {
    width: 800px;
    height: 800px;
    top: -200px;
    left: -300px;
    box-shadow: inset 0 0 100px rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.auth-left-bg::after {
    width: 600px;
    height: 600px;
    bottom: -150px;
    right: -200px;
    box-shadow: inset 0 0 80px rgba(255, 255, 255, 0.1);
}

/* Thêm wave line (Data URI) */
.auth-left-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 300px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.05" d="M0,192L48,176C96,160,192,128,288,144C384,160,480,224,576,213.3C672,203,768,117,864,106.7C960,96,1056,160,1152,186.7C1248,213,1344,203,1392,197.3L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path><path fill="%23ffffff" fill-opacity="0.1" d="M0,64L60,85.3C120,107,240,149,360,176C480,203,600,213,720,202.7C840,192,960,160,1080,165.3C1200,171,1320,213,1380,234.7L1440,256L1440,320L1380,320C1320,320,1200,320,1080,320C960,320,840,320,720,320C600,320,480,320,360,320C240,320,120,320,60,320L0,320Z"></path></svg>');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: bottom center;
    z-index: 1;
    pointer-events: none;
}

/* Nội dung cột trái */
.auth-left-content {
    position: relative;
    z-index: 10;
    max-width: 650px; 
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

@media (min-width: 992px) {
    .auth-left-content {
        align-items: flex-start;
        text-align: left;
    }
}

.auth-brand-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;   
    background: transparent;
    padding: 0; 
    border: none;
}

.auth-logo {
    width: 64px; 
    height: 64px;
    background: #ffffff;
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 4px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.15); /* Shadow nhẹ tạo cảm giác nổi */
}

.auth-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.auth-brand-name {
    font-size: 18px;       
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap; 
}

.auth-title {
    font-size: 38px;       /* Tôn lên để làm điểm nhấn chính */
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 16px;
    color: #ffffff;
    white-space: nowrap; 
}

.auth-desc {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 50px; /* Đẩy các tính năng xuống sâu hơn một chút để thoáng đãng hơn */
    font-weight: 400;
    width: 100%;       
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 18px;             /* Tăng khoảng cách các ô tính năng */
    width: 100%;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 15px; /* Tăng xốp chữ to lên 1 xíu */
    font-weight: 500;
    color: #ffffff;
    background: rgba(255,255,255,0.1);
    padding: 14px 20px;    /* Làm các khối chữ nhật căng dày dặn đẹp hơn */
    border-radius: 10px;
    backdrop-filter: blur(4px);
    transition: background 0.3s ease;
}

.feature-item:hover {
    background: rgba(255,255,255,0.15);
}

.feature-item i {
    font-size: 20px;
    color: #93c5fd; 
}

/* ── Màn hình phải (Right Panel - Form) ── */
.auth-right {
    flex: 0 0 42%; /* Ép màn phải bé lại một tí để cái form to sát viền hơn */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    padding: 40px; 
    position: relative;
    z-index: 20;
}

.auth-form-card {
    width: 100%;
    max-width: 420px;      
    background: #ffffff;
    padding: 36px 40px;     
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.08); 
    border: 1px solid rgba(0,0,0,0.02);
}

.auth-form-header {
    margin-bottom: 24px;
    text-align: center;
}

.auth-form-header h2 {
    font-size: 24px;       
    font-weight: 700;
    color: #1e3a8a;        
    margin-bottom: 4px;
}

.auth-form-header p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

/* Error Alert */
.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

/* Login inputs */
.form-group {
    margin-bottom: 16px;   
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper i.ph-user,
.input-icon-wrapper i.ph-lock-key {
    position: absolute;
    left: 14px;
    font-size: 18px;
    color: #94a3b8;
    transition: color 0.2s ease;
    z-index: 2;
}

.input-icon-wrapper .form-control {
    width: 100%;
    padding: 10px 14px 10px 42px; 
    height: 44px;                 
    font-size: 14px;
    color: #0f172a;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    transition: all 0.2s ease;
    font-family: inherit;
}

.input-icon-wrapper .form-control:hover {
    border-color: #94a3b8;
}

.input-icon-wrapper .form-control:focus {
    outline: none;
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.input-icon-wrapper .form-control:focus + i,
.input-icon-wrapper .form-control:focus ~ i.ph-user,
.input-icon-wrapper .form-control:focus ~ i.ph-lock-key {
    color: #3b82f6;
}

/* Password Toggle */
.toggle-password-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s ease;
    z-index: 2;
    border-radius: 6px;
}

.toggle-password-btn i {
    position: static;
}

.toggle-password-btn:hover {
    color: #475569;
    background: rgba(0,0,0,0.05);
}

.input-icon-wrapper input[type="password"],
.input-icon-wrapper input#password_input {
    padding-right: 42px;
}

/* Hide native browser password reveal controls to avoid duplicate eye icon */
.input-icon-wrapper input[type="password"]::-ms-reveal,
.input-icon-wrapper input[type="password"]::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

.input-icon-wrapper input[type="password"]::-webkit-credentials-auto-fill-button,
.input-icon-wrapper input[type="password"]::-webkit-contacts-auto-fill-button,
.input-icon-wrapper input[type="password"]::-webkit-password-toggle-button {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

/* Checkbox */
.remember-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: 8px;
    position: relative;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 16px;
    width: 16px;
    background-color: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
    border-color: #3b82f6;
}

.checkbox-container input:checked ~ .checkmark {
    background-color: #3b82f6;
    border-color: #3b82f6;
}

.checkmark:after {
    content: "";
    display: none;
    width: 3px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

/* Buttons */
.btn-login {
    width: 100%;
    height: 44px;      
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    background: #3b82f6; 
    color: #fff;
    border: none;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-login:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    font-weight: bold;
    font-size: 16px;
}

/* Auth hint */
.auth-hint {
    margin-top: 24px;      
    padding: 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    font-size: 12px;       
    color: #475569;
    line-height: 1.5;
    text-align: center;
}

.auth-hint code {
    background: #ffffff;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
    color: #1e3a8a;
    border: 1px solid #e2e8f0;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    body.page-login {
        overflow: auto; /* Cho phép cuộn khi rơi vào tablet/mobile */
        overflow-x: hidden;
    }

    .auth-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .auth-left {
        flex: auto;
        padding: 40px 24px;
    }
    
    .auth-left-content {
        align-items: center;
        text-align: center;
    }

    .auth-title { 
        font-size: 28px; 
        white-space: normal; /* Cho phép rớt dòng ở mobile */
    }
    
    .auth-brand-name {
        white-space: normal;
    }

    .auth-right {
        flex: auto;
        width: 100%;
        padding: 40px 24px;
    }

    .auth-form-card {
        max-width: 400px;
    }
}

@media (max-width: 575px) {
    .auth-left { padding: 32px 20px; }
    .auth-brand-name { font-size: 14px; }
    .auth-title { font-size: 24px; }
    .auth-desc { font-size: 13px; }
    
    .auth-illustration-wrap {
        height: 140px;
    }
    
    .feature-item {
        justify-content: center;
        font-size: 13px;
        padding: 8px 12px;
    }

    .auth-right { 
        padding: 32px 20px; 
    }
    
    .auth-form-card {
        padding: 24px 20px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    }
}
