/**
 * MUI V2 Login Stylesheet.
 * Scoped strictly under body.mui-v2-login-template #mui-v2-login
 * Forces the Login Column to be bright/light and the Intro Column to be solid black.
 * Ignored/disabled dark mode styling for the login column completely.
 */

/* Force clean layout and disable header/footer spacing */
body.mui-v2-login-template {
    background-color: #FFFFFF !important;
    color: #1D1D1F !important;
    padding: 0 !important;
    margin: 0 !important;
}

html.dark body.mui-v2-login-template {
    background-color: #FFFFFF !important;
    color: #1D1D1F !important;
}

/* ==========================================
 * FORCE LIGHT THEME FOR THE ENTIRE LOGIN COLUMN (LEFT) IN DARK MODE
 * ========================================== */
html.dark body.mui-v2-login-template #mui-v2-page-root,
html.dark body.mui-v2-login-template #mui-v2-login,
html.dark body.mui-v2-login-template #mui-v2-page-content,
html.dark body.mui-v2-login-template .lg\:col-span-7,
html.dark body.mui-v2-login-template .bg-white {
    background-color: #FFFFFF !important;
    color: #1D1D1F !important;
}

html.dark body.mui-v2-login-template h1,
html.dark body.mui-v2-login-template h2:not(.lg\:col-span-5 *),
html.dark body.mui-v2-login-template p:not(.lg\:col-span-5 *),
html.dark body.mui-v2-login-template label:not(.lg\:col-span-5 *),
html.dark body.mui-v2-login-template span:not(.lg\:col-span-5 *),
html.dark body.mui-v2-login-template a:not(.lg\:col-span-5 *) {
    color: #1D1D1F !important;
}

html.dark body.mui-v2-login-template p.text-muted,
html.dark body.mui-v2-login-template .text-muted {
    color: #8E8E93 !important;
}

html.dark body.mui-v2-login-template .text-xs.text-\[\#8E8E93\] a,
html.dark body.mui-v2-login-template .text-xs a {
    color: #8E8E93 !important;
}

/* CSS Fallback to hide site header and footer on login page */
body.mui-v2-login-template header,
body.mui-v2-login-template footer,
body.mui-v2-login-template #mui-v2-root,
body.mui-v2-login-template #mui-v2-footer-root,
body.mui-v2-login-template .site-header,
body.mui-v2-login-template .site-footer,
body.mui-v2-login-template .mui-v2-header-mount,
body.mui-v2-login-template .mui-v2-footer-mount {
    display: none !important;
    height: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Rescue visibility for login template containers */
body.mui-v2-login-template #mui-v2-page-root,
body.mui-v2-login-template #mui-v2-login,
body.mui-v2-login-template #mui-v2-page-content,
body.mui-v2-login-template section {
    display: block !important;
    visibility: visible !important;
}

body.mui-v2-login-template #mui-v2-login {
    isolation: isolate !important;
    font-family: BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    background-color: #FFFFFF !important;
}

body.mui-v2-login-template #mui-v2-login a {
    text-decoration: none !important;
    transition: color 180ms ease !important;
}

/* ==========================================
 * Defensive Column Ordering (Left: Form, Right: Intro)
 * Full native-CSS grid fallback — works even if Tailwind CDN fails/is blocked.
 * STRATEGY: Use .min-h-screen as a fingerprint for the outer layout grid,
 *           because only the outer grid has class="grid ... min-h-screen".
 *           Inner grids (stats, etc.) do NOT have min-h-screen.
 * ========================================== */

/* Mobile: single column stacked layout — outer layout grid only */
body.mui-v2-login-template #mui-v2-login #mui-v2-page-content > .grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
}

body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 {
    display: none !important;
}

/* Desktop (≥1024px): 12-column grid, 7:5 split */
@media (min-width: 1024px) {
    /* Outer layout grid only */
    body.mui-v2-login-template #mui-v2-login #mui-v2-page-content > .grid {
        display: grid !important;
        grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
        min-height: 100vh !important;
    }

    /* Login form: 7 of 12 columns */
    body.mui-v2-login-template #mui-v2-login .lg\:col-span-7 {
        grid-column: span 7 / span 7 !important;
        order: 1 !important;
    }

    /* Stats/intro panel: 5 of 12 columns */
    body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 {
        display: flex !important;
        grid-column: span 5 / span 5 !important;
        order: 2 !important;
    }
}

/* Rescue: inner grids (stats, form rows) must NOT inherit the outer 12-column template */
body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 .grid,
#mui-v2-login .lg\:col-span-5 .grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px 32px !important;
    min-height: unset !important;
}

body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 .grid .col-span-2,
#mui-v2-login .lg\:col-span-5 .grid .col-span-2 {
    grid-column: span 2 / span 2 !important;
}

