/* Retrodelphia Brevo forms */

.brevo-signup,
.brevo-preference-form {
    display: grid;
    gap: var(--space-md);
}

.brevo-signup__identity {
    display: grid;
    grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr) minmax(0, 1fr);
    gap: var(--space-sm);
}

.brevo-field {
    display: grid;
    gap: 0.4rem;
    margin: 0;
}

.brevo-field label,
.brevo-preferences legend {
    font-size: var(--text-sm);
    font-weight: 600;
}

.brevo-field label span {
    font-weight: 400;
    opacity: 0.8;
}

.brevo-field input,
.brevo-field textarea {
    width: 100%;
    padding: 0.8rem 0.95rem;
    border: 1px solid rgba(34, 34, 34, 0.25);
    border-radius: var(--radius-sm);
    background: var(--color-white);
    color: var(--color-text-dark);
    font: inherit;
}

.brevo-field input:focus,
.brevo-field textarea:focus,
.brevo-preferences input:focus-visible,
.brevo-consent input:focus-visible {
    outline: 3px solid var(--color-tertiary-accent);
    outline-offset: 2px;
}

.brevo-preferences {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    padding: 0;
    border: 0;
    margin: 0;
}

.brevo-preferences legend {
    width: 100%;
    margin-bottom: 0.2rem;
}

.brevo-preferences label,
.brevo-consent {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: var(--text-sm);
    line-height: 1.45;
}

.brevo-preferences input,
.brevo-consent input {
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
    flex: 0 0 auto;
    accent-color: var(--color-primary-accent);
}

.brevo-consent a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.brevo-signup__submit {
    justify-self: start;
}

.brevo-signup__note {
    margin: 0;
    font-size: var(--text-xs);
    opacity: 0.8;
}

.brevo-form-message {
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    margin: 0;
    font-size: var(--text-sm);
}

.brevo-form-message--success,
.brevo-form-message--notice {
    background: #eef8f1;
    color: #174f2a;
    border: 1px solid #91c7a0;
}

.brevo-form-message--error {
    background: #fff1ef;
    color: #7b2118;
    border: 1px solid #d79890;
}

.brevo-welcome-code {
    padding: var(--space-lg);
    border: 2px dashed var(--color-primary-accent);
    border-radius: var(--radius-md);
    margin: var(--space-lg) 0;
    background: #fff8eb;
    text-align: center;
}

.brevo-welcome-code p {
    margin-bottom: var(--space-sm);
}

.brevo-welcome-code code {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--color-primary-dark);
    color: var(--color-white);
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: var(--weight-bold);
    letter-spacing: 0.08em;
}

.brevo-honeypot {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    white-space: nowrap !important;
}

.newsletter-section .brevo-signup {
    color: var(--color-white);
}

.newsletter-section .brevo-field input {
    border: 0;
}

.newsletter-section .brevo-signup__submit {
    background: var(--color-light-neutral);
    border-color: var(--color-light-neutral);
    color: var(--color-secondary-accent);
}

.newsletter-section .brevo-signup__submit:hover,
.newsletter-section .brevo-signup__submit:focus-visible {
    background: var(--color-white);
    border-color: var(--color-white);
    color: var(--color-primary-dark);
}

.footer-newsletter {
    padding: var(--space-2xl) 0;
    background: var(--color-primary-accent);
    border-top: 0;
    color: var(--color-white);
}

.footer-newsletter__inner {
    display: grid;
    grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr);
    gap: var(--space-2xl);
    align-items: center;
}

.footer-newsletter__title {
    color: var(--color-white);
    margin-bottom: var(--space-sm);
}

.footer-newsletter__text {
    margin: 0;
    opacity: 0.82;
}

.footer-newsletter .brevo-field label,
.footer-newsletter .brevo-preferences legend,
.footer-newsletter .brevo-preferences label,
.footer-newsletter .brevo-consent,
.footer-newsletter .brevo-signup__note {
    color: var(--color-white);
}

