/**
 * Maeve PWA install experience
 *
 * Responsabilità: presentazione della finestra di installazione PWA.
 * Dipende da: componenti account generici di app.html.
 * Usato da: maeve-pwa.js.
 */

.pwa-install-modal {
    max-width: 520px;
}

.pwa-install-intro {
    margin: 0 0 17px;
    color: var(--dark);
    font-size: .92rem;
    line-height: 1.6;
}

.pwa-installed-state {
    display: none;
    padding: 18px;
    border: 1px solid #a7f3d0;
    border-radius: 14px;
    color: #065f46;
    background: #ecfdf5;
    text-align: center;
}

.pwa-installed-state.visible {
    display: block;
}

.pwa-installed-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 10px;
    border-radius: 15px;
    color: #fff;
    background: #059669;
    font-size: 22px;
}

.pwa-installed-state b {
    display: block;
    margin-bottom: 4px;
    font-size: 1rem;
}

.pwa-platform-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
    padding: 4px;
    border: 1px solid #e3e4e8;
    border-radius: 13px;
    background: #f3f4f6;
}

.pwa-platform-picker button {
    min-height: 42px;
    border: 0;
    border-radius: 10px;
    color: #6b7280;
    background: transparent;
    font: inherit;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
}

.pwa-platform-picker button.active {
    color: #6d28d9;
    background: #fff;
    box-shadow: 0 2px 9px rgba(24,24,27,.08);
}

.pwa-platform-panel {
    display: none;
}

.pwa-platform-panel.active {
    display: block;
}

.pwa-device-card {
    padding: 17px;
    border: 1px solid #e3e4e8;
    border-radius: 15px;
    background: #f9fafb;
}

.pwa-device-title {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 7px;
    color: #18181b;
    font-size: .96rem;
    font-weight: 700;
}

.pwa-device-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 11px;
    color: #6d28d9;
    background: #f1ebff;
}

.pwa-device-icon svg {
    width: 20px;
    height: 20px;
}

.pwa-device-note {
    margin: 0 0 14px;
    color: #6b7280;
    font-size: .8rem;
    line-height: 1.55;
}

.pwa-native-install {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(145deg, #7c3aed, #6d28d9);
    box-shadow: 0 8px 18px rgba(109,40,217,.22);
    font: inherit;
    font-size: .93rem;
    font-weight: 700;
    cursor: pointer;
}

.pwa-native-install:disabled {
    opacity: .6;
    cursor: default;
}

.pwa-install-feedback {
    min-height: 19px;
    margin: 8px 0 0;
    color: #6b7280;
    font-size: .76rem;
    line-height: 1.45;
    text-align: center;
}

.pwa-manual-title {
    margin: 15px 0 8px;
    color: #52525b;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pwa-steps {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pwa-step {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    color: #3f3f46;
    font-size: .84rem;
    line-height: 1.55;
}

.pwa-step-number {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #6d28d9;
    background: #f1ebff;
    font-size: .76rem;
    font-weight: 800;
}

.pwa-share-symbol {
    display: inline-grid;
    place-items: center;
    min-width: 24px;
    height: 24px;
    padding: 0 4px;
    border: 1px solid #d4d4d8;
    border-radius: 6px;
    color: #2563eb;
    background: #fff;
    font-weight: 700;
}

.pwa-install-link {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e3e4e8;
}

.pwa-install-link label {
    display: block;
    margin-bottom: 7px;
    color: #6b7280;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.pwa-install-link-row {
    display: flex;
    gap: 7px;
}

.pwa-install-link-row input {
    min-width: 0;
    flex: 1;
    padding: 10px 11px;
    border: 1px solid #d4d4d8;
    border-radius: 9px;
    color: #3f3f46;
    background: #fff;
    font: inherit;
    font-size: .8rem;
}

.pwa-copy-button {
    flex: none;
    padding: 9px 13px;
    border: 1px solid #d4d4d8;
    border-radius: 9px;
    color: #3f3f46;
    background: #fff;
    font: inherit;
    font-size: .8rem;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 680px) {
    .pwa-install-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .pwa-install-modal {
        width: 100%;
        max-width: none;
        max-height: min(91dvh, 760px);
        border-radius: 22px 22px 0 0;
    }

    .pwa-install-modal .acct-mh {
        padding-top: 18px;
    }

    .pwa-install-modal .acct-mb {
        padding-bottom: calc(22px + env(safe-area-inset-bottom));
    }
}
