/* Install invitation card + Add-to-Home-Screen guide modal.
   Shared by customer and professional aramGold panels; accent colour comes from
   the theme colour configured in admin settings. */

.webapp-install {
    --webapp-install-accent: #e3a102;

    position: fixed;
    z-index: 1080;
    inset-inline: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: 460px;
    margin-inline: auto;
    padding: 16px;
    border-radius: 16px;
    background: #1e1e2d;
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .45);
    border: 1px solid rgba(255, 255, 255, .08);
    direction: rtl;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .25s ease, transform .25s ease;
}

.webapp-install.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.webapp-install__header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.webapp-install__icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: contain;
    background: rgba(255, 255, 255, .06);
    padding: 4px;
}

.webapp-install__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
}

.webapp-install__text {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.9;
    color: rgba(255, 255, 255, .72);
}

.webapp-install__actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.webapp-install__button {
    flex: 1 1 auto;
    padding: 10px 14px;
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.webapp-install__button--install {
    background: var(--webapp-install-accent);
    color: #1e1e2d;
}

.webapp-install__button--guide {
    font-size: 13px;
    line-height: 1.5;
}

.webapp-install__button--dismiss {
    flex: 0 0 auto;
    background: transparent;
    color: rgba(255, 255, 255, .6);
}

.webapp-install__button--dismiss:hover {
    color: #ffffff;
}

/* ── Guide modal ── */

html.webapp-install-guide-open,
html.webapp-install-guide-open body {
    overflow: hidden;
}

.webapp-install-guide {
    --webapp-install-accent: #e91e8c;

    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: rgba(15, 16, 24, .55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    direction: rtl;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

.webapp-install-guide.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.webapp-install-guide__panel {
    width: min(100%, 420px);
    max-height: min(86vh, 640px);
    overflow: auto;
    padding: 28px 22px 22px;
    border-radius: 28px;
    background: #ffffff;
    color: #1b1b1f;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    transform: translateY(28px);
    transition: transform .28s ease;
}

.webapp-install-guide.is-open .webapp-install-guide__panel {
    transform: translateY(0);
}

.webapp-install-guide__title {
    margin: 0 0 22px;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.5;
    color: #151521;
}

.webapp-install-guide__steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 18px;
}

.webapp-install-guide__step {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    align-items: start;
}

.webapp-install-guide__index {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(233, 30, 140, .1);
    color: var(--webapp-install-accent);
    font-size: 13px;
    font-weight: 800;
}

.webapp-install-guide__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 44px;
}

.webapp-install-guide__text {
    margin: 0;
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.9;
    color: #3f4254;
}

.webapp-install-guide__visual {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
}

.webapp-install-guide__visual svg {
    width: 28px;
    height: 28px;
}

.webapp-install-guide__visual--share {
    color: #0a84ff;
}

.webapp-install-guide__visual--plus,
.webapp-install-guide__visual--menu {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #2c2c2e;
    color: #f2f2f7;
}

.webapp-install-guide__visual--plus svg,
.webapp-install-guide__visual--menu svg {
    width: 22px;
    height: 22px;
}

.webapp-install-guide__visual--add {
    min-width: auto;
    padding: 0 4px;
    color: #0a84ff;
    font-size: 20px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: .2px;
}

.webapp-install-guide__confirm {
    display: block;
    width: 100%;
    margin-top: 26px;
    padding: 14px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--webapp-install-accent);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--webapp-install-accent) 35%, transparent);
}

.webapp-install-guide__confirm:active {
    transform: scale(.98);
}

@media (min-width: 640px) {
    .webapp-install-guide {
        align-items: center;
    }

    .webapp-install-guide__panel {
        border-radius: 24px;
        transform: translateY(16px) scale(.98);
    }

    .webapp-install-guide.is-open .webapp-install-guide__panel {
        transform: translateY(0) scale(1);
    }
}

@media (prefers-color-scheme: light) {
    .webapp-install {
        background: #ffffff;
        color: #181c32;
        border-color: rgba(0, 0, 0, .06);
        box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
    }

    .webapp-install__icon {
        background: rgba(0, 0, 0, .04);
    }

    .webapp-install__text {
        color: rgba(24, 28, 50, .68);
    }

    .webapp-install__button--dismiss {
        color: rgba(24, 28, 50, .6);
    }

    .webapp-install__button--dismiss:hover {
        color: #181c32;
    }
}
