/* ✅ Style cho tiêu đề form đăng ký */
.form-main-title {
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Font đơn giản, dễ nhìn */
    text-align: center;
    font-size: 26px;
    color: #0064E0;
    /* Màu xanh đồng bộ */
    margin-bottom: 25px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 15px;
}

.form-main-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #0064E0;
    border-radius: 2px;
}

/* ✅ FIX: Force Single Column Layout */
.cf7-custom-form .form-row {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
}

.cf7-custom-form .form-group {
    width: 100% !important;
    display: block !important;
    margin-bottom: 20px !important;
}

/* ✅ Custom Layout cho Form: Mỗi input 1 dòng, full width */
.cf7-custom-form {
    width: 100%;
    box-sizing: border-box;
}

/* Đảm bảo mỗi group (thường là thẻ p trong CF7) xuống dòng và có khoảng cách */
.cf7-custom-form p {
    margin-bottom: 20px;
    display: block;
    width: 100%;
}

/* Label nằm trên input */
.cf7-custom-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 15px;
    text-align: left;
    /* Căn trái */
}

/* Input/Select/Textarea full width */
.cf7-custom-form input[type="text"],
.cf7-custom-form input[type="email"],
.cf7-custom-form input[type="tel"],
.cf7-custom-form input[type="date"],
.cf7-custom-form textarea,
.cf7-custom-form select {
    width: 100%;
    display: block;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    /* Bo tròn nhẹ */
    box-sizing: border-box;
    font-size: 15px;
    background-color: #f9f9f9;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    font-family: inherit;
}

/* Hiệu ứng focus */
.cf7-custom-form input:focus,
.cf7-custom-form textarea:focus,
.cf7-custom-form select:focus {
    border-color: #0064E0;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 100, 224, 0.1);
}

/* Placeholder color */
.cf7-custom-form input::placeholder,
.cf7-custom-form textarea::placeholder {
    color: #aaa;
}

/* Wrapper cho input (nếu CF7 thêm span) */
.cf7-custom-form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* ✅ Style cho button submit của CF7 giống với button đăng ký */
.wpcf7-form .wpcf7-submit {
    width: 100%;
    padding: 10px 15px !important;
    /* Chiều cao ~39px */
    background: #0064E0 !important;
    color: #FFFFFF !important;
    border: none !important;
    border-radius: 50px !important;
    /* Bo tròn Pill shape */
    font-weight: 700 !important;
    font-size: 15.52px !important;
    font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box !important;
    margin-top: 10px;
    text-transform: none !important;
    /* Không bắt buộc viết hoa */
}

.wpcf7-form .wpcf7-submit:hover {
    background: #0056b3 !important;
    box-shadow: 0 5px 15px rgba(0, 100, 224, 0.4) !important;
    transform: translateY(-2px);
}

/* ✅ FIX: Đảm bảo thông báo thành công hiển thị rõ ràng */
.wpcf7-response-output.wpcf7-mail-sent-ok {
    display: block !important;
    padding: 15px 20px !important;
    margin: 20px 0 !important;
    background: #d4edda !important;
    border: 2px solid #28a745 !important;
    border-radius: 8px !important;
    color: #155724 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    text-align: center !important;
    line-height: 1.5 !important;
    min-height: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ✅ FIX: Đảm bảo text hiển thị ngay cả khi aria-hidden */
.wpcf7-response-output.wpcf7-mail-sent-ok[aria-hidden="true"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ✅ FIX: Responsive Mobile - Force 1 column layout */
@media only screen and (max-width: 768px) {

    .cf7-custom-form,
    .cf7-custom-form p,
    .cf7-custom-form label,
    .cf7-custom-form .wpcf7-form-control-wrap,
    .cf7-custom-form input[type="text"],
    .cf7-custom-form input[type="email"],
    .cf7-custom-form input[type="tel"],
    .cf7-custom-form textarea,
    .cf7-custom-form select {
        width: 100% !important;
        min-width: 100% !important;
        display: block !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .cf7-custom-form p {
        margin-bottom: 15px !important;
        padding: 0 !important;
        float: none !important;
        clear: both !important;
    }
}