/* Khối đồng ý xử lý dữ liệu cá nhân, chèn trước nút submit của form CF7. */

.fti-consent {
    margin: 0 0 20px;
    text-align: left;
}

/* CF7 chạy wpautop nên nội dung tag bị bọc thêm <p>. */
.fti-consent p {
    margin: 0;
}

.fti-consent__item {
    margin-bottom: 10px;
}

.fti-consent__item:last-of-type {
    margin-bottom: 0;
}

.fti-consent .wpcf7-form-control-wrap {
    display: block;
    position: static;
}

.fti-consent .wpcf7-acceptance,
.fti-consent .wpcf7-list-item {
    display: block;
    margin: 0;
}

.fti-consent .wpcf7-list-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

/* Checkbox tự vẽ: accent-color để browser tự chọn màu dấu V, trên nền cam
   #F27227 Chrome tính ra dấu V sẫm màu. Vẽ tay để dấu V luôn trắng. */
.fti-consent input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    padding: 0;
    border: 1px solid #c4c4c4;
    border-radius: 3px;
    background: #fff no-repeat center;
    background-size: 12px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.fti-consent input[type="checkbox"]:checked {
    border-color: #F27227;
    background-color: #F27227;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5 6.5 11.5 12.5 4.5'/%3E%3C/svg%3E");
}

.fti-consent input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(242, 114, 39, 0.45);
    outline-offset: 1px;
}

.fti-consent .wpcf7-list-item-label {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #555;
}

.fti-consent__link {
    color: #F27227;
    text-decoration: underline;
}

.fti-consent__link:hover,
.fti-consent__link:focus {
    color: #d85f18;
    text-decoration: underline;
}

/* Checkbox bắt buộc ở chế độ 'locked': tick sẵn, không cho bỏ tick. */
.fti-consent[data-fti-consent-mode="locked"] .fti-consent__item--required label,
.fti-consent[data-fti-consent-mode="locked"] .fti-consent__item--required input[type="checkbox"] {
    cursor: default;
}

/* Gợi ý chỉ hiện ở chế độ 'gate' và chỉ khi chưa tick. */
.fti-consent__hint {
    display: none;
    margin: 8px 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
    color: #dc3232;
}

.fti-consent.is-blocked .fti-consent__hint {
    display: block;
}

/* Nút submit bị chặn khi chưa đồng ý (chế độ 'gate'). */
.wpcf7-submit.fti-consent-blocked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.fti-consent .wpcf7-not-valid-tip {
    font-size: 0.75rem;
    margin-top: 4px;
}