body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 .grid .space-y-1,
#mui-v2-login .lg\:col-span-5 .grid .space-y-1 {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 .grid .space-y-1 p,
#mui-v2-login .lg\:col-span-5 .grid .space-y-1 p {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 .grid .space-y-1 p.text-3xl,
#mui-v2-login .lg\:col-span-5 .grid .space-y-1 p.text-3xl {
    font-size: 30px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    color: #FFFFFF !important;
}

body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 .grid .space-y-1 p.text-\[10px\],
#mui-v2-login .lg\:col-span-5 .grid .space-y-1 p.text-\[10px\] {
    font-size: 10px !important;
    font-weight: 700 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    color: #A1A1A6 !important;
    margin-top: 4px !important;
}


/* ==========================================
 * User Registration Form Styling (ALWAYS LIGHT)
 * ========================================== */

body.mui-v2-login-template #mui-v2-login .user-registration,
body.mui-v2-login-template #mui-v2-login .ur-frontend-form {
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.mui-v2-login-template #mui-v2-login form.ur-frontend-form {
    width: 100% !important;
}

body.mui-v2-login-template #mui-v2-login .ur-form-grid,
body.mui-v2-login-template #mui-v2-login .ur-form-row {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
}

body.mui-v2-login-template #mui-v2-login .ur-field-wrapper {
    margin-bottom: 20px !important;
    display: block !important;
    width: 100% !important;
    float: none !important;
}

/* Labels - Force Mockup font sizes & uppercase */
body.mui-v2-login-template #mui-v2-login label,
body.mui-v2-login-template #mui-v2-login .ur-field-wrapper label {
    display: block !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #1D1D1F !important;
    margin-bottom: 8px !important;
    float: none !important;
    text-transform: uppercase !important;
}

/* Input fields - Force white background, light borders and 8px border-radius */
body.mui-v2-login-template #mui-v2-login .ur-field-wrapper input[type="text"],
body.mui-v2-login-template #mui-v2-login .ur-field-wrapper input[type="email"],
body.mui-v2-login-template #mui-v2-login .ur-field-wrapper input[type="password"] {
    display: block !important;
    width: 100% !important;
    height: 48px !important;
    border-radius: 8px !important;
    border: 1px solid #D2D2D7 !important;
    background: #FFFFFF !important;
    color: #1D1D1F !important;
    padding: 0 16px !important;
    font-size: 14px !important;
    outline: 0 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: all 180ms ease !important;
}

html.dark body.mui-v2-login-template #mui-v2-login .ur-field-wrapper input[type="text"],
html.dark body.mui-v2-login-template #mui-v2-login .ur-field-wrapper input[type="email"],
html.dark body.mui-v2-login-template #mui-v2-login .ur-field-wrapper input[type="password"] {
    background: #FFFFFF !important;
    border-color: #D2D2D7 !important;
    color: #1D1D1F !important;
}

body.mui-v2-login-template #mui-v2-login .ur-field-wrapper input:focus,
html.dark body.mui-v2-login-template #mui-v2-login .ur-field-wrapper input:focus {
    border-color: #0267B2 !important;
    box-shadow: 0 0 0 4px rgba(2, 103, 178, 0.12) !important;
}

/* ==========================================
 * Remember Me Checkbox (FIXED CHECKBOX BUTTON VISIBILITY)
 * ========================================== */
body.mui-v2-login-template #mui-v2-login .ur-field-wrapper.rememberme,
body.mui-v2-login-template #mui-v2-login .rememberme {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
    float: none !important;
}

body.mui-v2-login-template #mui-v2-login .ur-field-wrapper.rememberme input[type="checkbox"],
body.mui-v2-login-template #mui-v2-login .rememberme input[type="checkbox"],
html.dark body.mui-v2-login-template #mui-v2-login .ur-field-wrapper.rememberme input[type="checkbox"],
html.dark body.mui-v2-login-template #mui-v2-login .rememberme input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #D2D2D7 !important;
    border-radius: 4px !important;
    background: #FFFFFF !important;
    cursor: pointer !important;
    display: inline-block !important;
    appearance: checkbox !important;
    -webkit-appearance: checkbox !important;
    opacity: 1 !important;
    visibility: visible !important;
}

body.mui-v2-login-template #mui-v2-login .ur-field-wrapper.rememberme label,
body.mui-v2-login-template #mui-v2-login .rememberme label,
html.dark body.mui-v2-login-template #mui-v2-login .ur-field-wrapper.rememberme label,
html.dark body.mui-v2-login-template #mui-v2-login .rememberme label {
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #8E8E93 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    display: inline-block !important;
    cursor: pointer;
}

/* Submit Button & Lost Password Link Container */
body.mui-v2-login-template #mui-v2-login .ur-submit-button {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