.footer-newsletter .brevo-field input {
    border-color: rgba(255, 255, 255, 0.58);
}

.footer-newsletter .brevo-signup__submit {
    border-color: var(--color-light-neutral);
    background: var(--color-light-neutral);
    color: var(--color-secondary-accent);
}

.footer-newsletter .brevo-signup__submit:hover,
.footer-newsletter .brevo-signup__submit:focus-visible {
    border-color: var(--color-white);
    background: var(--color-white);
    color: var(--color-primary-dark);
}

.brevo-signup--compact .brevo-field input {
    border-color: rgba(255, 255, 255, 0.58);
}

.brevo-preference-page {
    max-width: 920px;
    margin: 0 auto;
}

.brevo-preference-form {
    margin-top: var(--space-xl);
}

.brevo-preferences--grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.brevo-checkout-offer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-lg);
    padding: var(--space-lg);
    border: 1px solid rgba(163, 63, 45, 0.28);
    border-left: 5px solid var(--color-primary-accent);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
    background: #fff8eb;
    box-shadow: var(--shadow-sm);
}

.brevo-checkout-offer__eyebrow,
.brevo-offer-modal__eyebrow {
    margin: 0 0 0.25rem;
    color: var(--color-primary-accent);
    font-family: var(--font-heading);
    font-size: var(--text-xs);
    font-weight: var(--weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.brevo-checkout-offer__title {
    margin: 0 0 0.35rem;
    font-size: var(--text-2xl);
}

.brevo-checkout-offer__text {
    margin: 0;
}

.brevo-checkout-offer .btn {
    flex: 0 0 auto;
}

body.brevo-offer-open {
    overflow: hidden;
}

.brevo-offer-modal[hidden] {
    display: none !important;
}

.brevo-offer-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: var(--space-lg);
}

.brevo-offer-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(22, 22, 22, 0.72);
    cursor: pointer;
}

.brevo-offer-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 540px);
    max-height: calc(100vh - (2 * var(--space-lg)));
    overflow-y: auto;
    padding: clamp(1.5rem, 5vw, 2.5rem);
    border: 1px solid rgba(245, 230, 200, 0.2);
    border-radius: var(--radius-md);
    background: #252525;
    box-shadow: var(--shadow-xl);
    color: var(--color-white);
}

.brevo-offer-modal__close {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    display: inline-grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-white);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.brevo-offer-modal__close:hover,
.brevo-offer-modal__close:focus-visible {
    color: var(--color-tertiary-accent);
}

.brevo-offer-modal__title {
    margin: 0 2rem var(--space-sm) 0;
    color: var(--color-white);
    font-size: clamp(2rem, 7vw, 3rem);
}

.brevo-offer-modal__text {
    margin-bottom: var(--space-lg);
    color: rgba(255, 255, 255, 0.88);
}

.brevo-offer-form {
    gap: var(--space-sm);
}

.brevo-offer-form .brevo-field input {
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.brevo-offer-form .brevo-consent {
    color: rgba(255, 255, 255, 0.82);
    font-size: var(--text-xs);
}

.brevo-offer-form .brevo-signup__submit {
    width: 100%;
    margin-top: 0.25rem;
}

.brevo-offer-form .brevo-signup__note {
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
}

@media (max-width: 900px) {
    .footer-newsletter__inner {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .brevo-signup__identity,
    .brevo-preferences--grid {
        grid-template-columns: 1fr;
    }

    .brevo-preferences {
        display: grid;
        grid-template-columns: 1fr;
    }

    .brevo-signup__submit {
        width: 100%;
    }

    .brevo-checkout-offer {
        align-items: stretch;
        flex-direction: column;
    }

    .brevo-checkout-offer .btn {
        width: 100%;
    }

    .brevo-offer-modal {
        align-items: end;
        padding: 0;
    }

    .brevo-offer-modal__dialog {
        width: 100%;
        max-height: min(88vh, 760px);
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }
}
