.mic-quote-form .form-group {
    margin-bottom: 5px;
    margin-top: 5px;
}
.mic-quote-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 700;
}
.mic-quote-form select, .mic-quote-form input[type=text], .mic-quote-form input[type=tel], .mic-quote-form input[type=email] {
    width: 100%;
    padding: 7px;
    border-radius: 4px;
    border: 1px solid #ccc;
    box-sizing: border-box;
    background-color: #fff;
    margin-bottom: 0px;
    /* CẬP NHẬT: Thêm chiều cao cố định để các ô bằng nhau */
    height: 38px;
}
.mic-quote-form select:disabled, .mic-quote-form input:disabled {
    background-color: #e9e9e9;
    cursor: not-allowed;
}
.mic-quote-form .hidden {
    display: none !important;
}

/* CẬP NHẬT: Căn chỉnh grid cho phần thông tin người được BH */
.mic-form-grid-custom {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 0 20px;
    align-items: start; /* Căn các item xuống dưới, đảm bảo thẳng hàng */
}
#insured-age {
    background-color: #e9e9e9;
    cursor: default;
    text-align: center;
    font-weight: bold;
}
.gender-btn-group {
    display: flex;
    gap: 10px;
}
.gender-btn {
    flex: 1;
    padding: 7px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
    /* CẬP NHẬT: Thêm chiều cao cố định */
    height: 38px;
}
button.gender-btn {line-height: normal!important;}
.gender-btn:hover { background-color: #f0f0f0; }
.gender-btn.active { background-color: #217b56; color: #fff; border-color: #217b56; font-weight: bold; }
.gender-btn:disabled { background-color: #e9e9e9; cursor: not-allowed; border-color: #ccc; }

/* Cấu trúc grid 2 cột cho form thông tin khách hàng */
.mic-care-form-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
    gap: 0 20px;
}
@media (max-width:768px) {
    .mic-care-form-grid, .mic-form-grid-custom {
        grid-template-columns: 1fr;
    }
}

/* CẬP NHẬT: Căn chỉnh các checkbox quyền lợi bổ sung */
#supplementary-benefits-section .form-group {
    display: flex;
    flex-wrap: wrap; /* Cho phép xuống dòng trên mobile */
    gap: 10px 20px; /* Khoảng cách giữa các item */
}
#supplementary-benefits-section label {
    font-weight: normal;
    display: inline-flex;
    align-items: center; /* Căn checkbox và text thẳng hàng theo chiều dọc */
    margin: 0; /* Bỏ margin mặc định của label */
}
#supplementary-benefits-section input[type="checkbox"] {
    /* Làm cho checkbox to hơn và dễ click hơn */
    width: 18px;
    height: 18px;
    margin-right: 2px; /* Khoảng cách giữa checkbox và text */
    margin-bottom: 0px;
}

.mic-quote-form .loader {
    display: none;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
#results-container {
    margin-top: 20px;
    padding: 0px!important;
    border: 0px!important;
}
.mic-quote-form .results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    border: 1px solid #ddd;
}
.mic-quote-form .results-table th, 
.mic-quote-form .results-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
}
.mic-quote-form .results-table th {
    background-color: #f2f2f2;
}
.mic-quote-form .results-table td:first-child {
    text-align: left;
    font-weight: 700;
}
.mic-quote-form .results-table .plan-name-header {
    font-size: 1.2em;
    font-weight: bold;
}
.mic-quote-form .results-table .final-fee {
    font-weight: bold;
    color: #d32f2f;
    font-size: 1.1em;
}
.mic-quote-form .results-table .original-fee {
    text-decoration: line-through;
    color: #777;
    font-size: .9em;
    display: block;
}

