/* =========================================================
   CONTACT FORM 7 — CLEAN, COMPACT & RESPONSIVE DESIGN
========================================================= */

.ahsan-contact-form,
.ahsan-contact-form *,
.ahsan-contact-form *::before,
.ahsan-contact-form *::after {
    box-sizing: border-box;
}

.ahsan-contact-form {
    --form-dark: #064b50;
    --form-teal: #1b747b;
    --form-text: #073f43;
    --form-input-bg: #f7f8fb;
    --form-border: #d9dfe5;
    --form-placeholder: #8a909b;
    --form-error: #d63638;

    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: inherit;
}

/* Remove unwanted Contact Form 7 spacing */
.ahsan-contact-form p,
.ahsan-contact-form br,
.ahsan-contact-form .wpcf7-form-control-wrap {
    margin: 0;
}

.ahsan-contact-form .contact-field > br,
.ahsan-contact-form .contact-submit-wrapper > br {
    display: none;
}

/* =========================================================
   FORM GRID
========================================================= */

.ahsan-contact-form .contact-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 22px;
    width: 100%;
}

.ahsan-contact-form .contact-field {
    min-width: 0;
    margin: 0;
    padding: 0;
}

.ahsan-contact-form .contact-field-full {
    grid-column: 1 / -1;
}

/* =========================================================
   LABELS
========================================================= */

.ahsan-contact-form label {
    display: block;
    margin: 0 0 7px;
    padding: 0;
    color: var(--form-text);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
}

.ahsan-contact-form .required-star {
    color: #e50000;
}

/* CF7 field wrapper */
.ahsan-contact-form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

/* =========================================================
   INPUTS
========================================================= */

