.tt-newsletter-open {
    overflow: hidden;
}

.tt-newsletter-popup[hidden] {
    display: none !important;
}

.tt-newsletter-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.tt-newsletter-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    opacity: 0;
    transition: opacity 320ms ease;
}

.tt-newsletter-popup__dialog {
    position: relative;
    z-index: 2;
    width: min(92vw, 880px);
    max-height: 90vh;
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 30px 100px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(-28px) scale(0.98);
    transition:
        opacity 360ms cubic-bezier(0.16, 1, 0.3, 1),
        transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tt-newsletter-popup.is-visible .tt-newsletter-popup__overlay {
    opacity: 1;
}

.tt-newsletter-popup.is-visible .tt-newsletter-popup__dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tt-newsletter-popup.is-closing .tt-newsletter-popup__overlay {
    opacity: 0;
}

.tt-newsletter-popup.is-closing .tt-newsletter-popup__dialog {
    opacity: 0;
    transform: translateY(-20px) scale(0.985);
}

/* Close button */
.tt-newsletter-popup__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #475467;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 180ms ease, color 180ms ease;
}

.tt-newsletter-popup__close:hover {
    background: #fff;
    color: #101828;
}

/* Outer layout */
.tt-newsletter-popup__outer {
    display: flex;
    min-height: 500px;
}

/* Left content */
.tt-newsletter-popup__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 40px;
    overflow-y: auto;
}

.tt-newsletter-popup__inner {
    width: 100%;
    max-width: 400px;
}

/* Right image */
.tt-newsletter-popup__image {
    flex: 0 0 44%;
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    border-radius: 0 18px 18px 0;
}

/* Logo */
.tt-newsletter-popup__logo {
    margin-bottom: 20px;
}

.tt-newsletter-popup__logo img {
    display: block;
    height: auto;
}

/* Title */
.tt-newsletter-popup__title {
    margin: 0 0 10px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.15;
    color: #101828;
    font-family: var(--font-heading, sans-serif);
}

/* Divider */
.tt-newsletter-popup__divider {
    width: 40px;
    height: 4px;
    background: #0B6D4C;
    border-radius: 2px;
    margin-bottom: 14px;
}

/* Description */
.tt-newsletter-popup__desc {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.6;
    color: #475467;
}

/* Success screen */
.tt-newsletter-popup__success {
    display: none;
}

.tt-newsletter-popup__success.is-visible {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    animation: ttNewsletterSuccessIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tt-newsletter-popup__success-inner {
    text-align: center;
}

.tt-newsletter-popup__success-svg {
    margin-bottom: 18px;
}

.tt-newsletter-popup__success-svg svg {
    display: block;
    margin: 0 auto;
}

.tt-newsletter-popup__success-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.2;
    color: #101828;
}

.tt-newsletter-popup__form-content.is-hidden {
    display: none;
}

/* Form fields */
.tt-newsletter-popup__field {
    position: relative;
    margin-bottom: 14px;
}

.tt-newsletter-popup__field-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #0B6D4C;
    pointer-events: none;
    display: flex;
    align-items: center;
}

.tt-newsletter-popup__field input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 44px;
    border: 1px solid #d0d5dd;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.tt-newsletter-popup__field input::placeholder {
    color: #98a2b3;
}

.tt-newsletter-popup__field input:focus {
    border-color: #0B6D4C;
    box-shadow: 0 0 0 3px rgba(11, 109, 76, 0.12);
}

/* Submit button */
.tt-newsletter-popup__submit {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 10px;
    background: #0B6D4C;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.03em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 180ms ease, transform 180ms ease;
}

.tt-newsletter-popup__submit:hover {
    background: #095a3f;
}

.tt-newsletter-popup__submit:disabled {
    opacity: 0.7;
    cursor: wait;
}

.tt-newsletter-popup__submit-icon {
    display: flex;
    align-items: center;
}

/* Message */
.tt-newsletter-popup__message {
    margin-top: 12px;
    font-size: 14px;
}

.tt-newsletter-popup__message.is-success {
    color: #067647;
}

.tt-newsletter-popup__message.is-error {
    color: #b42318;
}

/* Trust badges */
.tt-newsletter-popup__trust {
    display: flex;
    gap: 8px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.tt-newsletter-popup__badge {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    flex: 1;
    min-width: 120px;
}

.tt-newsletter-popup__badge-icon {
    flex-shrink: 0;
    color: #0B6D4C;
    display: flex;
    align-items: center;
    margin-top: 2px;
}

.tt-newsletter-popup__badge-text {
    font-size: 11px;
    line-height: 1.35;
    color: #344054;
    font-weight: 500;
}

/* Animations */
@keyframes ttPopupShake {
    0% { transform: scale(1); }
    25% { transform: scale(1.025); }
    50% { transform: scale(0.98); }
    75% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

.tt-newsletter-popup__dialog--shake {
    animation: ttPopupShake 500ms cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes ttNewsletterSuccessIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile */
@media (max-width: 768px) {
    .tt-newsletter-popup {
        padding: 12px;
        align-items: center;
    }

    .tt-newsletter-popup__dialog {
        width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 14px;
    }

    .tt-newsletter-popup__outer {
        flex-direction: column;
        min-height: auto;
    }

    .tt-newsletter-popup__image {
        display: none;
    }

    .tt-newsletter-popup__content {
        padding: 28px 22px 22px;
    }

    .tt-newsletter-popup__inner {
        max-width: 100%;
    }

    .tt-newsletter-popup__close {
        top: 10px;
        right: 10px;
    }

    .tt-newsletter-popup__success-title {
        font-size: 22px;
    }
}
