/**
 * Thimze Newsletter — popup / floating-bar / slide-in / sticky form styles
 */

.tnl-popup-form {
    position: fixed;
    z-index: 99999;
    background: var(--tnl-bg, #fff);
    box-shadow: 0 10px 40px rgba(0,0,0,.18);
    border-radius: 14px;
    max-width: 380px;
    padding: 28px 26px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

.tnl-popup-form h3 { margin: 0 0 8px; font-size: 20px; color: #111111; }
.tnl-popup-form p  { margin: 0 0 16px; font-size: 14px; color: #555; }

.tnl-popup-form-body input[type="email"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    box-sizing: border-box;
    background: #ffffff;
}

.tnl-popup-consent {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #6b7280;
    margin-top: 10px;
}
.tnl-popup-consent input { margin-top: 2px; }

.tnl-popup-form-body button[type="submit"] {
    width: 100%;
    background: var(--tnl-accent, #19c3f3);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 12px 0;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    position: relative;
}

.tnl-popup-form-body button[type="submit"].is-loading {
    color: transparent;
    pointer-events: none;
}

.tnl-popup-form-body button[type="submit"].is-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin: -9px 0 0 -9px;
    border: 2px solid rgba(255,255,255,.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tnl-spin .7s linear infinite;
}

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

.tnl-popup-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    padding: 0;
    box-sizing: border-box;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #999;
}

.tnl-popup-error { color: #b91c1c; font-size: 13px; margin-top: 8px; }
.tnl-popup-success { font-size: 14px; color: #15803d; text-align: center; padding: 10px 0; }

/* ── Types ───────────────────────────────────────────────── */

.tnl-popup-popup {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.tnl-popup-slide_in {
    bottom: 24px;
    width: 340px;
}
.tnl-popup-slide_in.tnl-pos-bottom-left  { left: 24px; }
.tnl-popup-slide_in.tnl-pos-bottom-right { right: 24px; }

.tnl-popup-floating_bar,
.tnl-popup-sticky {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    border-radius: 0;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.tnl-popup-floating_bar.tnl-pos-top,
.tnl-popup-sticky.tnl-pos-top { top: 0; }
.tnl-popup-floating_bar:not(.tnl-pos-top),
.tnl-popup-sticky:not(.tnl-pos-top) { bottom: 0; }

.tnl-popup-floating_bar .tnl-popup-inner,
.tnl-popup-sticky .tnl-popup-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    width: 100%;
}
.tnl-popup-floating_bar h3,
.tnl-popup-sticky h3 { margin: 0; font-size: 15px; }
.tnl-popup-floating_bar p,
.tnl-popup-sticky p { display: none; }
.tnl-popup-floating_bar .tnl-popup-form-body,
.tnl-popup-sticky .tnl-popup-form-body {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 260px;
}
.tnl-popup-floating_bar .tnl-popup-form-body input[type="email"],
.tnl-popup-sticky .tnl-popup-form-body input[type="email"] { margin-bottom: 0; width: auto; flex: 1; }
.tnl-popup-floating_bar .tnl-popup-consent,
.tnl-popup-sticky .tnl-popup-consent { display: none; }
.tnl-popup-floating_bar .tnl-popup-form-body button,
.tnl-popup-sticky .tnl-popup-form-body button { width: auto; padding: 11px 20px; }

/* Overlay backdrop for the modal popup type only */
.tnl-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 99998;
}

@media (max-width: 480px) {
    .tnl-popup-form { max-width: calc(100% - 24px); left: 12px !important; right: 12px !important; transform: none; }
    .tnl-popup-popup { top: auto; bottom: 24px; }
}

/* ── Two-column "media" popup (image + overlay text on the right) ── */

.tnl-popup-popup.tnl-popup-has-media {
    max-width: 760px;
    width: calc(100% - 40px);
    padding: 0;
    overflow: hidden;
}

.tnl-popup-has-media .tnl-popup-inner {
    display: flex;
    align-items: stretch;
    min-height: 420px;
}

.tnl-popup-has-media .tnl-popup-content {
    flex: 1 1 50%;
    padding: 40px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tnl-popup-has-media .tnl-popup-content h3 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.tnl-popup-has-media .tnl-popup-content p {
    font-size: 15px;
}

.tnl-popup-has-media .tnl-popup-form-body button[type="submit"] {
    border-radius: 8px;
    padding: 14px 0;
}

.tnl-popup-media {
    flex: 1 1 50%;
    position: relative;
    background: #e5e7eb;
}

.tnl-popup-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tnl-popup-media-caption {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    color: #fff;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    text-shadow: 0 2px 10px rgba(0,0,0,.45);
}

.tnl-popup-has-media .tnl-popup-close {
    top: 16px;
    right: 16px;
    background: #fff;
    width: 32px;
    height: 32px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

@media (max-width: 700px) {
    .tnl-popup-popup.tnl-popup-has-media {
        max-width: calc(100% - 24px);
        left: 12px !important;
        right: 12px !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translateY(-50%) !important;
    }
    .tnl-popup-has-media .tnl-popup-inner {
        flex-direction: column;
        min-height: 0;
    }
    .tnl-popup-media {
        min-height: 200px;
        order: -1;
    }
    .tnl-popup-has-media .tnl-popup-content {
        padding: 28px 24px;
    }
}