.mic-notice {
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
    border: 1px solid transparent;
}
.mic-notice-date-end {
    color: #ed1c24;
}
.mic-notice.promo {
    background-color: #f4f8f7;
    border-color: #217b56;
    color: #002930;
}
.mic-notice.final {
    font-style: italic;
    background-color: #fef4e7;
    border-left: 4px solid #f0ad4e;
}
.form-message {
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
}
.form-message.success {
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
}
.form-message.error {
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
}
.mic-lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,.6);
}
.mic-lightbox-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 100%;
    max-width: 800px;
    position: relative;
    border-radius: 8px;
}
.mic-lightbox-content h4 {
    margin-top: 0;
}
.mic-lightbox-content ul {
    list-style: none;
    padding: 0;
}
.mic-lightbox-content li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.mic-lightbox-content li:last-child {
    border-bottom: none;
}
.mic-lightbox-close {
    color: #d32f2f;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: 700;
    cursor: pointer;
}
.mic-lightbox-close:hover {
    color: #000;
}
.mic-care-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 14px;
}

.mic-care-details-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    color: #000;
}
.mic-care-details-table th {
    background-color: #217b56;
    font-weight: bold;
}

.mic-care-details-table th {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: center;
    color: #ffffff;
    width: 80%;
}

.mic-care-details-table td:first-child {
    text-align: left;
    padding-left: 5px;
    color: #000;
}
.mic-care-details-table tr.main-benefit td:first-child {
    font-weight: bold;
}
.mic-care-button {
    background-color: #d32f2f;
    color: white;
    padding: 4px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    margin-top: 20px;
    text-align: center;
    text-transform: uppercase;
    transition: background-color 0.3s;
}
.mic-care-button:hover {
    background-color: #b71c1c;
}

@media screen and (max-width: 768px) {
    .mic-care-button {
        width: 100%;
    }
}
.buy-now-btn {
    background-color: #e92128;
    color: white;
    border: none;
    padding: 4px 12px;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 5px;
    display: inline-block;
}
.buy-now-btn:hover {
    background-color: #c9302c;
}
.view-details-btn {
    font-size: 12px;
    color: #0073aa;
    cursor: pointer;
}

@media (max-width: 768px) {
    .mic-care-details-table td.item-value::before {
        display: none;
    }
    .mic-care-details-table th {
        font-size: 0.7em;
        text-align: center;
    }
}

/*@media screen and (max-width: 768px) {
    .mic-details-table { border: 0; }
    .mic-details-table thead { display: none; }
    .mic-details-table tr { display: block; margin-bottom: 1em; border: 1px solid #ddd; border-radius: 5px; overflow: hidden; }
    .mic-details-table tr:last-child { margin-bottom: 0; }
    .mic-details-table td { display: block; text-align: right !important; padding: 8px 10px !important; border-bottom: 1px solid #eee; color: #000; }
    .mic-details-table td:last-child { border-bottom: 0; }
    .mic-details-table td::before { content: attr(data-label); float: left; font-weight: bold; text-transform: uppercase; font-size: 0.9em; }
    .mic-details-table td:first-child { background-color: #f8f8f8; font-weight: bold; text-align: center !important; font-size: 1.1em; }
    .mic-details-table td:first-child::before { content: ""; }
}*/

#mic-care-quote-wrapper {
    position: relative;
}
.flatpickr-calendar {
    z-index: 10005 !important;
}

.flatpickr-calendar .custom-nav-wrapper {
    display: flex;
    gap: 8px;
    padding: 0 4px;
}

/* SỬA LỖI: Ép buộc thứ tự hiển thị bằng thuộc tính 'order' */
.flatpickr-calendar .flatpickr-year-select {
    order: 1; /* Hiển thị đầu tiên */
}

.flatpickr-calendar .flatpickr-month-select {
    order: 2; /* Hiển thị thứ hai */
}

/* Chia đều không gian cho mỗi dropdown */
.flatpickr-calendar .custom-nav-wrapper select {
    flex: 1; /* Mỗi select sẽ chiếm 1 phần không gian bằng nhau */
}

.gender-btn-group {
    display: flex;
    gap: 10px;
}
.gender-btn {
    flex: 1;
    padding: 7px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease-in-out;
}
.gender-btn:hover {
    background-color: #f0f0f0;
}
.gender-btn.active {
    background-color: #217b56;
    color: #fff;
    border-color: #217b56;
    font-weight: bold;
}
.gender-btn:disabled {
    background-color: #e9e9e9;
    cursor: not-allowed;
    border-color: #ccc;
}

