/* ─── TA Channel Popup ─── */

#ta-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

#ta-popup-overlay.ta-popup-visible {
    opacity: 1;
    pointer-events: all;
}

#ta-popup-box {
    position: relative;
    background: #fff;
    border-radius: 24px;
    padding: 36px 32px 28px;
    max-width: 460px;
    width: 100%;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    box-shadow:
        0 32px 64px rgba(0,0,0,0.22),
        0 0 0 1px rgba(255,255,255,0.08);
    text-align: center;
    transform: translateY(32px) scale(0.96);
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
    -webkit-overflow-scrolling: touch;
}

#ta-popup-overlay.ta-popup-visible #ta-popup-box {
    transform: translateY(0) scale(1);
}

/* Decorative gradient top bar */
#ta-popup-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FF6B35, #E63946, #FF6B35);
    background-size: 200% 100%;
    animation: ta-shimmer 2.5s infinite linear;
}

@keyframes ta-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Close Button ─── */
#ta-popup-close {
    position: sticky;
    top: 0;
    float: right;
    margin: 0 -4px 0 0;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 16px;
    cursor: pointer;
    color: #666;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    line-height: 1;
    padding: 0;
    z-index: 10;
    flex-shrink: 0;
}

#ta-popup-close:hover {
    background: #E63946;
    color: #fff;
    transform: rotate(90deg);
}

/* ─── Header ─── */
.ta-popup-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    text-align: left;
    clear: both;
}

.ta-popup-logo {
    flex-shrink: 0;
    width: 56px; height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, #fff5f0, #ffe8e8);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(230,57,70,0.2);
}

.ta-popup-logo svg {
    width: 40px; height: 40px;
}

.ta-popup-headline {
    flex: 1;
}

.ta-popup-eyebrow {
    font-size: 12px;
    font-weight: 600;
    color: #E63946;
    margin: 0 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ta-popup-headline h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: #1a1a2e;
    line-height: 1.25;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ta-popup-headline h2 span {
    color: #E63946;
}

/* ─── Subtitle ─── */
.ta-popup-subtitle {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 24px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 3px solid #FF6B35;
}

.ta-popup-subtitle strong {
    color: #1a1a2e;
}

/* ─── Buttons ─── */
.ta-popup-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.ta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 24px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ta-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background 0.2s;
}

.ta-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
    text-decoration: none;
}

.ta-btn:hover::after {
    background: rgba(255,255,255,0.08);
}

.ta-btn:active {
    transform: translateY(0);
}

.ta-btn-icon {
    width: 22px; height: 22px;
    flex-shrink: 0;
}

/* Telegram */
.ta-btn-telegram {
    background: linear-gradient(135deg, #2AABEE, #229ED9);
    color: #fff;
    box-shadow: 0 6px 20px rgba(42,171,238,0.4);
}

/* WhatsApp */
.ta-btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: #fff;
    box-shadow: 0 6px 20px rgba(37,211,102,0.4);
}

/* Badge */
.ta-btn-badge {
    position: absolute;
    right: 14px;
    top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.28);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ─── Disclaimer ─── */
.ta-popup-disclaimer {
    font-size: 12px;
    color: #999;
    margin: 0 0 12px;
    line-height: 1.5;
}

/* ─── Skip link ─── */
.ta-popup-skip {
    background: none;
    border: none;
    font-size: 12px;
    color: #bbb;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    padding: 4px 8px;
    transition: color 0.2s;
    font-family: inherit;
}

.ta-popup-skip:hover {
    color: #888;
}

/* ─── Newsletter ─── */
.ta-popup-newsletter {
    margin-top: 12px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.ta-nl-separator {
    text-align: center;
    position: relative;
    margin: 0 0 10px;
}

.ta-nl-separator::before,
.ta-nl-separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: #e5e5e5;
}

.ta-nl-separator::before { left: 0; }
.ta-nl-separator::after  { right: 0; }

