/* Nền đen mờ bọc ngoài Popup */
.ch-modal-overlay {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
}
/* Class dùng cho JS kích hoạt hiển thị */
.ch-modal-overlay.show-modal {
    display: flex;
}

/* Khung Form Đăng Nhập */
.ch-login-container {
    width: 90%;
    max-width: 500px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    font-family: inherit;
    border: 1px solid #e5e5e5;
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Header */
.ch-login-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e5e5;
}
.ch-login-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #4a4a4a;
}
.ch-close-btn {
    font-size: 28px;
    color: #b5b5b5;
    text-decoration: none;
    line-height: 1;
}
.ch-close-btn:hover {
    color: #ff0000;
}

/* Body */
.ch-login-body {
    padding: 25px;
}
.ch-form-group {
    margin-bottom: 20px;
}
.ch-form-group label {
    display: block;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 8px;
    font-size: 15px;
}
.ch-form-group input[type="text"],
.ch-form-group input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #c9d8e5;
    border-radius: 4px;
    font-size: 15px;
    color: #333;
    background-color: #fcfcfc;
    box-sizing: border-box;
}
.ch-form-group input[type="text"]:focus,
.ch-form-group input[type="password"]:focus {
    border-color: #2b70b5;
    outline: none;
    box-shadow: 0 0 0 1px #2b70b5;
}
.ch-form-group input::placeholder {
    color: #aeb6bf;
}

/* Checkbox */
.ch-remember label {
    font-weight: 600;
    color: #4a4a4a;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.ch-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

/* Nút Submit */
.ch-submit-btn {
    background: #2b70b5; 
    background: linear-gradient(180deg, #3281cd 0%, #2161a0 100%);
    color: #fff;
    border: none;
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}
.ch-submit-btn:hover {
    background: #1c5288;
}

/* Footer Links */
.ch-login-footer {
    padding: 20px 25px;
    border-top: 1px solid #e5e5e5;
    font-size: 15px;
    background-color: #fafafa;
    border-radius: 0 0 8px 8px;
}
.ch-login-footer a {
    color: #2b70b5;
    text-decoration: none;
}
.ch-login-footer a:hover {
    text-decoration: underline;
}

/* Container bọc ngoài Form Đăng Ký */
.ch-register-container {
    max-width: 550px;
    margin: 40px auto;
    background: #ffffff;
    padding: 35px 40px;
    border-radius: 6px;
    border: 1px solid #eaeaea;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    font-family: inherit;
}

/* Dấu sao màu đỏ cho trường bắt buộc */
.ch-required {
    color: #e53935;
    font-weight: bold;
    margin-left: 2px;
}

/* Định dạng thẻ Input */
.ch-form-group input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    font-size: 15px;
    color: #333;
    background-color: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}
.ch-form-group input[type="email"]:focus {
    border-color: #4a68b1;
    outline: none;
    box-shadow: 0 0 0 1px #4a68b1;
}

/* Nút ĐĂNG KÝ */
.ch-btn-register {
    background-color: #4a68b1;
    color: #ffffff;
    border: none;
    padding: 14px 35px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}
.ch-btn-register:hover {
    background-color: #3b538e;
}

/* Bao bọc toàn cụm icon */
.ch-header-icons-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
}

/* Định dạng các vòng tròn xanh nhạt */
.ch-icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background-color: #bcd4e6;
    color: #43698b;
    border-radius: 50%;
    text-decoration: none !important;
    transition: all 0.2s ease;
}
.ch-icon-circle:hover {
    background-color: #a6c4dc;
    color: #2c4d6b;
}
.ch-icon-circle svg {
    width: 20px;
    height: 20px;
}

/* KHUNG SAU KHI ĐĂNG NHẬP (Avatar + Badge) */
.ch-user-avatar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: #1a65b3;
    padding: 2px;
    text-decoration: none !important;
}
.ch-avatar-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background-color: #d1d1d1;
}
.ch-avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badge đồng xu đỏ */
.ch-coin-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background-color: #e55353;
    color: #ffffff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.ch-coin-badge svg {
    width: 12px;
    height: 12px;
}

/* KHUNG CHƯA ĐĂNG NHẬP (Tooltip Đăng nhập) */
.ch-login-trigger-wrapper {
    position: relative;
}

/* CSS cho Tooltip Đăng Nhập */
.ch-tooltip-login {
    position: absolute;
    top: calc(100% + 12px);
    right: 50%;
    transform: translateX(50%);
    background-color: #ffffff;
    color: #495057;
    padding: 8px 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 999;
}
.ch-tooltip-login::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 50%;
    transform: translateX(50%);
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent #ffffff transparent;
}
.ch-login-trigger-wrapper:hover .ch-tooltip-login {
    opacity: 1;
    visibility: visible;
}

/* Bao bọc toàn trang Tài Khoản */
.ch-account-wrapper {
    max-width: 950px;
    margin: 40px auto;
    font-family: inherit;
}

/* 1. Tiêu đề TÀI KHOẢN có viền xanh dưới chân */
.ch-account-page-title {
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 30px;
}
.ch-account-page-title h2 {
    display: inline-block;
    color: #1c5bb5;
    font-size: 22px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
    padding-bottom: 15px;
    border-bottom: 4px solid #1c5bb5;
    margin-bottom: -1px;
}

/* 2. Khung thẻ bọc Tabs và Nội dung */
.ch-account-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.02);
}

