.app-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.app-popup-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.app-popup-container {
    position: fixed;
    z-index: 99999;
    box-sizing: border-box;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.app-popup-container.layout-modal_center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: calc(100% - 2rem);
    max-width: 430px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-popup-container.layout-modal_center.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.app-popup-container.layout-slide_in_bottom_right {
    bottom: 1.5rem;
    right: 1.5rem;
    transform: translateY(120%);
    width: calc(100% - 2rem);
    max-width: 380px;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-popup-container.layout-slide_in_bottom_left {
    bottom: 1.5rem;
    left: 1.5rem;
    transform: translateY(120%);
    width: calc(100% - 2rem);
    max-width: 380px;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-popup-container.layout-slide_in_bottom_right.active,
.app-popup-container.layout-slide_in_bottom_left.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

@media (max-width: 640px) {
    .app-popup-container.layout-modal_center,
    .app-popup-container.layout-slide_in_bottom_right,
    .app-popup-container.layout-slide_in_bottom_left {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        transform: translateY(100%);
        border-radius: 1.5rem 1.5rem 0 0;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .app-popup-container.layout-modal_center.active,
    .app-popup-container.layout-slide_in_bottom_right.active,
    .app-popup-container.layout-slide_in_bottom_left.active {
        transform: translateY(0);
        pointer-events: auto;
    }

    .app-popup-card {
        border-radius: 1.5rem 1.5rem 0 0 !important;
        max-height: 88vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 1.25rem 1.5rem calc(1.5rem + env(safe-area-inset-bottom, 16px)) !important;
    }

    .app-popup-drag-bar {
        display: block !important;
    }
}

.app-popup-drag-bar {
    display: none;
    width: 40px;
    height: 4px;
    background: #cbd5e1;
    border-radius: 999px;
    margin: -0.25rem auto 1.25rem auto;
}

.app-popup-card {
    background: #ffffff;
    border-radius: 1.35rem;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15), 0 0 1px 1px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    padding: 2rem 1.85rem;
}

.app-popup-close-btn {
    position: absolute;
    top: 1.15rem;
    right: 1.15rem;
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    z-index: 10;
    transition: all 0.2s ease;
}

.app-popup-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.app-popup-image-wrap {
    width: 100%;
    border-radius: 0.85rem;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.app-popup-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.app-popup-header {
    text-align: center;
    margin-bottom: 1.35rem;
    padding: 0 0.5rem;
}

.app-popup-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    line-height: 1.35;
    margin: 0 0 0.5rem 0;
    color: #0f172a;
}

.app-popup-subtitle {
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.5;
    color: #64748b;
    margin: 0;
}

.app-popup-campaign-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    background: rgba(124, 58, 237, 0.08);
    color: var(--primary-color, #7c3aed);
    border-radius: 999px;
    font-size: 0.725rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
}

.app-popup-form {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.app-popup-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 400;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0.75rem;
    color: #1e293b;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.app-popup-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.app-popup-input:focus {
    background: #ffffff;
    border-color: var(--primary-color, #7c3aed);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.app-popup-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    text-decoration: none;
    display: block;
    box-shadow: 0 4px 8px -2px rgba(124, 58, 237, 0.25);
    transition: all 0.2s ease;
    user-select: none;
    margin-top: 0.25rem;
}

.app-popup-btn:hover {
    opacity: 0.94;
    transform: translateY(-1px);
}

.app-popup-btn:active {
    transform: translateY(0) scale(0.99);
}

.app-popup-success-box {
    text-align: center;
    padding: 1rem 0.5rem;
}

.app-popup-success-icon {
    width: 48px;
    height: 48px;
    background: #ecfdf5;
    color: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.85rem auto;
}

.app-popup-coupon-code-box {
    background: #f8fafc;
    border: 1.5px dashed #cbd5e1;
    border-radius: 0.65rem;
    padding: 0.65rem 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    font-family: monospace;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
    cursor: pointer;
    transition: all 0.2s;
}

.app-popup-coupon-code-box:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}