.ta-nl-separator span {
    background: #fff;
    padding: 0 12px;
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}

.ta-nl-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ta-nl-desc {
    font-size: 13px;
    color: #666;
    margin: 0 0 14px;
    line-height: 1.5;
}

.ta-nl-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ta-nl-field input[type="email"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #fafafa;
}

.ta-nl-field input[type="email"]:focus {
    border-color: #FF6B35;
    background: #fff;
}

.ta-nl-privacy-wrap {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    text-align: left;
}

.ta-nl-privacy-wrap input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: #E63946;
    cursor: pointer;
}

.ta-nl-privacy-wrap label {
    cursor: pointer;
}

.ta-nl-privacy-wrap a {
    color: #E63946;
    text-decoration: underline;
}

.ta-nl-privacy-wrap a:hover {
    color: #FF6B35;
}

.ta-nl-submit {
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #FF6B35, #E63946);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ta-nl-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(230,57,70,0.4);
}

.ta-nl-submit:active:not(:disabled) {
    transform: translateY(0);
}

.ta-nl-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ta-nl-message {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
}

.ta-nl-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.ta-nl-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* ─── Mobile drag handle ─── */
.ta-popup-drag-handle {
    display: none;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #d0d0d0;
    margin: 0 auto 12px;
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
    #ta-popup-overlay {
        padding: 8px;
        align-items: flex-end;
    }

    #ta-popup-box {
        padding: 12px 16px 16px;
        border-radius: 20px 20px 0 0;
        max-height: 92dvh;
    }

    .ta-popup-drag-handle {
        display: block;
    }

    #ta-popup-close {
        margin: -12px -16px 0 0;
        width: 34px; height: 34px;
        font-size: 15px;
    }

    .ta-popup-header {
        gap: 10px;
        margin-bottom: 10px;
    }

    .ta-popup-logo {
        width: 44px; height: 44px;
        border-radius: 12px;
    }

    .ta-popup-logo svg {
        width: 32px; height: 32px;
    }

    .ta-popup-eyebrow {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .ta-popup-headline h2 {
        font-size: 17px;
    }

    .ta-popup-subtitle {
        font-size: 13px;
        margin-bottom: 16px;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .ta-popup-buttons {
        gap: 8px;
        margin-bottom: 10px;
    }

    .ta-btn {
        font-size: 14px;
        padding: 12px 16px;
        border-radius: 12px;
        gap: 8px;
    }

    .ta-btn-icon {
        width: 20px; height: 20px;
    }

    .ta-btn-badge {
        display: none;
    }

    .ta-popup-disclaimer {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .ta-popup-skip {
        font-size: 11px;
        padding: 6px 8px;
    }

    .ta-popup-newsletter {
        margin-top: 8px;
        padding-top: 12px;
    }

    .ta-nl-title {
        font-size: 14px;
    }

    .ta-nl-desc {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .ta-nl-form {
        gap: 8px;
    }

    .ta-nl-field input[type="email"] {
        padding: 10px 12px;
        font-size: 16px; /* prevents iOS zoom */
    }

    .ta-nl-submit {
        padding: 12px 16px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    #ta-popup-overlay {
        padding: 0;
    }

    #ta-popup-box {
        border-radius: 0;
        max-height: 100dvh;
    }

    .ta-popup-logo {
        width: 36px; height: 36px;
    }

    .ta-popup-logo svg {
        width: 26px; height: 26px;
    }

    .ta-popup-headline h2 {
        font-size: 15px;
    }

    .ta-popup-subtitle {
        font-size: 12px;
        padding: 8px 10px;
    }

    .ta-btn {
        padding: 11px 14px;
        font-size: 13px;
    }
}

/* ─── Closing animation ─── */
#ta-popup-overlay.ta-popup-closing {
    opacity: 0;
}

#ta-popup-overlay.ta-popup-closing #ta-popup-box {
    transform: translateY(16px) scale(0.95);
}