* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

:root {
    --primary-color: var(--brand, #14a800);
    --text-color: #393a3d;
}

body {
    background-color: #ffffff;
    background-image: url("../img/background/login01.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.system-title {
    text-align: center;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-card {
    width: 100%;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    height: 50px;
}

/* จัดให้ข้อความอยู่ตรงกลาง */
.login-card > div:nth-child(2) {
    text-align: center;
    margin-bottom: 25px;
}

h1 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 25px;
    color: var(--text-color);
    font-weight: 600;
}

.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #6b6c72;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.password-input {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #6b6c72;
}

.toggle-password i {
    font-size: 20px;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.remember-me {
    display: flex;
    align-items: center;
}

.remember-me input {
    margin-right: 8px;
}

.remember-me label {
    font-size: 14px;
    color: #6b6c72;
}

.forgot-password {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background-color: var(--brand-hover, #128f00);
}

.separator {
    position: relative;
    text-align: center;
    margin: 25px 0;
}

.separator::before, 
.separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background-color: #e5e5e5;
}

.separator::before {
    left: 0;
}

.separator::after {
    right: 0;
}

.separator span {
    display: inline-block;
    padding: 0 10px;
    background-color: white;
    position: relative;
    color: #6b6c72;
    font-size: 14px;
}

.social-login {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.social-login button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.social-login button:hover {
    background-color: #f8f8f8;
}

.social-login img {
    height: 20px;
    margin-right: 10px;
}

.social-login span {
    font-size: 14px;
    color: var(--text-color);
}

.register-link {
    text-align: center;
}

.register-link p {
    font-size: 14px;
    color: #6b6c72;
}

.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    text-decoration: underline;
}

.login-footer {
    margin-top: 20px;
    text-align: center;
}

.login-footer p {
    font-size: 12px;
    color: #6b6c72;
}

/* ===================================================================
   TWO-FACTOR AUTHENTICATION MODAL
   =================================================================== */

.modal-2fa {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-2fa.show {
    display: flex !important;
    justify-content: center;
    align-items: center;
}

.modal-2fa-content {
    background-color: white;
    border-radius: 12px;
    padding: 40px 30px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease;
}

.modal-2fa-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-2fa-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.modal-2fa-header h2 {
    font-size: 22px;
    color: var(--text-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.modal-2fa-header p {
    font-size: 14px;
    color: #6b6c72;
    margin: 0;
}

/* OTP Input Boxes */
.otp-input-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.otp-input {
    width: 50px;
    height: 55px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid #e5e5e5;
    border-radius: 8px;
    transition: all 0.2s;
    background-color: #f8f9fa;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(var(--brand-rgb, 20,168,0), 0.1);
}

.otp-input:disabled {
    background-color: #f0f0f0;
    cursor: not-allowed;
}

/* OTP Error Message */
.otp-error {
    display: none;
    background-color: #fee;
    border: 1px solid #fcc;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    color: #c33;
    font-size: 14px;
    align-items: center;
    gap: 8px;
}

.otp-error.show {
    display: flex;
}

.otp-error i {
    font-size: 20px;
}

/* Modal Actions */
.modal-2fa-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.btn-2fa {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-2fa-cancel {
    background-color: #f0f0f0;
    color: var(--text-color);
}

.btn-2fa-cancel:hover {
    background-color: #e0e0e0;
}

.btn-2fa-verify {
    background-color: var(--primary-color);
    color: white;
}

.btn-2fa-verify:hover {
    background-color: var(--brand-hover, #129000);
}

.btn-2fa-verify:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Modal Help */
.modal-2fa-help {
    text-align: center;
}

.modal-2fa-help p {
    font-size: 13px;
    color: #6b6c72;
    margin: 0;
}

.modal-2fa-help a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.modal-2fa-help a:hover {
    text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .login-card {
        padding: 20px;
    }
    
    h1 {
        font-size: 22px;
    }
    
    .login-logo img {
        height: 40px;
    }
    
    .modal-2fa-content {
        padding: 30px 20px;
    }
    
    .otp-input {
        width: 45px;
        height: 50px;
        font-size: 20px;
    }
    
    .otp-input-container {
        gap: 8px;
    }
} 
/* ===== Background illustration in the theme color (assets/js/theme.js) =====
   No custom color → the original image above. With a color: the login01 pattern recolored —
   CSS filter first, then the exact canvas recolor (html[data-theme-bg]) once it is ready. */
html[data-theme-color] body { background-image: none !important; }
html[data-theme-color] body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: url("../img/background/login01.webp") center / cover no-repeat;
    filter: hue-rotate(var(--brand-bg-hue, 0deg)) saturate(var(--brand-bg-sat, 1));
}
html[data-theme-color][data-theme-bg] body::before {
    background-image: var(--brand-bg-image);
    filter: none;
}