/* 3. Thanh điều hướng Tabs */
.ch-account-tabs {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #e8e8e8;
}
.ch-account-tabs a {
    padding: 20px 35px;
    color: #4a4a4a;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.ch-account-tabs a:hover {
    color: #1c5bb5;
}
.ch-account-tabs a.active {
    background-color: #e2ebf3;
    color: #1c5bb5;
    border-bottom: 2px solid #1c5bb5;
}

/* 4. Nội dung của Tab Bảng Điều Khiển */
.ch-account-content {
    padding: 50px 20px;
}
.ch-dashboard-view {
    text-align: center;
}
.ch-greeting {
    font-size: 24px;
    color: #333333;
    margin-bottom: 30px;
}

/* Khung Avatar tròn */
.ch-dashboard-avatar {
    width: 130px;
    height: 130px;
    margin: 0 auto 25px;
    border-radius: 50%;
    overflow: hidden;
    background-color: #c4c4c4;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.ch-dashboard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tên người dùng in hoa dưới Avatar */
.ch-display-name {
    font-size: 24px;
    color: #555555;
    margin-bottom: 30px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Các thẻ Text mô tả bên dưới */
.ch-dashboard-desc,
.ch-dashboard-logout-text {
    font-size: 16px;
    color: #333333;
    margin-bottom: 15px;
}
.ch-dashboard-desc a,
.ch-dashboard-logout-text a {
    color: #1c5bb5;
    text-decoration: none;
}
.ch-dashboard-desc a:hover,
.ch-dashboard-logout-text a:hover {
    text-decoration: underline;
}

/* Header của Tab Hồ Sơ */
.ch-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 15px 10px;
}
.ch-profile-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333;
}

/* Khu vực nút bấm */
.ch-profile-actions {
    display: flex;
    gap: 15px;
}
.ch-btn-outline {
    background: #ffffff;
    color: #666666;
    border: 1px solid #dcdcdc;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
.ch-btn-outline:hover {
    background: #f5f5f5;
    color: #333;
}
.ch-btn-solid {
    background: #4a68b1;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.ch-btn-solid:hover {
    background: #3b538e;
}

/* Đường kẻ ngang */
.ch-divider {
    border: 0;
    border-top: 1px solid #efefef;
    margin: 0 0 30px 0;
}

/* Lưới Form 2 cột */
.ch-profile-body {
    max-width: 650px;
    margin: 0 auto;
}
.ch-form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}
.ch-grid-col {
    flex: 1 1 calc(50% - 15px);
    display: flex;
    flex-direction: column;
    text-align: left;
}
.ch-grid-col label {
    font-weight: 700;
    color: #555555;
    margin-bottom: 8px;
    font-size: 14px;
}
.ch-grid-col input {
    padding: 12px 15px;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    width: 100%;
    box-sizing: border-box;
}

/* Input bị làm mờ */
.ch-input-readonly {
    background-color: #fafafa !important;
    color: #888888 !important;
    cursor: not-allowed;
}
.ch-grid-col input:not(.ch-input-readonly):focus {
    border-color: #4a68b1;
    outline: none;
    box-shadow: 0 0 0 1px #4a68b1;
}

/* ---- GIAO DIỆN CHỈNH SỬA HỒ SƠ (EDIT PROFILE) ---- */
.ch-edit-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px 15px;
}
.ch-back-btn {
    color: #4a4a4a;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
    text-decoration: none;
}
.ch-back-btn:hover {
    color: #4a68b1;
}
.ch-edit-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333333;
}

/* Phần body form sửa */
.ch-edit-body {
    padding: 20px 25px 40px;
}
.ch-edit-title {
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 25px;
    color: #333333;
}

/* Avatar và Nút Edit */
.ch-avatar-edit-wrapper {
    position: relative;
    width: 130px;
    margin: 0 auto 40px;
}
.ch-avatar-edit-icon {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 32px;
    height: 32px;
    background: #e8f0fe;
    color: #4a68b1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background 0.2s;
}
.ch-avatar-edit-icon:hover {
    background: #d2e3fc;
}

/* Form nhập dọc (Vertical) */
.ch-edit-form {
    max-width: 520px;
    margin: 0 auto;
}
.ch-form-group-vertical {
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
    text-align: left;
}
.ch-form-group-vertical label {
    font-weight: 700;
    color: #555555;
    margin-bottom: 8px;
    font-size: 14px;
}
.ch-form-group-vertical input {
    padding: 12px 15px;
    border: 1px solid #e2e2e2;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s;
}
.ch-form-group-vertical input:not(.ch-input-readonly):focus {
    border-color: #4a68b1;
    outline: none;
    box-shadow: 0 0 0 1px #4a68b1;
}

.ch-edit-submit-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}

/* Container bao bọc Quên Mật Khẩu */
.ch-lost-password-wrapper {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}
.ch-lost-password-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #f0f0f0;
    width: 100%;
    max-width: 450px;
}
.ch-lost-password-card h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

/* CSS Ví Xu */
.ch-wallet-container {
    max-width: 600px;
    margin: 40px auto;
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid #eee;
}
.ch-wallet-hero {
    text-align: center;
    padding: 40px;
    background: #fdfdfd;
    border: 1px solid #f0f0f0;
    border-radius: 15px;
    margin-bottom: 30px;
}
.ch-wallet-hero h3 { font-size: 36px; color: #f39c12; margin: 10px 0; }
.ch-wallet-hero button {
    background: #ff9f43;
    color: #fff;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    cursor: pointer;
}
.ch-pkg-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 10px;
}
.ch-back { display: inline-block; margin-bottom: 20px; text-decoration: none; }