/**
 * install-pwa — portable PWA install gate / prompt styles
 * Copy this folder into any project and link install-pwa.css + install-pwa.js
 */

.ipwa-root,
.ipwa-root * {
    box-sizing: border-box;
}

/* ─── Gate (full-screen block) ─── */
.ipwa-gate {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 20% 10%, rgba(37, 99, 235, 0.28), transparent 45%),
        radial-gradient(ellipse at 80% 90%, rgba(14, 165, 233, 0.18), transparent 40%),
        linear-gradient(160deg, #0b1220 0%, #111827 45%, #0f172a 100%);
    color: #f8fafc;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.ipwa-gate.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.ipwa-gate[hidden] {
    display: none !important;
}

.ipwa-gate-card {
    width: min(440px, 100%);
    padding: 28px 26px 24px;
    border-radius: 22px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background:
        linear-gradient(155deg, rgba(15, 23, 42, 0.96), rgba(30, 58, 138, 0.88)),
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.2), transparent 46%);
    box-shadow: 0 28px 70px rgba(2, 6, 23, 0.55);
    text-align: center;
}

.ipwa-gate-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 14px 32px rgba(2, 6, 23, 0.4);
    margin: 0 auto 18px;
    display: block;
}

.ipwa-gate-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 8px;
}

.ipwa-gate-title {
    margin: 0 0 10px;
    font-size: 1.35rem;
    line-height: 1.25;
    font-weight: 700;
}

.ipwa-gate-message {
    margin: 0;
    color: rgba(248, 250, 252, 0.84);
    font-size: 0.95rem;
    line-height: 1.55;
}

.ipwa-gate-hint {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.84rem;
    line-height: 1.5;
    color: rgba(248, 250, 252, 0.9);
    text-align: left;
}

.ipwa-gate-hint[hidden] {
    display: none !important;
}

.ipwa-gate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}

.ipwa-btn {
    appearance: none;
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
    box-sizing: border-box;
}

a.ipwa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    text-align: center;
    line-height: 1.3;
}

.ipwa-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

.ipwa-btn-primary {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    color: #fff;
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

.ipwa-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.ipwa-btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.ipwa-btn-ghost:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

/* ─── Prompt (corner toast, dismissible) ─── */
.ipwa-prompt {
    position: fixed;
    inset: auto 20px 20px auto;
    z-index: 2147483000;
    width: min(420px, calc(100vw - 32px));
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: #f8fafc;
    opacity: 0;
    transform: translateY(18px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}

.ipwa-prompt.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ipwa-prompt[hidden] {
    display: none !important;
}

.ipwa-prompt-card {
    position: relative;
    padding: 20px 20px 18px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background:
        linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 58, 138, 0.92)),
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.22), transparent 42%);
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.45);
}

.ipwa-prompt-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.ipwa-prompt-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.ipwa-prompt-brand {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-right: 28px;
    text-align: left;
}

.ipwa-prompt-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.35);
    flex-shrink: 0;
}

.ipwa-prompt-eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 4px;
}

.ipwa-prompt-title {
    margin: 0 0 6px;
    font-size: 1.15rem;
    line-height: 1.2;
}

.ipwa-prompt-desc {
    margin: 0;
    color: rgba(248, 250, 252, 0.82);
    font-size: 0.88rem;
    line-height: 1.55;
}

.ipwa-prompt-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.ipwa-prompt-actions .ipwa-btn {
    flex: 1;
}

.ipwa-prompt-ios {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.82rem;
    line-height: 1.5;
    text-align: left;
}

.ipwa-prompt-ios[hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .ipwa-prompt {
        inset: auto 12px 12px 12px;
        width: auto;
    }

    .ipwa-prompt-actions {
        flex-direction: column;
    }
}
