.ruba-newsletter-root,
.ruba-newsletter-root *,
.ruba-newsletter-sidebar-widget,
.ruba-newsletter-sidebar-widget * {
    box-sizing: border-box;
}

/*
 * Keep the hook output as a zero-height block at the end of the body.
 * Do not give it a zero width: Chrome Android can preserve an RTL horizontal
 * pan when a fixed descendant belongs to a zero-width containing element.
 */
.ruba-newsletter-root {
    position: static;
    width: auto;
    height: 0;
    max-height: 0;
    overflow: visible;
}

.ruba-newsletter-overlay[hidden],
.ruba-newsletter-loading[hidden],
.ruba-newsletter-error[hidden],
.ruba-newsletter-sidebar-success[hidden],
[data-ruba-newsletter-sidebar-prompt][hidden] {
    display: none !important;
}

body.ruba-newsletter-modal-open {
    overflow: hidden;
}

.ruba-newsletter-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    overflow-x: hidden;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 31, 57, 0.68);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    animation: ruba-newsletter-overlay-in 180ms ease-out;
}

.ruba-newsletter-dialog {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    max-height: 88dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #14213d;
    background: #ffffff;
    border: 1px solid rgba(208, 154, 49, 0.52);
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(0, 24, 48, 0.3);
    font-family: inherit;
    animation: ruba-newsletter-dialog-in 220ms ease-out;
}

.ruba-newsletter-dialog-accent {
    width: 100%;
    height: 5px;
    flex: 0 0 5px;
    background: linear-gradient(90deg, #d09a31 0%, #f0cf7a 50%, #d09a31 100%);
}

.ruba-newsletter-dialog-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
    padding: 17px 20px;
    background: #0d3b6c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ruba-newsletter-dialog-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
}

.ruba-newsletter-dialog-brand > div {
    min-width: 0;
}

.ruba-newsletter-dialog-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(208, 154, 49, 0.48);
    border-radius: 13px;
}

.ruba-newsletter-dialog-icon img {
    display: block;
}

.ruba-newsletter-dialog-brand h2 {
    margin: 0;
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.45;
}

.ruba-newsletter-dialog-brand p {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    line-height: 1.55;
}

.ruba-newsletter-dialog-close {
    width: 42px;
    height: 42px;
    margin-inline-start: auto;
    flex: 0 0 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    font: inherit;
    font-size: 29px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ruba-newsletter-dialog-close:hover,
.ruba-newsletter-dialog-close:focus-visible {
    color: #0d3b6c;
    background: #ffffff;
    border-color: #ffffff;
    outline: none;
    transform: rotate(4deg);
}

.ruba-newsletter-dialog-body {
    min-height: 180px;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #f8fafc;
}

.ruba-newsletter-form-host,
.ruba-newsletter-reach-form,
.ruba-newsletter-form-host iframe {
    width: 100%;
}

.ruba-newsletter-form-host iframe {
    display: block;
    border: 0;
}

.ruba-newsletter-loading {
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #52657a;
    font-size: 14px;
    text-align: center;
}

.ruba-newsletter-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #dce4ec;
    border-top-color: #d09a31;
    border-radius: 50%;
    animation: ruba-newsletter-spin 800ms linear infinite;
}

.ruba-newsletter-error {
    margin: 8px 0;
    padding: 18px;
    color: #6b2630;
    background: #fff7f7;
    border: 1px solid #efc8cd;
    border-radius: 14px;
    text-align: center;
}

.ruba-newsletter-error p {
    margin: 0 0 10px;
    font-weight: 700;
}

.ruba-newsletter-error a {
    color: #0d3b6c;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ruba-newsletter-mobile-invitation {
    display: none;
}

.ruba-newsletter-sidebar-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    color: #16314f;
    background: #ffffff;
    border: 1px solid #dfe5eb;
    border-radius: 7px;
    box-shadow: 0 3px 10px rgba(15, 52, 92, 0.05);
    font-family: inherit;
}

.ruba-newsletter-sidebar-heading {
    min-width: 0;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 14px;
    color: #ffffff;
    background: #0d3b6c;
    border-bottom: 3px solid #d09a31;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
}

.ruba-newsletter-sidebar-heading img {
    display: block;
}

.ruba-newsletter-sidebar-body {
    min-width: 0;
    padding: 18px 14px 15px;
    text-align: center;
}

.ruba-newsletter-sidebar-emblem {
    width: 72px;
    height: 72px;
    margin: 0 auto 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff, #f1f5f9);
    border: 1px solid #e1e7ee;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(13, 59, 108, 0.09);
}

.ruba-newsletter-sidebar-emblem img {
    display: block;
}