body.mui-v2-login-template #mui-v2-login button[type="submit"],
body.mui-v2-login-template #mui-v2-login input[type="submit"].ur-submit-button,
body.mui-v2-login-template #mui-v2-login .ur-button,
html.dark body.mui-v2-login-template #mui-v2-login button[type="submit"],
html.dark body.mui-v2-login-template #mui-v2-login input[type="submit"].ur-submit-button {
    width: 100% !important;
    height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 0 !important;
    border-radius: 9999px !important;
    background: #0267B2 !important; /* DevOps VN Brand Blue */
    color: #FFFFFF !important;
    -webkit-text-fill-color: #FFFFFF !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(2, 103, 178, 0.15) !important;
    transition: all 180ms ease !important;
    box-sizing: border-box !important;
}

body.mui-v2-login-template #mui-v2-login button[type="submit"]:hover,
body.mui-v2-login-template #mui-v2-login input[type="submit"].ur-submit-button:hover,
html.dark body.mui-v2-login-template #mui-v2-login button[type="submit"]:hover,
html.dark body.mui-v2-login-template #mui-v2-login input[type="submit"].ur-submit-button:hover {
    background: #2d99e4 !important;
    box-shadow: 0 6px 16px rgba(45, 153, 228, 0.25) !important;
    transform: translateY(-1px) !important;
}

/* Lost Password Link wrapper and styling */
body.mui-v2-login-template #mui-v2-login .ur-lost-password {
    display: block !important;
    text-align: right !important;
    margin-top: 12px !important;
    font-size: 13px !important;
}

body.mui-v2-login-template #mui-v2-login .ur-lost-password a,
html.dark body.mui-v2-login-template #mui-v2-login .ur-lost-password a {
    color: #6E6E73 !important;
    font-weight: 600 !important;
}

body.mui-v2-login-template #mui-v2-login .ur-lost-password a:hover,
html.dark body.mui-v2-login-template #mui-v2-login .ur-lost-password a:hover {
    color: #0267B2 !important;
    text-decoration: underline !important;
}

/* ==========================================
 * Divider "HOẶC" Styling
 * ========================================== */
body.mui-v2-login-template #mui-v2-login .relative.flex.py-2.items-center span,
html.dark body.mui-v2-login-template #mui-v2-login .relative.flex.py-2.items-center span {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #8E8E93 !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
}

/* ==========================================
 * Nextend Social Login (Google) Centered & Stylized
 * ========================================== */

body.mui-v2-login-template #mui-v2-login .nextend-login-wrapper {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
}

body.mui-v2-login-template #mui-v2-login .nextend-login-wrapper .nsl-container,
body.mui-v2-login-template #mui-v2-login .nextend-login-wrapper .nsl-container-grid,
body.mui-v2-login-template #mui-v2-login .nextend-login-wrapper .nsl-container-buttons {
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.mui-v2-login-template #mui-v2-login .nextend-login-wrapper a.nsl-button,
html.dark body.mui-v2-login-template #mui-v2-login .nextend-login-wrapper a.nsl-button {
    width: 100% !important;
    max-width: 100% !important;
    height: 48px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 9999px !important;
    border: none !important;
    background: #F2F2F7 !important; /* Soft light gray like mockup */
    color: #1D1D1F !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    box-shadow: none !important;
    transition: all 180ms ease !important;
    box-sizing: border-box !important;
    text-shadow: none !important;
}

body.mui-v2-login-template #mui-v2-login .nextend-login-wrapper a.nsl-button:hover,
html.dark body.mui-v2-login-template #mui-v2-login .nextend-login-wrapper a.nsl-button:hover {
    background: #E5E5EA !important;
    transform: translateY(-1px) !important;
}

body.mui-v2-login-template #mui-v2-login .nextend-login-wrapper .nsl-button-svg-container {
    margin-right: 12px !important;
}

/* Reduce Đăng ký ngay font-weight by 100 values to match mockup */
body.mui-v2-login-template #mui-v2-login p.text-center a,
html.dark body.mui-v2-login-template #mui-v2-login p.text-center a {
    color: #0267B2 !important;
    font-weight: 700 !important;
}

/* Sub-footer terms & privacy links styling */
body.mui-v2-login-template #mui-v2-login .text-xs.text-\[\#8E8E93\] a,
body.mui-v2-login-template #mui-v2-login .text-xs a,
html.dark body.mui-v2-login-template #mui-v2-login .text-xs.text-\[\#8E8E93\] a,
html.dark body.mui-v2-login-template #mui-v2-login .text-xs a {
    color: #8E8E93 !important;
}

body.mui-v2-login-template #mui-v2-login .text-xs.text-\[\#8E8E93\] a:hover,
body.mui-v2-login-template #mui-v2-login .text-xs a:hover {
    color: #555555 !important;
}

/* ==========================================
 * Right Banner Column overrides (ALWAYS SOLID BLACK)
 * ========================================== */

body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 {
    background-color: #000000 !important;
    background: #000000 !important;
    color: #FFFFFF !important;
}

body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 h2,
body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 p,
body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 div {
    color: #FFFFFF !important;
}

body.mui-v2-login-template #mui-v2-login .lg\:col-span-5 p.text-\[10px\] {
    color: #A1A1A6 !important;
}
