/**
 * Contact form Block Styles
 *
 * @package Hedredesign
 */

/* ===================================
   Contact Box Container
   =================================== */
.contact-box {
    border: 2px solid #e5e5e5;
    margin-top: 24px;
    border-radius: 12px;
    padding: 12px;
    /* background: #f5f5f5; */
}

h3.contact-intro-title {
    color: var(--hebTeal);
    font-size: 27px;
    font-weight: 600;
    margin: 0;
    padding: 12px 20px 20px 20px;
}

/* ===================================
   Form Labels
   =================================== */
.contact-box label {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: 500;
    line-height: 120%;
}

/* ===================================
   Form Inputs & Textarea
   (Matching multistep form styling)
   =================================== */
.contact-box input[type="email"],
.contact-box input[type="text"],
.contact-box textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 16px;
    font-family: inherit;
    color: var(--hebTeal, #00414C);
    background: var(--white, #ffffff);
    border: 2px solid var(--hebTeal, #00414C);
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
    font-weight: 400;
    margin-bottom: 6px;
    min-height: 52px;
    display: block;
}

.contact-box textarea {
    min-height: 120px;
    resize: vertical;
}

.contact-box input[type="email"]:focus,
.contact-box input[type="text"]:focus,
.contact-box textarea:focus {
    outline: none;
    border-color: var(--hebMint, #65CF8C);
    box-shadow: 0 2px 4px rgba(101, 207, 140, 0.7);
}

.contact-box input[type="email"].error,
.contact-box input[type="text"].error,
.contact-box textarea.error {
    border-color: #E74C3C;
}

.contact-box input[type="email"]::placeholder,
.contact-box input[type="text"]::placeholder,
.contact-box textarea::placeholder {
    color: #666;
    opacity: 1;
}

.contact-box input[type="submit"] {
    /* margin-right: 15px; */
    /* margin-bottom: 18px; */
    line-height: normal;
    border: 0;
    font-weight: 700;
    min-width: 150px;
}

/* ===================================
   Form Response Messages
   =================================== */
.contact-response-output {
    margin: 2em 0.5em 1em;
    padding: 0.2em 1em;
    border: 2px solid #ffb900;
}

.contact-response-output.successsubmission {
    border-color: #46b450;
}

/* ===================================
   Div-based Form Structure
   (Replacing table layout)
   =================================== */
.contact-form-wrapper {
    display: table;
    width: 100%;
    border-collapse: collapse;
}

.contact-form-row {
    display: table-row;
    /* border-bottom: 1px solid #ddd; */
}

.contact-form-row:nth-child(odd) {
    /* background-color: #f9f9f9; */
}


.contact-form-row .clabel,
.contact-form-row .contact-form-field {
    display: table-cell;
    padding: 5px 20px;
    vertical-align: top;
}

.contact-form-row .clabel {
    width: 31%;
}

.contact-form-row .clabel p,
.contact-form-row .contact-form-field p {
    margin: 0;
}

/* Error Messages (Matching multistep form styling) */
.contact-box .error-message {
    display: block;
    color: #E74C3C;
    font-size: 15px;
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Submit Button Container */
.contact-form-field p:last-of-type {
    display: flex;
    flex-direction: column;
    /* align-items: flex-end; */
    /* gap: 10px; */
}

.contact-form-field .loading-spinner {
    margin-top: 10px;
}

/* Submit button wrapper in last row */
.contact-form-row:last-child .contact-form-field p:last-of-type {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.description {
    /* border: 1px solid #ddd; */
    border-top: 0;
    font-size: 14px;
    padding: 20px 30px;
    color: #333;
}

.description p {
    margin-bottom: 0;
}

/* ===================================
   Responsive Styles
   =================================== */

/* Tablet and below (max-width: 991px) */
@media (max-width: 991px) {
    .contact-form-wrapper {
        display: block;
    }

    .contact-form-row {
        display: block;
        border-bottom: 1px solid #eee;
        padding: 15px 0;
    }

    .contact-form-row:last-child {
        border-bottom: none;
    }

    .contact-form-row .clabel,
    .contact-form-row .contact-form-field {
        display: block;
        width: 100%;
        padding: 0 22px;
    }

    .contact-form-row .clabel {
        width: 100%;
        margin-bottom: 8px;
    }

    .contact-box input[type="email"],
    .contact-box input[type="text"],
    .contact-box textarea {
        width: 100%;
    }

    .contact-box input[type="submit"],
    .contact-box .pull-right {
        width: 100%;
        margin-right: 0;
        margin-top: 15px;
        float: none;
    }

    .contact-form-row:last-child .contact-form-field p:last-of-type {
        align-items: stretch;
    }

    .contact-response-output {
        margin: 1.5em 22px 1em;
    }

    .contact-box .error-message {
        font-size: 0.85em;
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .contact-box {
        margin-top: 16px;
    }

    h3.contact-intro-title {
        font-size: 22px;
        padding: 12px 16px;
    }

    .contact-box b {
        padding: 12px 16px;
        font-size: 18px;
    }

    .contact-form-row .clabel,
    .contact-form-row .contact-form-field {
        padding: 0 16px;
    }

    .contact-form-row {
        padding: 12px 0;
    }

    .contact-box input[type="email"],
    .contact-box input[type="text"],
    .contact-box textarea {
        padding: 12px 14px;
        font-size: 16px;
        /* Prevents zoom on iOS */
        min-height: 52px;
    }

    .contact-response-output {
        margin: 1.5em 16px 1em;
        padding: 0.5em 1em;
        font-size: 14px;
    }

    .contact-box label {
        font-size: 14px;
    }

    .contact-box .error-message {
        font-size: 0.8em;
        margin-top: 4px;
    }

    /* Ensure submit button and spinner stack properly */
    .contact-form-row:last-child .contact-form-field p:last-of-type {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .contact-box b {
        padding: 10px 12px;
        font-size: 16px;
    }

    h3.contact-intro-title {
        font-size: 20px;
        padding: 10px 12px;
    }

    .contact-form-row .clabel,
    .contact-form-row .contact-form-field {
        padding: 0 12px;
    }

    .contact-form-row {
        padding: 10px 0;
    }

    .contact-box input[type="email"],
    .contact-box input[type="text"],
    .contact-box textarea {
        padding: 12px 14px;
        min-height: 52px;
    }

    .contact-response-output {
        margin: 1em 12px 0.5em;
        padding: 0.4em 0.8em;
        font-size: 13px;
    }

    .contact-box input[type="submit"] {
        padding: 12px 20px;
        font-size: 16px;
    }

    /* Ensure hCaptcha is responsive */
    .contact-form-field iframe {
        max-width: 100%;
    }
}