:root {
    --brera-contact-orange: #eb4526;
    --brera-contact-ink: #212121;
    --brera-contact-muted: #595959;
    --brera-contact-field: #f4f4f4;
}

.contact-form[data-brera-contact] {
    display: block !important;
    margin: 0;
    padding: 64px 0;
    background: var(--brera-contact-orange);
    color: #fff;
}

.contact-form[data-brera-contact] .brera-contact__inner {
    display: grid;
    width: calc(100% - 48px);
    max-width: 1360px;
    grid-template-columns: minmax(300px, 430px) minmax(620px, .9fr);
    align-items: start;
    justify-content: space-between;
    gap: 0;
    margin: 0 auto;
    padding: 0 15px;
}

.brera-contact__info {
    max-width: 400px;
}

.brera-contact__eyebrow {
    margin: 0 0 18px !important;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: normal;
    line-height: 1.3;
    text-transform: uppercase;
}

.brera-contact__title {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(38px, 3.25vw, 44px);
    font-weight: 300;
    letter-spacing: normal;
    line-height: 1.04;
}

.brera-contact__intro {
    margin: 0 0 26px !important;
    color: #fff;
    font-size: 16px;
    line-height: 1.55;
}

.brera-contact__details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.brera-contact__details a {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

.brera-contact__details a:first-of-type {
    font-size: 18px;
}

.brera-contact__details a:hover,
.brera-contact__details a:focus-visible {
    color: #fff;
    text-decoration: underline;
}

.brera-contact__details p {
    margin: 4px 0 0;
    color: #fff;
    font-size: 14px;
    line-height: 1.45;
}

.brera-contact__card {
    position: relative;
    justify-self: end;
    width: 100%;
    min-width: 0;
    padding: 32px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(74, 22, 12, .14);
    color: var(--brera-contact-ink);
}

.brera-contact__form-title {
    margin: 0 0 8px;
    color: var(--brera-contact-ink);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.brera-contact__form-intro {
    margin: 0 0 16px !important;
    color: var(--brera-contact-muted);
    font-size: 14px;
    line-height: 1.45;
}

.brera-contact__form .wpcf7-form > .columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.brera-contact__form .wpcf7-form > .columns > .col {
    display: contents;
}

.brera-contact__form .wpcf7-form > .columns > .col > p {
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
}

.brera-contact__form .wpcf7-form > .columns > .col > p:has(textarea),
.brera-contact__form .wpcf7-form > .columns > .col > p:has(.wpcf7-checkbox),
.brera-contact__form .wpcf7-form > .columns > .col > p:has(.wpcf7-radio) {
    grid-column: 1 / -1;
}

.brera-contact__form .wpcf7-form > .columns > .col > p:has(.wpcf7-submit) {
    display: flex;
    position: absolute;
    right: 32px;
    bottom: 32px;
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding: 0;
    background: transparent;
}

.brera-contact__form .wpcf7-form > .columns > .col > p:has(.wpcf7-not-valid-tip) {
    margin-bottom: 28px;
}

.brera-contact__form label {
    display: block;
    width: 100%;
    margin: 0;
    padding: 9px 12px 0;
    background: var(--brera-contact-field);
    color: var(--brera-contact-orange);
    font-size: 10px;
    font-weight: 700;
    line-height: 12px !important;
    text-transform: uppercase;
}

.contact-form[data-brera-contact] .label-company,
.contact-form[data-brera-contact] .label-email,
.contact-form[data-brera-contact] .label-message,
.contact-form[data-brera-contact] .label-name {
    font-size: 11px;
}

.contact-form[data-brera-contact] span {
    font-size: 14px;
}

.brera-contact__form br {
    display: none;
}

.brera-contact__form .wpcf7-form-control-wrap {
    display: block;
    position: relative;
    padding: 0 12px 5px;
    background: var(--brera-contact-field);
}

.brera-contact__form .wpcf7-form > .columns > .col > p:not(:has(textarea)) .wpcf7-form-control-wrap {
    padding-bottom: 13px;
}

.brera-contact__form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.brera-contact__form textarea,
.brera-contact__form select {
    display: block;
    width: 100%;
    max-width: none;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0;
    padding: 3px 0 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--brera-contact-ink);
    font: inherit;
    font-size: 13px;
    line-height: 1.35;
}

.brera-contact__form textarea {
    height: 84px !important;
    min-height: 84px !important;
    resize: none;
}

.brera-contact__form input:focus,
.brera-contact__form textarea:focus,
.brera-contact__form select:focus {
    box-shadow: 0 2px 0 var(--brera-contact-orange);
}

.brera-contact__form .wpcf7-submit {
    min-width: 178px;
    min-height: 48px;
    height: 48px !important;
    margin: 0 !important;
    padding: 11px 48px 11px 24px;
    border: 0;
    border-radius: 999px;
    background-color: var(--brera-contact-orange);
    background-image: url('../assets/icons/brera-arrow.svg');
    background-repeat: no-repeat;
    background-position: right 22px center;
    background-size: 18px auto;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-transform: none;
    cursor: pointer;
}

.brera-contact__form .wpcf7-spinner {
    align-self: center;
    margin: 0 0 0 10px;
}

.brera-contact__notes {
    display: flex;
    height: 48px;
    min-height: 48px;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 16px 0 0 !important;
    padding-right: 212px;
    color: var(--brera-contact-muted);
    font-size: 9px;
    line-height: 1.4;
    white-space: nowrap;
}

.contact-form[data-brera-contact] .brera-contact__notes span {
    font-size: 11px;
}

.brera-contact__form .wpcf7-not-valid-tip {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    width: max-content;
    max-width: 100%;
    color: #b3261e !important;
    font-size: 10px !important;
    line-height: 1.3;
}

.brera-contact__form input::placeholder,
.brera-contact__form textarea::placeholder {
    color: #666;
    opacity: 1;
}

.brera-contact__form .wpcf7-response-output {
    font-size: 11px;
}

@media (max-width: 960px) {
    .contact-form[data-brera-contact] .brera-contact__inner {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .brera-contact__info {
        max-width: 620px;
    }
}

@media (max-width: 767px) {
    .contact-form[data-brera-contact] {
        padding: 14px 0 48px;
    }

    .contact-form[data-brera-contact] .brera-contact__inner {
        width: 100%;
        max-width: 100%;
        gap: 16px;
        padding: 0 16px;
    }

    .brera-contact__info {
        max-width: none;
    }

    .brera-contact__eyebrow {
        margin-bottom: 18px !important;
        font-size: 9px;
    }

    .brera-contact__title {
        margin-bottom: 16px;
        font-size: 30px;
        line-height: 1.12;
    }

    .brera-contact__intro {
        margin-bottom: 16px !important;
        font-size: 13px;
        line-height: 1.5;
    }

    .brera-contact__details {
        gap: 8px;
        padding: 16px;
        border-radius: 14px;
        background: rgba(255, 255, 255, .13);
    }

    .brera-contact__details a,
    .brera-contact__details a:first-of-type {
        font-size: 14px;
    }

    .brera-contact__details p {
        margin-top: 2px;
        font-size: 11px;
        line-height: 1.45;
    }

    .brera-contact__card {
        padding: 20px 16px 18px;
        border-radius: 14px;
        background: #d9361d;
        box-shadow: none;
        color: #fff;
    }

    .brera-contact__form-title {
        margin-bottom: 8px;
        color: #fff;
        font-size: 20px;
    }

    .brera-contact__form-intro {
        margin-bottom: 14px !important;
        color: rgba(255, 255, 255, .82);
        font-size: 11px;
    }

    .brera-contact__form .wpcf7-form > .columns {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .brera-contact__form .wpcf7-form > .columns > .col > p:has(textarea),
    .brera-contact__form .wpcf7-form > .columns > .col > p:has(.wpcf7-checkbox),
    .brera-contact__form .wpcf7-form > .columns > .col > p:has(.wpcf7-radio),
    .brera-contact__form .wpcf7-form > .columns > .col > p:has(.wpcf7-submit) {
        grid-column: auto;
    }

    .brera-contact__form .wpcf7-form > .columns > .col > p {
        border-radius: 10px;
        background: #fff;
    }

    .brera-contact__form .wpcf7-form > .columns > .col > p:has([name="your-email"]) {
        order: 3;
    }

    .brera-contact__form .wpcf7-form > .columns > .col > p:has([name="your-company"]) {
        order: 4;
    }

    .brera-contact__form .wpcf7-form > .columns > .col > p:has(textarea) {
        order: 5;
    }

    .brera-contact__form .wpcf7-form > .columns > .col > p:has(.wpcf7-submit) {
        position: static;
        order: 6;
        justify-content: flex-start;
        overflow: visible;
        margin-top: 52px;
        background: transparent;
    }

    .brera-contact__form label {
        padding: 11px 14px 0;
        border-radius: 10px 10px 0 0;
        background: #fff;
        color: #666;
        font-size: 8px;
        line-height: 11px !important;
    }

    .contact-form[data-brera-contact] .label-company,
    .contact-form[data-brera-contact] .label-email,
    .contact-form[data-brera-contact] .label-message,
    .contact-form[data-brera-contact] .label-name {
        font-size: 8px;
    }

    .brera-contact__form .wpcf7-form-control-wrap,
    .brera-contact__form .wpcf7-form > .columns > .col > p:not(:has(textarea)) .wpcf7-form-control-wrap {
        padding: 2px 14px 11px;
        border-radius: 0 0 10px 10px;
        background: #fff;
    }

    .brera-contact__form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
    .brera-contact__form textarea,
    .brera-contact__form select {
        font-size: 11px;
    }

    .brera-contact__form textarea {
        height: 76px !important;
        min-height: 76px !important;
    }

    .brera-contact__form .wpcf7-submit {
        width: 100%;
        max-width: none;
        flex: 0 0 100%;
        min-width: 0;
        min-height: 56px;
        height: 56px !important;
        padding: 12px 48px 12px 24px;
        background-color: #fff;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 17 11'%3E%3Cpath d='M1 5.5h14M10.5 1l4.5 4.5-4.5 4.5' fill='none' stroke='%23eb4526' stroke-width='1.5'/%3E%3C/svg%3E");
        background-position: right 22px center;
        background-size: 17px 11px;
        color: var(--brera-contact-orange);
        font-size: 13px;
    }

    .brera-contact__form .wpcf7-spinner {
        position: absolute;
        right: 48px;
        margin: 0;
    }

    .brera-contact__notes {
        position: absolute;
        right: 16px;
        bottom: 116px;
        left: 16px;
        width: auto;
        height: auto;
        min-height: 0;
        margin: 0 !important;
        padding-right: 0;
        color: rgba(255, 255, 255, .8);
        font-size: 8px;
        white-space: normal;
    }

    .contact-form[data-brera-contact] .brera-contact__notes span {
        font-size: 8px;
    }
}
