/* ============================================================
   WUTLU — PWA Install Prompt
   ============================================================ */

/* Bannière principale */
.pwa-prompt {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    z-index: 99999;
    width: min(520px, calc(100% - 32px));
    transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .3s;
    opacity: 0;
    pointer-events: none;
}
.pwa-prompt[hidden] { display: none; }
.pwa-prompt.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.pwa-prompt-inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, .22), 0 4px 12px rgba(15, 23, 42, .08);
    overflow: hidden;
}
.pwa-prompt-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #C2410C, #EA580C, #F59E0B);
}

.pwa-prompt-icon {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    color: #C2410C;
    overflow: hidden;
}
.pwa-prompt-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.pwa-prompt-content {
    flex: 1;
    min-width: 0;
}
.pwa-prompt-content strong {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 3px;
}
.pwa-prompt-content p {
    margin: 0;
    font-size: 12.5px;
    color: #64748B;
    line-height: 1.4;
}

.pwa-prompt-actions {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pwa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: 0;
    transition: all .15s;
    white-space: nowrap;
}
.pwa-btn-primary {
    background: #C2410C;
    color: #fff;
}
.pwa-btn-primary:hover { background: #9A3412; }
.pwa-btn-ghost {
    background: transparent;
    color: #64748B;
    font-weight: 600;
    padding: 6px 12px;
    font-size: 12px;
}
.pwa-btn-ghost:hover { color: #334155; }

.pwa-prompt-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: transparent;
    border: 0;
    color: #94A3B8;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    padding: 0;
}
.pwa-prompt-close:hover {
    background: #F1F5F9;
    color: #0F172A;
}

/* Mobile : layout vertical */
@media (max-width: 560px) {
    .pwa-prompt {
        bottom: 12px;
        width: calc(100% - 24px);
    }
    .pwa-prompt-inner {
        flex-direction: column;
        text-align: center;
        padding: 20px 18px 18px;
        gap: 12px;
    }
    .pwa-prompt-icon {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }
    .pwa-prompt-content strong { font-size: 16px; }
    .pwa-prompt-actions {
        flex-direction: row;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    .pwa-btn-primary {
        flex: 1;
        min-width: 140px;
    }
}

/* ============================================================
   Modal iOS avec instructions
   ============================================================ */
.pwa-ios-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: opacity .3s;
}
.pwa-ios-modal[hidden] { display: none; }
.pwa-ios-modal.is-visible { opacity: 1; }

.pwa-ios-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.pwa-ios-panel {
    position: relative;
    background: #fff;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 560px;
    padding: 28px 24px calc(28px + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    max-height: 90vh;
    overflow-y: auto;
}
.pwa-ios-modal.is-visible .pwa-ios-panel {
    transform: translateY(0);
}

.pwa-ios-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #F1F5F9;
    border: 0;
    color: #64748B;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .15s;
    padding: 0;
}
.pwa-ios-close:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.pwa-ios-head {
    text-align: center;
    margin-bottom: 24px;
}
.pwa-ios-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: linear-gradient(135deg, #FFF7ED, #FEF3C7);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 30px;
    color: #C2410C;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(194, 65, 12, .15);
}
.pwa-ios-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}
.pwa-ios-head h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: #0F172A;
}
.pwa-ios-head p {
    margin: 0;
    font-size: 14px;
    color: #64748B;
}

.pwa-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
}
.pwa-ios-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.pwa-ios-step-num {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #C2410C;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pwa-ios-step-text {
    flex: 1;
    font-size: 14.5px;
    color: #334155;
    line-height: 1.5;
    padding-top: 4px;
}
.pwa-ios-step-text strong {
    color: #0F172A;
    font-weight: 700;
}
.pwa-ios-icon-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #DBEAFE;
    color: #1E40AF;
    border-radius: 8px;
    margin-left: 8px;
    vertical-align: middle;
}
.pwa-ios-hint {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: #0F172A;
}
.pwa-ios-hint i {
    color: #1E40AF;
    font-size: 15px;
}

.pwa-ios-confirm {
    width: 100%;
    padding: 14px;
    background: #C2410C;
    color: #fff;
    border: 0;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s;
}
.pwa-ios-confirm:hover { background: #9A3412; }