.ruba-newsletter-sidebar-title {
    margin: 0;
    color: #0d3b6c;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.ruba-newsletter-sidebar-copy {
    margin: 8px 0 14px;
    color: #536579;
    font-size: 12.5px;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.ruba-newsletter-sidebar-button {
    width: 100%;
    min-height: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 14px;
    color: #ffffff;
    background: #0d3b6c;
    border: 1px solid #0d3b6c;
    border-bottom: 3px solid #d09a31;
    border-radius: 6px;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: 0 5px 14px rgba(13, 59, 108, 0.13);
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.ruba-newsletter-sidebar-button:hover,
.ruba-newsletter-sidebar-button:focus-visible {
    color: #ffffff;
    background: #b77f1f;
    border-color: #b77f1f;
    outline: none;
    transform: translateY(-1px);
}

.ruba-newsletter-sidebar-button span:last-child {
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
}

.ruba-newsletter-sidebar-note {
    margin: 9px 0 0;
    color: #7a8795;
    font-size: 11px;
    line-height: 1.6;
}

.ruba-newsletter-sidebar-success {
    padding: 21px 16px 19px;
    color: #38536f;
    text-align: center;
}

.ruba-newsletter-sidebar-success-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #0d3b6c;
    border: 3px solid #d09a31;
    border-radius: 50%;
    font-size: 23px;
    font-weight: 800;
    line-height: 1;
}

.ruba-newsletter-sidebar-success p {
    margin: 0;
    color: #0d3b6c;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.6;
}

.ruba-newsletter-sidebar-success > span:last-child {
    display: block;
    margin-top: 5px;
    color: #68798a;
    font-size: 11.5px;
    line-height: 1.65;
}

.ruba-newsletter-noscript-link {
    display: inline-block;
    margin-top: 9px;
    color: #0d3b6c;
    font-size: 12px;
    font-weight: 700;
    text-decoration: underline;
}

@keyframes ruba-newsletter-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ruba-newsletter-dialog-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes ruba-newsletter-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 767px) {
    body.ruba-newsletter-modal-open {
        overflow: hidden;
    }

    .ruba-newsletter-overlay {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 12px;
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
        overflow: hidden;
        background: rgba(3, 31, 57, 0.68);
        -webkit-backdrop-filter: blur(2px);
        backdrop-filter: blur(2px);
        pointer-events: auto;
        animation: ruba-newsletter-overlay-in 180ms ease-out;
    }

    .ruba-newsletter-dialog {
        width: 100%;
        max-width: 520px;
        min-width: 0;
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        margin: 0;
        border-radius: 17px;
        box-shadow: 0 18px 52px rgba(0, 24, 48, 0.28);
        pointer-events: auto;
    }

    .ruba-newsletter-dialog-header {
        padding: 13px 14px;
    }

    .ruba-newsletter-dialog-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        border-radius: 11px;
    }

    .ruba-newsletter-dialog-brand h2 {
        font-size: 17px;
    }

    .ruba-newsletter-dialog-brand p {
        max-width: 235px;
        font-size: 11.5px;
        overflow-wrap: anywhere;
    }

    .ruba-newsletter-dialog-close {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }

    .ruba-newsletter-dialog-body {
        min-height: 0;
        padding: 12px;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        background: #f8fafc;
    }

    .ruba-newsletter-desktop-content {
        display: block;
    }

    .ruba-newsletter-mobile-invitation {
        display: none;
    }

    .ruba-newsletter-mobile-emblem {
        width: 68px;
        height: 68px;
        margin: 0 auto 11px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #f5f8fb;
        border: 1px solid #dfe7ef;
        border-radius: 50%;
    }

    .ruba-newsletter-mobile-emblem img {
        display: block;
    }

    .ruba-newsletter-mobile-invitation h3 {
        margin: 0;
        color: #0d3b6c;
        font-size: 17px;
        font-weight: 800;
        line-height: 1.55;
    }

    .ruba-newsletter-mobile-invitation p {
        margin: 7px 0 14px;
        font-size: 13px;
        line-height: 1.75;
    }

    .ruba-newsletter-mobile-button {
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 10px 16px;
        color: #ffffff;
        background: #0d3b6c;
        border: 1px solid #0d3b6c;
        border-bottom: 3px solid #d09a31;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 800;
        line-height: 1.4;
        text-decoration: none;
    }

    .ruba-newsletter-mobile-button:hover,
    .ruba-newsletter-mobile-button:focus-visible {
        color: #ffffff;
        background: #b77f1f;
        border-color: #b77f1f;
        outline: none;
    }

    .ruba-newsletter-mobile-invitation small {
        display: block;
        margin-top: 9px;
        color: #7a8795;
        font-size: 10.5px;
        line-height: 1.65;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ruba-newsletter-overlay,
    .ruba-newsletter-dialog,
    .ruba-newsletter-spinner,
    .ruba-newsletter-dialog-close,
    .ruba-newsletter-sidebar-button {
        animation: none !important;
        transition: none !important;
    }
}
