/**
 * Contact Form 7 - Structural fixes only
 * All visual styles live in contact-us.css
 * This file only fixes CF7's generated <span>/<p> wrappers
 * that break the existing .form-row grid and input styling.
 *
 * @package gd
 * @version 2.0
 */

/* CF7 puts BOTH fields in a single <p> inside .form-row.
   display:contents makes the <p> invisible to layout so the
   two <span> wrappers become direct grid children of .form-row */
.contact-form-container .form-row > p {
    margin: 0;
    padding: 0;
    display: contents;
}

/* Hide the <br> CF7 inserts between fields inside the same <p> */
.contact-form-container .form-row > p > br {
    display: none;
}

/* Top-level <p> tags CF7 adds outside .form-row (e.g. form title, submit row) */
.contact-form-container .wpcf7-form > p {
    margin: 0;
    padding: 0;
    display: contents;
}

/* Make the CF7 <form> itself a flex column so .form-row divs get proper gaps */
.contact-form-container .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* CF7 wraps every field in <span class="wpcf7-form-control-wrap">
   Make it a full-width block so it doesn't collapse the grid column */
.contact-form-container .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    min-width: 0;
    /* Allow custom dropdown lists to overflow the form container */
    overflow: visible;
    position: relative;
}

/* Custom dropdown widgets injected inside CF7 wrappers */
.contact-form-container .wpcf7-form-control-wrap .cf7-custom-dropdown {
    width: 100%;
}

.contact-form-container .wpcf7-form-control-wrap .cf7-dd-list {
    z-index: 100;
}

/* ============================================
   SUBMIT BUTTON — match btn btn-outline style
   (white bg, teal text, pill shape, 56px height)
   ============================================ */
.contact-form-container .wpcf7-form input[type='submit'].contact-submit-btn,
.contact-form-container .wpcf7-form input[type='submit'] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    height: 56px;
    background: #ffffff;
    color: #005b68;
    border: 1px solid #ffffff;
    border-radius: 100px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    font-weight: 700;
    font-style: normal;
    line-height: normal;
    cursor: pointer;
    width: auto;
    align-self: flex-start;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    transition: all 0.3s ease;
}

.contact-form-container .wpcf7-form input[type='submit'].contact-submit-btn:hover,
.contact-form-container .wpcf7-form input[type='submit']:hover {
    background: #005b68;
    color: #ffffff;
    border: 1px solid #ffffff;
}

/* CF7 response output — reset default border CF7 adds */
.contact-form-container .wpcf7-response-output {
    margin: 0;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 15px;
}

.contact-form-container .wpcf7-mail-sent-ok {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-left: 3px solid #ffffff;
}

.contact-form-container .wpcf7-validation-errors,
.contact-form-container .wpcf7-acceptance-missing {
    background: rgba(255, 100, 100, 0.2);
    color: #ffcccc;
    border-left: 3px solid #ff6b6b;
}

/* Validation tip text under invalid fields */
.contact-form-container .wpcf7-not-valid-tip {
    color: #ffcccc;
    font-size: 13px;
    display: block;
    margin-top: 4px;
    padding-left: 8px;
}

/* Spinner — reset CF7 default background image spinner */
.contact-form-container .wpcf7-spinner {
    background-image: none;
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: cf7spin 0.8s linear infinite;
    vertical-align: middle;
    margin-left: 8px;
    background-color: transparent;
}

@keyframes cf7spin {
    to {
        transform: rotate(360deg);
    }
}