.ahsan-contact-form input.contact-control,
.ahsan-contact-form textarea.contact-control {
    display: block;
    width: 100% !important;
    max-width: 100%;
    margin: 0 !important;
    color: #22282e;
    background-color: var(--form-input-bg) !important;
    border: 1px solid var(--form-border) !important;
    border-radius: 6px !important;
    outline: none;
    box-shadow: none !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    appearance: none;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

/* Compact text fields */
.ahsan-contact-form input.contact-control {
    height: 50px !important;
    min-height: 50px !important;
    padding: 0 18px !important;
}

/* Compact textarea */
.ahsan-contact-form textarea.contact-control {
    height: 165px !important;
    min-height: 165px !important;
    padding: 14px 18px !important;
    resize: vertical;
}

/* Placeholder */
.ahsan-contact-form input.contact-control::placeholder,
.ahsan-contact-form textarea.contact-control::placeholder {
    color: var(--form-placeholder);
    opacity: 1;
}

/* Focus effect */
.ahsan-contact-form input.contact-control:focus,
.ahsan-contact-form textarea.contact-control:focus {
    background-color: #ffffff !important;
    border-color: var(--form-teal) !important;
    box-shadow: 0 0 0 3px rgba(27, 116, 123, 0.08) !important;
}

/* =========================================================
   SUBMIT BUTTON
========================================================= */

.ahsan-contact-form .contact-submit-wrapper {
    position: relative;
    display: inline-block;
    margin-top: 28px;
    margin-bottom: 9px;
}

/* Offset block behind button */
.ahsan-contact-form .contact-submit-wrapper::after {
    position: absolute;
    z-index: 0;
    top: 8px;
    left: 8px;
    width: 100%;
    height: 100%;
    background-color: var(--form-teal);
    content: "";
    pointer-events: none;
    transition:
        top 0.2s ease,
        left 0.2s ease;
}

/* Button */
.ahsan-contact-form input.contact-submit-button {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 180px;
    height: 50px !important;
    min-height: 50px !important;
    margin: 0 !important;
    padding: 0 26px !important;
    color: #ffffff !important;
    background-color: var(--form-dark) !important;
    border: 0 !important;
    border-radius: 0 !important;
    outline: none;
    box-shadow: none !important;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

.ahsan-contact-form input.contact-submit-button:hover {
    color: #ffffff !important;
    background-color: #033b3f !important;
    transform: translate(2px, 2px);
}

.ahsan-contact-form .contact-submit-wrapper:hover::after {
    top: 6px;
    left: 6px;
}

.ahsan-contact-form input.contact-submit-button:focus-visible {
    outline: 3px solid rgba(27, 116, 123, 0.25);
    outline-offset: 4px;
}

/* =========================================================
   VALIDATION AND MESSAGES
========================================================= */

.ahsan-contact-form .wpcf7-not-valid {
    border-color: var(--form-error) !important;
}

.ahsan-contact-form .wpcf7-not-valid-tip {
    display: block;
    margin-top: 5px;
    color: var(--form-error);
    font-size: 12px;
    line-height: 1.4;
}

.ahsan-contact-form .wpcf7-response-output {
    margin: 24px 0 0 !important;
    padding: 12px 15px !important;
    border-width: 1px !important;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.5;
}

.ahsan-contact-form .wpcf7-spinner {
    position: absolute;
    top: 50%;
    left: calc(100% + 15px);
    margin: 0;
    transform: translateY(-50%);
}

/* Autofill */
.ahsan-contact-form input:-webkit-autofill,
.ahsan-contact-form input:-webkit-autofill:hover,
.ahsan-contact-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: #22282e;
    -webkit-box-shadow: 0 0 0 1000px var(--form-input-bg) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* =========================================================
   TABLET
========================================================= */

@media screen and (max-width: 1024px) {
    .ahsan-contact-form .contact-form-grid {
        column-gap: 18px;
        row-gap: 20px;
    }

    .ahsan-contact-form input.contact-control {
        height: 48px !important;
        min-height: 48px !important;
        padding-right: 16px !important;
        padding-left: 16px !important;
    }

    .ahsan-contact-form textarea.contact-control {
        height: 155px !important;
        min-height: 155px !important;
        padding: 13px 16px !important;
    }

    .ahsan-contact-form .contact-submit-wrapper {
        margin-top: 25px;
    }
}

/* =========================================================
   MOBILE
========================================================= */

@media screen and (max-width: 767px) {
    .ahsan-contact-form .contact-form-grid {
        grid-template-columns: 1fr;
        row-gap: 18px;
    }

    .ahsan-contact-form .contact-field-full {
        grid-column: auto;
    }

    .ahsan-contact-form label {
        margin-bottom: 6px;
        font-size: 14px;
    }

    .ahsan-contact-form input.contact-control,
    .ahsan-contact-form textarea.contact-control {
        font-size: 14px;
    }

    .ahsan-contact-form input.contact-control {
        height: 48px !important;
        min-height: 48px !important;
        padding-right: 15px !important;
        padding-left: 15px !important;
    }

    .ahsan-contact-form textarea.contact-control {
        height: 145px !important;
        min-height: 145px !important;
        padding: 13px 15px !important;
    }

    .ahsan-contact-form .contact-submit-wrapper {
        display: block;
        width: calc(100% - 8px);
        margin-top: 24px;
    }

    .ahsan-contact-form input.contact-submit-button {
        width: 100% !important;
        min-width: 0;
        height: 50px !important;
        min-height: 50px !important;
        padding: 0 20px !important;
        font-size: 13px;
    }

    .ahsan-contact-form .wpcf7-spinner {
        top: calc(100% + 18px);
        left: 50%;
        transform: translateX(-50%);
    }
}

/* =========================================================
   SMALL MOBILE
========================================================= */

@media screen and (max-width: 420px) {
    .ahsan-contact-form .contact-form-grid {
        row-gap: 16px;
    }

    .ahsan-contact-form input.contact-control {
        height: 46px !important;
        min-height: 46px !important;
    }

    .ahsan-contact-form textarea.contact-control {
        height: 135px !important;
        min-height: 135px !important;
    }

    .ahsan-contact-form input.contact-submit-button {
        height: 48px !important;
        min-height: 48px !important;
    }
}

/* =========================================================
   ELEMENTOR WIDTH FIX
========================================================= */

.elementor-widget-shortcode,
.elementor-widget-shortcode .elementor-widget-container,
.elementor-widget-shortcode .wpcf7,
.elementor-widget-shortcode .wpcf7-form {
    width: 100%;
    max-width: 100%;
}