/**
 * Modern Split-Screen Login Page
 * Layout cân đối với branding section và login form
 */

/* ========================================
   Reset AdminLTE Styles
   ======================================== */
body.login-page,
body.hold-transition.login-page {
    margin: 0 !important;
    padding: 0 !important;
    background: #f1f5f9 !important;
    height: 100vh !important;
    overflow: hidden !important;
}

/* ========================================
   Base Layout - Split Screen
   ======================================== */
.login-page {
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #f1f5f9 !important;
    position: relative !important;
    height: 100vh !important;
    width: 100% !important;
}

/* Background Pattern */
.login-page::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(148, 163, 184, 0.03) 10px, rgba(148, 163, 184, 0.03) 20px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(148, 163, 184, 0.03) 10px, rgba(148, 163, 184, 0.03) 20px);
    pointer-events: none;
    z-index: 0;
}

.login-container {
    display: flex !important;
    min-height: 100vh !important;
    width: 100% !important;
    position: relative !important;
    z-index: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ========================================
   Left Side - Branding Section
   ======================================== */
.login-branding {
    flex: 1 !important;
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 50%, #3b82f6 100%) !important;
    color: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: flex-start !important;
    padding: 60px 50px !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 100vh !important;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.login-branding::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.branding-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
}

.brand-logo {
    margin-bottom: 50px;
}

.brand-name {
    font-size: 42px;
    font-weight: 700;
    margin: 0 0 15px 0;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    color: #ffffff !important;
}

.brand-subtitle {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 400;
    opacity: 0.95;
    color: rgba(255, 255, 255, 0.9) !important;
}

.brand-subtitle i {
    font-size: 18px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    opacity: 0.9;
    transition: transform 0.2s ease, opacity 0.2s ease;
    color: #ffffff !important;
}

.feature-item:hover {
    transform: translateX(5px);
    opacity: 1;
}

.feature-item i {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.95) !important;
}

.feature-item span {
    color: rgba(255, 255, 255, 0.9) !important;
}

.brand-footer {
    position: absolute;
    bottom: 30px;
    left: 50px;
    right: 50px;
    z-index: 1;
    text-align: left;
    font-size: 13px;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.85) !important;
}

.brand-footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.85) !important;
}

/* ========================================
   Right Side - Login Form Section
   ======================================== */
.login-form-section {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 40px !important;
    background: #ffffff !important;
    position: relative !important;
    min-height: 100vh !important;
}

/* Right Accent Bar */
.accent-bar {
    width: 6px;
    background: linear-gradient(180deg, #2563eb 0%, #1e40af 100%);
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.login-header {
    margin-bottom: 35px;
    text-align: center;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b !important;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 15px;
    color: #64748b !important;
    margin: 0;
    font-weight: 400;
}

/* ========================================
   Form Elements
   ======================================== */
.login-form {
    margin-top: 30px;
}

.login-form .form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #334155 !important;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-label i {
    font-size: 16px;
    color: #64748b !important;
}

.input-group-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-modern {
    width: 100%;
    height: 52px;
    padding: 14px 16px !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 10px !important;
    font-size: 15px !important;
    color: #1e293b !important;
    background: #ffffff !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none !important;
}

.input-modern:focus {
    outline: none !important;
    border-color: #2563eb !important;
    background: #f8fafc !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
}

/* Password field needs padding for toggle button */
.password-wrapper .input-modern {
    padding-right: 50px !important;
}

.password-wrapper .input-modern:focus {
    padding-right: 50px !important;
}

.input-modern::placeholder {
    color: #94a3b8 !important;
    font-weight: 400;
}

/* Input Action Buttons */
.input-action-btn {
    position: absolute;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
    padding: 0;
    background: transparent;
    color: #64748b;
    font-size: 16px;
}

.input-action-btn:hover {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.input-action-btn:active {
    transform: scale(0.95);
}

/* Toggle password button (Eye icon) */
.toggle-password {
    right: 8px;
}

.toggle-password i {
    font-size: 16px;
    transition: opacity 0.2s ease;
}

.toggle-password .toggle-eye-slash {
    display: none;
}

/* ========================================
   Form Options
   ======================================== */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.checkbox-remember {
    display: flex;
    align-items: center;
}

.checkbox-custom-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #64748b !important;
    margin: 0;
    user-select: none;
    position: relative;
}

.custom-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.custom-checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s ease;
    background: #ffffff;
    flex-shrink: 0;
    display: inline-block;
}

