/* /style/modern-auth.css */
:root {
    --primary-color: #0056b3;
    --primary-hover: #004494;
    --bg-gradient: linear-gradient(135deg, #007bff 0%, #004e92 100%);
    --card-bg: #ffffff;
    --text-main: #333;
    --text-muted: #6c757d;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    width: 100%;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    color: var(--text-main);
}

/* --- WRAPPER CHUNG (QUAN TRỌNG: CHỐNG VỠ GIAO DIỆN) --- */
.main-wrapper {
    width: 100%;
    max-width: 420px; /* Tỷ lệ cân đối tập trung vào phần đăng nhập chính */
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}
    /* Với trang Update Info cần rộng hơn */
    .main-wrapper.wide {
        max-width: 600px;
    }

/* --- LOGO --- */
.brand-logo {
    margin-bottom: 20px;
    text-align: center;
    width: 100%;
}

    .brand-logo img {
        max-width: 170px;
        height: auto;
        object-fit: contain;
        filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
    }

/* --- CARD CONTAINER (HỘP TRẮNG) --- */
.auth-card {
    background: var(--card-bg);
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    padding: 32px 28px;
    box-sizing: border-box;
    min-width: 320px; /* Chống co nhỏ quá mức */
    position: relative;
    overflow: hidden; /* Để bo góc cho đẹp */
}

/* --- TYPOGRAPHY --- */
.form-title {
    text-align: center;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 22px;
    color: var(--text-main);
}

.form-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 22px;
}

/* --- INPUT FIELDS --- */
.form-group {
    margin-bottom: 18px;
}

.forgot-password-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -4px;
    margin-bottom: 18px;
    font-size: 13px;
}

    .forgot-password-row a {
        text-decoration: none;
        color: var(--primary-color);
        font-weight: 500;
    }

        .forgot-password-row a:hover {
            text-decoration: underline;
        }

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

.input-wrapper {
    position: relative;
}

.form-control-custom {
    width: 100%;
    padding: 12px 40px 12px 40px; /* Chừa chỗ cho icon 2 bên */
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    box-sizing: border-box;
    background-color: #fcfcfc;
}

    .form-control-custom:focus {
        outline: none;
        border-color: var(--primary-color);
        background-color: #fff;
        box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
    }
    /* Input bị disable */
    .form-control-custom[disabled] {
        background-color: #e9ecef;
        color: #6c757d;
        cursor: not-allowed;
        border-style: dashed;
    }

/* --- ICONS --- */
.field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 16px;
    z-index: 2;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #adb5bd;
    padding: 5px;
    z-index: 2;
}

    .toggle-password:hover {
        color: var(--primary-color);
    }

/* --- BUTTONS --- */
.btn-submit {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-submit:hover {
        background-color: var(--primary-hover);
        box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
    }

/* --- RADIO CUSTOM (Login) --- */
.custom-radio-group {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
}

    .custom-radio-group table {
        width: 100%;
    }

    .custom-radio-group label {
        display: block;
        text-align: center;
        padding: 8px;
        border: 1px solid #e9ecef;
        background: #f8f9fa;
        color: #6c757d;
        border-radius: 6px;
        cursor: pointer;
        font-size: 13px;
        white-space: nowrap;
        transition: 0.2s;
    }

    .custom-radio-group input[type="radio"] {
        display: none;
    }

        .custom-radio-group input[type="radio"]:checked + label {
            background-color: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

/* --- ALTERNATIVE LOGIN METHODS (Sprint 33 & 35) --- */
.login-methods-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0 12px 0;
    color: var(--text-muted);
    font-size: 12px;
}

    .login-methods-divider::before,
    .login-methods-divider::after {
        content: '';
        flex: 1;
        border-bottom: 1px solid #e9ecef;
    }

    .login-methods-divider span {
        padding: 0 10px;
        white-space: nowrap;
    }

.alt-login-methods {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.btn-alt-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-width: 0;
    padding: 8px 6px;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    color: #495057;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn-alt-method:hover {
        border-color: var(--primary-color);
        color: var(--primary-color);
        background-color: rgba(0, 86, 179, 0.04);
    }

/* --- CLOUDFLARE TURNSTILE (INTERACTION-ONLY BOTTOM SLOT) --- */
.turnstile-bottom-slot {
    display: flex;
    justify-content: center;
    width: 100%;
    line-height: 0;
}

    .turnstile-bottom-slot .cf-turnstile {
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .turnstile-bottom-slot:has(iframe[style*="height: 65px"]),
    .turnstile-bottom-slot:has(iframe[style*="height: 1"]) {
        margin-top: 14px;
    }

/* --- UTILITIES (Footer, Links, Alert) --- */
.copyright {
    margin-top: 22px;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
}

    .copyright a {
        color: white;
        text-decoration: none;
    }

.back-link {
    text-align: center;
    margin-top: 15px;
    display: block;
    font-size: 14px;
    color: #6c757d;
    text-decoration: none;
}

    .back-link:hover {
        color: var(--primary-color);
    }

/* Toast & Alert */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.alert-custom {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    display: none;
}

.alert-danger-custom {
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c6cb;
}

.alert-success-custom {
    background: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* --- STYLE RIÊNG CHO TRANG ERROR (InvalidAccess) --- */
.auth-card.error-mode::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: #dc3545;
}

.error-icon {
    width: 100px;
    height: 100px;
    background-color: #fde8e9;
    color: #dc3545;
    border-radius: 50%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 50px !important; 
    margin: 0 auto 20px auto;
    animation: pulse 2s infinite;
}

    .error-icon i, 
    .error-icon svg {
        font-size: inherit !important; /* Kế thừa 50px từ cha */
        width: auto !important;
        height: auto !important;
        line-height: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: inline-block !important;
    }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4); }
    70% { box-shadow: 0 0 0 15px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Thêm class này để style cho ô nhập Captcha của DevExpress */
.captcha-input {
    width: 100% !important;
    margin-top: 5px !important;
    border: 1px solid #dee2e6 !important;
    padding: 10px !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    font-size: 14px !important;
}

    /* Style khi focus vào ô captcha */
    .captcha-input:focus {
        border-color: var(--primary-color) !important;
        outline: none !important;
        box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1) !important;
    }
