/* ============================================
   Impact PWA — Prompt (desktop + tablet + mobile)
   ============================================ */

/* Overlay */
.impact-pwa-overlay {
    position: fixed;
    inset: 0;
    z-index: 999998;
    background: rgba(0, 0, 0, 0);
    transition: background 0.35s ease;
    pointer-events: none;
}

.impact-pwa-overlay--visible {
    background: rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

/* Prompt container */
.impact-pwa-prompt {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%) scale(0.95);
    width: calc(100% - 40px);
    max-width: 460px;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s ease;
    pointer-events: none;
}

.impact-pwa-prompt--visible {
    transform: translate(-50%, 50%) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.impact-pwa-prompt__inner {
    position: relative;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
                0 4px 16px rgba(0, 0, 0, 0.08);
    padding: 28px;
    overflow: hidden;
}

.impact-pwa-prompt__inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #1a1a2e, #16213e, #0f3460);
}

/* Close button */
.impact-pwa-prompt__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #888;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    padding: 0;
    z-index: 2;
}

.impact-pwa-prompt__close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
}

/* Header with logo */
.impact-pwa-prompt__header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.impact-pwa-prompt__logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.impact-pwa-prompt__header-text {
    flex: 1;
    min-width: 0;
}

.impact-pwa-prompt__title {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
    line-height: 1.3;
}

.impact-pwa-prompt__subtitle {
    font-size: 13px;
    color: #888;
    margin: 2px 0 0;
    font-weight: 500;
}

.impact-pwa-prompt__text {
    font-size: 14px;
    color: #555;
    margin: 0 0 20px;
    line-height: 1.6;
}

/* Features list */
.impact-pwa-prompt__features {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.impact-pwa-prompt__feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.impact-pwa-prompt__feature svg {
    flex-shrink: 0;
    color: #00a32a;
}

/* iOS guide */
.impact-pwa-prompt__ios-guide {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #eef6ff;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #d0e3ff;
}

.impact-pwa-prompt__ios-icon {
    flex-shrink: 0;
    color: #0071e3;
    margin-top: 1px;
}

.impact-pwa-prompt__ios-guide p {
    font-size: 13px;
    color: #333;
    line-height: 1.5;
    margin: 0;
}

.impact-pwa-prompt__ios-guide strong {
    color: #0071e3;
    font-weight: 600;
}

/* Language selector */
.impact-pwa-prompt__lang {
    margin-bottom: 20px;
}

.impact-pwa-prompt__lang label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}

.impact-pwa-prompt__lang select {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    background: #fafafa;
    color: #333;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.impact-pwa-prompt__lang select:focus {
    outline: none;
    border-color: #1a1a2e;
    box-shadow: 0 0 0 3px rgba(26, 26, 46, 0.08);
}

/* Actions */
.impact-pwa-prompt__actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.impact-pwa-prompt__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.2;
}

.impact-pwa-prompt__btn--primary {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
}

.impact-pwa-prompt__btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(26, 26, 46, 0.35);
}

.impact-pwa-prompt__btn--primary:active {
    transform: translateY(0);
}

.impact-pwa-prompt__btn--primary svg {
    flex-shrink: 0;
}

.impact-pwa-prompt__btn--link {
    background: none;
    color: #888;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

.impact-pwa-prompt__btn--link:hover {
    color: #555;
    background: rgba(0, 0, 0, 0.03);
}

/* Toast */
.impact-pwa-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    z-index: 9999999;
    padding: 14px 28px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 600;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s ease;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    max-width: calc(100% - 40px);
}

.impact-pwa-toast--visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.impact-pwa-toast--success {
    background: #00a32a;
    color: #fff;
}

.impact-pwa-toast--error {
    background: #d63638;
    color: #fff;
}

/* ============================================
   Tablet (portrait)
   ============================================ */
@media (min-width: 481px) and (max-width: 1024px) {
    .impact-pwa-prompt {
        max-width: 420px;
    }
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 480px) {
    .impact-pwa-prompt {
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: translateX(0) translateY(100%);
    }

    .impact-pwa-prompt--visible {
        transform: translateX(0) translateY(0);
    }

    .impact-pwa-prompt__inner {
        border-radius: 20px 20px 0 0;
        padding: 24px 20px calc(env(safe-area-inset-bottom, 16px) + 16px);
    }

    .impact-pwa-prompt__logo {
        width: 52px;
        height: 52px;
        border-radius: 12px;
    }

    .impact-pwa-prompt__title {
        font-size: 17px;
    }

    .impact-pwa-prompt__text {
        font-size: 13px;
    }

    .impact-pwa-prompt__btn {
        padding: 14px 20px;
    }
}

/* ============================================
   Desktop: large screens
   ============================================ */
@media (min-width: 1025px) {
    .impact-pwa-prompt {
        max-width: 480px;
    }

    .impact-pwa-prompt__inner {
        padding: 32px;
    }

    .impact-pwa-prompt__logo {
        width: 72px;
        height: 72px;
        border-radius: 16px;
    }

    .impact-pwa-prompt__title {
        font-size: 20px;
    }
}

/* ============================================
   Transition for step change
   ============================================ */
.impact-pwa-prompt__step {
    animation: impactPwaFadeIn 0.3s ease;
}

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