.checkbox-custom-label:hover .custom-checkmark {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
}

.custom-checkbox:checked ~ .custom-checkmark {
    background: #2563eb;
    border-color: #2563eb;
}

.custom-checkbox:checked ~ .custom-checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    font-weight: 500;
    margin-left: 0;
}

.forgot-password {
    color: #2563eb !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: #1e40af !important;
    text-decoration: none;
}

/* ========================================
   Login Button
   ======================================== */
.btn-login {
    width: 100% !important;
    height: 52px !important;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%) !important;
    border: none !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
    position: relative;
    overflow: hidden;
    margin-bottom: 25px !important;
    padding: 0 !important;
}

.btn-login:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4) !important;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%) !important;
}

.btn-login:active {
    transform: translateY(0) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3) !important;
}

.btn-login:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.btn-text {
    display: inline-block;
}

.btn-loading {
    display: none !important;
}

.btn-login:disabled .btn-text {
    display: none;
}

.btn-login:disabled .btn-loading {
    display: inline-block !important;
}

/* ========================================
   Footer Links
   ======================================== */
.login-footer-links {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.check-order-link {
    color: #2563eb !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.check-order-link:hover {
    color: #1e40af !important;
    text-decoration: none;
    gap: 12px;
}

.check-order-link i {
    font-size: 14px;
}

/* ========================================
   Alerts
   ======================================== */
.login-form-section .alert {
    border-radius: 10px;
    border: none;
    padding: 14px 16px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.login-form-section .alert i {
    font-size: 18px;
    margin-top: 2px;
}

.login-form-section .alert-danger {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border-left: 4px solid #ef4444;
}

.login-form-section .alert-danger i {
    color: #ef4444 !important;
}

.login-form-section .alert .close {
    margin-left: auto;
    font-size: 20px;
    opacity: 0.6;
    transition: opacity 0.2s ease;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
}

.login-form-section .alert .close:hover {
    opacity: 1;
}

/* ========================================
   Hide AdminLTE Login Box Styles
   ======================================== */
.login-page .login-box,
.login-page .login-logo,
.login-page .login-box-body {
    display: none !important;
}

/* ========================================
   Disable iCheck for custom checkbox
   ======================================== */
.custom-checkbox + .icheckbox_square-blue,
.custom-checkbox + .icheckbox_square-blue + .icheckbox_square-blue {
    display: none !important;
}

.checkbox-custom-label .icheckbox_square-blue {
    display: none !important;
}

/* ========================================
   Right Accent Bar - Hide on mobile
   ======================================== */
@media (max-width: 992px) {
    .accent-bar {
        display: none;
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column !important;
    }
    
    .login-branding {
        padding: 40px 30px !important;
        min-height: auto !important;
    }
    
    .brand-name {
        font-size: 32px;
    }
    
    .brand-features {
        gap: 15px;
    }
    
    .feature-item {
        font-size: 14px;
    }
    
    .login-form-section {
        padding: 30px 20px !important;
        min-height: auto !important;
    }
    
    .brand-footer {
        position: absolute;
        bottom: 20px;
        left: 30px;
        right: 30px;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .login-branding {
        padding: 30px 20px !important;
    }
    
    .brand-name {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .brand-subtitle {
        font-size: 14px;
    }
    
    .brand-features {
        gap: 12px;
    }
    
    .feature-item {
        font-size: 13px;
    }
    
    .login-form-section {
        padding: 25px 15px !important;
    }
    
    .login-form-wrapper {
        max-width: 100%;
    }
    
    .login-header h2 {
    font-size: 24px;
    }
    
    .login-subtitle {
        font-size: 14px;
    }
    
    .input-modern {
        height: 48px;
        font-size: 16px !important; /* Prevent zoom on iOS */
    }
    
    .btn-login {
        height: 48px !important;
        font-size: 15px !important;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .login-branding {
        display: none;
    }
    
    .login-form-section {
        width: 100%;
    }
}

/* ========================================
   Accessibility
   ======================================== */
.input-modern:focus-visible,
.btn-login:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* ========================================
   Loading Animation
   ======================================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-loading {
    animation: spin 1s linear infinite;
}
