.aec-submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 48px;
    padding: 14px 22px;
    border: 0;
    border-radius: calc(var(--aec-radius) * 0.65);
    background: var(--aec-button-bg);
    color: var(--aec-button-text);
    font-family: var(--aec-font-family);
    font-size: var(--aec-button-size);
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.aec-submit-button:hover {
    filter: brightness(0.97);
    transform: translateY(-1px);
}

.aec-submit-button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.aec-popup[hidden] {
    display: none;
}

.aec-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: var(--aec-font-family);
}

.aec-popup-overlay {
    position: absolute;
    inset: 0;
    background: var(--aec-overlay-bg);
}

.aec-popup-modal {
    position: relative;
    z-index: 1;
    width: min(100%, var(--aec-popup-width));
    max-height: calc(100vh - 40px);
    overflow: visible;
    border: 1px solid var(--aec-border-color);
    border-radius: var(--aec-radius);
    background: var(--aec-popup-bg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}

.aec-popup-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 3px solid #ffffff;
    border-radius: 999px;
    background: #3f3f46;
    color: #ffffff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.aec-popup-close:hover {
    background: #18181b;
    color: #ffffff;
}

.aec-popup-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: cover;
    border-radius: var(--aec-radius) var(--aec-radius) 0 0;
}

.aec-popup-content {
    padding: 24px;
    text-align: center;
}

.aec-popup-title,
.aec-sidebar-title {
    margin: 0 0 10px;
    color: var(--aec-headline-color);
    font-family: var(--aec-font-family);
    font-size: var(--aec-headline-size);
    font-weight: 900;
    line-height: 1.15;
}

.aec-popup-description,
.aec-sidebar-description {
    margin: 0 0 18px;
    color: var(--aec-body-text);
    font-family: var(--aec-font-family);
    font-size: var(--aec-description-size);
    line-height: 1.55;
}

.aec-sidebar-description p {
    margin-top: 0;
}

.aec-capture-form {
    display: grid;
    gap: 12px;
}

.aec-email-input {
    width: 100%;
    min-height: 48px;
    padding: 13px 14px;
    border: 1px solid var(--aec-border-color);
    border-radius: calc(var(--aec-radius) * 0.55);
    background: #fff;
    color: #111;
    font-family: var(--aec-font-family);
    font-size: 16px;
    box-sizing: border-box;
}

.aec-email-input:focus {
    outline: 2px solid color-mix(in srgb, var(--aec-button-bg) 55%, transparent);
    outline-offset: 1px;
}

.aec-submit-button {
    width: 100%;
}

.aec-form-message {
    min-height: 18px;
    font-size: 13px;
    line-height: 1.4;
}

.aec-form-message.aec-error {
    color: #b42318;
}

.aec-form-message.aec-success {
    color: #027a48;
}

.aec-privacy-text {
    margin: 0;
    color: var(--aec-body-text);
    font-family: var(--aec-font-family);
    font-size: 11px;
    line-height: 1.45;
    opacity: 0.76;
}

.aec-sidebar-card {
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--aec-border-color);
    border-radius: var(--aec-radius);
    background: var(--aec-popup-bg);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    font-family: var(--aec-font-family);
}

.aec-sidebar-image {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.aec-sidebar-body {
    padding: 18px;
    text-align: center;
}

@supports not (color: color-mix(in srgb, black 50%, transparent)) {
    .aec-email-input:focus {
        outline: 2px solid var(--aec-button-bg);
    }
}

@media (max-width: 520px) {
    .aec-popup {
        padding: 12px;
        align-items: flex-end;
    }

    .aec-popup-modal {
        max-height: calc(100vh - 24px);
    }

    .aec-popup-close {
        top: -10px;
        right: -10px;
        width: 36px;
        height: 36px;
        font-size: 26px;
    }

    .aec-popup-content {
        padding: 20px;
    }
}

.aec-floating-sidebar-wrap {
    position: fixed;
    top: 190px;
    right: max(18px, calc((100vw - 1240px) / 2));
    width: 320px;
    max-width: calc(100vw - 36px);
    z-index: 99990;
}

.aec-floating-sidebar-wrap .aec-sidebar-card {
    max-height: calc(100vh - 220px);
    overflow: auto;
}

.aec-auto-sidebar-card {
    margin-bottom: 24px;
}

@media (max-width: 1180px) {
    .aec-floating-sidebar-wrap {
        display: none;
    }
}

/* Standalone sidebar: plugin-owned sidebar, independent from WordPress Widgets/theme sidebar. */
.aec-standalone-sidebar-wrap {
    width: var(--aec-standalone-width, 320px);
    max-width: calc(100vw - 36px);
    z-index: 99990;
}

.aec-standalone-sidebar-wrap[data-aec-mounted="fixed"] {
    position: fixed;
    top: var(--aec-standalone-top, 190px);
}

.aec-standalone-sidebar-wrap--right[data-aec-mounted="fixed"] {
    right: max(18px, calc((100vw - 1240px) / 2));
}

.aec-standalone-sidebar-wrap--left[data-aec-mounted="fixed"] {
    left: max(18px, calc((100vw - 1240px) / 2));
}

.aec-standalone-sidebar-wrap[data-aec-mounted="target"] {
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 24px !important;
}

.aec-standalone-sidebar-wrap[data-aec-mode="selector"]:not([data-aec-mounted="target"]) {
    display: none !important;
}

.aec-standalone-sidebar-wrap[data-aec-mounted="fixed"] .aec-sidebar-card {
    max-height: calc(100vh - var(--aec-standalone-top, 190px) - 24px);
    overflow: auto;
}

.aec-standalone-sidebar-card {
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .aec-standalone-sidebar-wrap[data-aec-mounted="fixed"] {
        display: none !important;
    }
}


/* v1.5: Auto-gated normal affiliate links. Shortcode CTA renders as a normal text link. */
.aec-plain-cta {
    display: inline !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.aec-plain-cta:hover {
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    filter: none !important;
}

/* Cleaner opt-in box image layout. */
.aec-popup-image,
.aec-sidebar-image {
    width: 100% !important;
    aspect-ratio: 16 / 9;
    height: auto !important;
    max-height: none !important;
    object-fit: cover !important;
}

.aec-popup-modal {
    width: min(100%, 430px, var(--aec-popup-width)) !important;
}

.aec-popup-content {
    padding: 20px 22px 22px !important;
}

.aec-sidebar-body {
    padding: 18px 16px 20px !important;
}

.aec-popup-title,
.aec-sidebar-title {
    margin-bottom: 8px !important;
}

.aec-popup-description,
.aec-sidebar-description {
    margin-bottom: 14px !important;
}

.aec-privacy-text {
    display: none !important;
}
