/*------------------------------------*\
    
    WebFX CF7 Customizations - Global styling for all CF7 Forms

    Add custom CF7 form styling to this file if it should be applied to all CF7 forms on the site
    Otherwise, put your block-specific styles in individual block stylesheets so that various block-specific styles aren't loaded on every CF7 form

\*------------------------------------*/


/* Default Radio/Checkbox Style (if using CF7) */
.wpcf7-radio .wpcf7-list-item,
.wpcf7-checkbox .wpcf7-list-item {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 10px;
    margin-left: 0;
    /* incase items go to 2 lines */
}

.wpcf7-radio .wpcf7-list-item-label,
.wpcf7-checkbox .wpcf7-list-item-label {
    margin-left: 5px;
    padding-left: 20px;
    color: #333;

    &:before {
        content: "";
        display: block;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        left: 0;
        width: 20px;
        height: 20px;
        border: 2px solid var(--link-accent);
        border-radius: 50%;
    }

    &:after {
        content: "";
        width: 12px;
        height: 12px;
        position: absolute;
        top: 3px;
        left: 4px;
        background-color: var(--blue);
        border-radius: 50%;
        opacity: 0;
        transform: scale(0);
        transition: all 0.2s ease-in-out;
    }
}

.wpcf7-radio,
.wpcf7-checkbox {
    display: block;
    width: 100%;

    .wpcf7-list-item label {
        display: block;
        position: relative;
    }

    input {
        position: absolute;
        opacity: 0;
        top: 0;
        left: 0;
    }

    input:checked + .wpcf7-list-item-label:after {
        opacity: 1;
        transform: scale(1);
    }
}

/* CF7 Validation (Remove if not using CF7) */

/* Individual field error messages */
.wpcf7 .wpcf7-not-valid-tip {
    position: absolute;
    right: 0;
    width: 100%;
    bottom: -18px;
    font-size: 12px;
    font-weight: normal;
    font-family: var(--secondary-font);
    text-transform: uppercase;
    color: #461800;
    text-align: right;
    letter-spacing: 0.16em;
}

.wpcf7 .wpcf7-not-valid-tip:after {
    content: "\e90d";
    font-family: 'zimmerman-icons';
    position: absolute;
    right: 15px;
    top: -54px;
    color: var(--primary-color);
    font-size: 35px;
}

/* Entire form error message */
.wpcf7-response-output {

}

/* Styling for fields that have errors */
select.wpcf7-not-valid,
textarea.wpcf7-not-valid,
input.wpcf7-not-valid,
.wpcf7-not-valid .choices {
    border: none !important;
    border-bottom: 4px solid var(--primary-color) !important;
}

/* Adding CF7 Spinner for loading */
.wpcf7 .wpcf7-spinner {
    visibility: hidden;
    display: inline-block;
    background-color: #23282d;
    /* Dark Gray 800 */
    opacity: 0.75;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 100%;
    padding: 0;
    margin: 0 24px;
    position: relative;
}

form.submitting .wpcf7-spinner {
    visibility: visible;
}

.wpcf7 .wpcf7-spinner::before {
    content: '';
    position: absolute;
    background-color: #fbfbfc;
    /* Light Gray 100 */
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    border: none;
    border-radius: 100%;
    transform-origin: 8px 8px;
    animation-name: spin;
    animation-duration: 1000ms;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

@media (prefers-reduced-motion: reduce) {
    .wpcf7 .wpcf7-spinner::before {
        animation-name: blink;
        animation-duration: 2000ms;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes blink {
    from {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.wpcf7 .choices__inner {
    display: flex;
    align-items: center;
}

.wpcf7-file {
    width: 100%;
    display: block;
    font-size: 18px;
    letter-spacing: 0.02em;
    font-weight: 400;
    color: var(--text-color);
    height: 65px;
    background: var(--off-white-darker);
    border-radius: var(--border-radius);
    border: 1px solid var(--off-white-darker);
    padding: 15px 20px;
    border-bottom: 4px solid var(--blue);
    cursor: pointer;

    &::file-selector-button {
        font-size: 14px;
        font-family: var(--secondary-font);
        font-weight: normal;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: #fff;
        background: var(--blue);
        border: none;
        border-radius: var(--border-radius);
        padding: 8px 16px;
        margin-right: 15px;
        cursor: pointer;
    }

    &:active,
    &:focus {
        outline: none;
        border-color: var(--primary-color);
    }
}