.info-icon-mic-care {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    font-size: 12px;
    font-weight: 700;
    font-style: italic;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    color: #0073aa;
    border: solid 1px #0073aa;
}

.info-icon-mic-care:hover {
    background-color: #005a87;
    color: #fff;
}

#main-benefits-summary-container {
    margin-top: 20px;
}

/* Container chính cho các block gói */
.mic-plans-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 cột trên PC */
    gap: 10px;
    margin-top: 20px;
}

/* Block cho từng gói */
.mic-plan-card {
    border: 1px solid #217b56;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Tiêu đề gói */
.mic-plan-card .plan-header {
    background-color: #217b56;
    padding: 10px;
    margin: -15px -15px 5px -15px;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border-bottom: 1px solid #217b56;
}

.mic-plan-card .plan-title {
    font-size: 1.2em;
    font-weight: bold;
    margin: 0;
    color: #ffffff;
}

/* Phần nội dung quyền lợi và phí */
.mic-plan-card .plan-body {
    flex-grow: 1; /* Đẩy phần footer (nút mua) xuống dưới */
}

/* Dòng thông tin (quyền lợi hoặc phí) */
.plan-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}
.plan-item:last-child {
    border-bottom: none;
}
.plan-item .item-label {
    text-align: left;
    margin-right: 5px;
}
.plan-item .item-value {
    font-weight: bold;
    text-align: right;
    color: #333;
}

/* Style đặc biệt cho các dòng phí */
.plan-fee-item .item-label {
    font-weight: 500;
    margin-right: 5px;
}
.plan-fee-item.total-fee .item-value {
    font-size: 1.1em;
}
.plan-fee-item.discount-fee .item-value {
    color: #28a745; /* Màu xanh cho ưu đãi */
}

/* Dòng PHÍ THANH TOÁN cuối cùng */
.plan-final-fee {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #ddd;
}
.plan-final-fee .item-label {
    font-weight: bold;
    font-size: 1em;
    text-transform: uppercase;
}
.plan-final-fee .original-price {
    text-decoration: line-through;
    color: #777;
    font-size: 0.9em;
    display: block;
    font-weight: normal;
}
.plan-final-fee .final-price {
    font-size: 1.1em;
    color: #d32f2f;
    font-weight: bold;
}

/* Nút "Xem chi tiết" và "Mua ngay" */
.mic-plan-card .plan-footer {
    margin-top: 0px;
}
.mic-plan-card .view-details-link {
    display: block;
    margin-bottom: 10px;
    color: #0073aa;
    cursor: pointer;
    font-style: italic;
}


/* Responsive cho mobile */
@media (max-width: 991px) {
    .mic-plans-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 cột trên tablet */
    }
}
@media (max-width: 767px) {
    .mic-plans-grid {
        grid-template-columns: 1fr; /* 1 cột trên mobile */
    }
}

/* Tiêu đề chính "Các gói bảo hiểm đề xuất" */
.mic-results-title {
    text-align: center;
    font-size: 1.4em;
    margin-bottom: 25px;
    font-weight: 700;
    color: #002930;
}

/* Tiêu đề phụ trong mỗi block gói */
.plan-section-title {
    font-weight: bold;
    text-align: left;
    margin-top: 5px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    color: #333;
    font-size: 1.1em;
}

.mic-care-details-table .item-value {
    text-align: right !important; /* Căn phải cho cột số tiền */
    padding-right: 5px;
}
.mic-care-details-table td:first-child.main-benefit-group {
    font-weight: bold; /* In đậm các mục chính */
}

.mic-care-details-table tr:has(td.main-benefit-group) td.item-value {
    font-weight: bold;
}

/* Ghi đè để đảm bảo responsive hoạt động đúng */
@media screen and (max-width: 768px) {
    .mic-care-details-table td.item-value::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        text-transform: uppercase;
        font-size: 0.9em;
    }
}

.age-error-message {
    color: #d32f2f; /* Màu đỏ báo lỗi */
    font-style: italic;
    font-size: 13px;
    display: block; /* Hiển thị trên một dòng riêng */
    margin-top: 5px;
    font-weight: 500;
}

.source_link {
    font-size: 12px;
    color: #999 !important;
    text-align: center;
    font-style: italic;
}