/*
 * FMMSC Member PWA shell v1.1
 * - dedicated member-only header
 * - fixed four-item bottom navigation
 * - no public-site footer/header inside /ruang-member*
 */

.member-pwa-context {
    --member-app-bg: #07182d;
    --member-app-bg-deep: #03101f;
    --member-app-surface: #0b213a;
    --member-app-line: rgba(255, 255, 255, .12);
    --member-app-text: #f7f9fc;
    --member-app-muted: rgba(247, 249, 252, .62);
    --member-app-gold: #e6ad27;
    --member-app-nav-height: 72px;
    min-height: 100vh;
    min-height: 100dvh;
}

.member-pwa-context main {
    padding-bottom: calc(var(--member-app-nav-height) + 30px + env(safe-area-inset-bottom));
}

/* -------------------------------------------------------------------------
   Member-only app header
   ------------------------------------------------------------------------- */
.member-app-header {
    position: sticky;
    z-index: 1050;
    top: 0;
    border-bottom: 1px solid var(--member-app-line);
    background: rgba(3, 16, 31, .96);
    color: var(--member-app-text);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.member-app-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100%, 1180px);
    min-height: 78px;
    margin: 0 auto;
    padding: 10px max(18px, env(safe-area-inset-right)) 10px max(18px, env(safe-area-inset-left));
}

.member-app-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.member-app-brand img {
    display: block;
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    object-fit: contain;
}

.member-app-brand__copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.member-app-brand__copy strong {
    overflow: hidden;
    font-size: 1.02rem;
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-app-brand__copy span {
    color: var(--member-app-gold);
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.member-app-header__profile {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 1px solid var(--member-app-line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .045);
    color: var(--member-app-text);
    text-decoration: none;
}

.member-app-header__profile.is-active {
    border-color: rgba(230, 173, 39, .55);
    background: rgba(230, 173, 39, .12);
    color: var(--member-app-gold);
}

.member-app-header__profile svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

/* -------------------------------------------------------------------------
   Fixed member shortcuts
   ------------------------------------------------------------------------- */
.member-app-bottom-nav {
    position: fixed;
    z-index: 1120;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid rgba(255, 255, 255, .1);
    background: rgba(3, 16, 31, .97);
    box-shadow: 0 -10px 34px rgba(0, 0, 0, .22);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.member-app-bottom-nav__inner {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: min(100%, 680px);
    min-height: 58px;
    margin: 0 auto;
    gap: 4px;
}

.member-app-bottom-nav__item {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    min-width: 0;
    gap: 3px;
    border-radius: 14px;
    color: rgba(247, 249, 252, .58);
    font-size: .68rem;
    font-weight: 780;
    line-height: 1;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.member-app-bottom-nav__item::before {
    position: absolute;
    top: -7px;
    left: 50%;
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: transparent;
    content: '';
    transform: translateX(-50%);
}

.member-app-bottom-nav__item svg {
    width: 23px;
    height: 23px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.75;
}

.member-app-bottom-nav__item.is-active {
    background: rgba(230, 173, 39, .08);
    color: var(--member-app-gold);
}

.member-app-bottom-nav__item.is-active::before {
    background: var(--member-app-gold);
}

/* -------------------------------------------------------------------------
   Install UI
   ------------------------------------------------------------------------- */
.member-pwa-install[hidden],
.member-pwa-ios-help[hidden] {
    display: none !important;
}

.member-pwa-install {
    position: fixed;
    z-index: 1200;
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(var(--member-app-nav-height) + 24px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    gap: 11px;
    align-items: center;
    max-width: 620px;
    margin: 0 auto;
    padding: 11px 11px 11px 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 20px;
    background: rgba(7, 24, 45, .97);
    color: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .32);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.member-pwa-install__icon img {
    display: block;
    width: 46px;
    height: 46px;
    border-radius: 13px;
}

.member-pwa-install__copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.member-pwa-install__copy strong {
    font-size: .94rem;
    line-height: 1.2;
}

.member-pwa-install__copy span {
    overflow: hidden;
    color: rgba(255, 255, 255, .7);
    font-size: .78rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-pwa-install__action,
.member-pwa-ios-help__done {
    border: 0;
    border-radius: 999px;
    padding: 10px 14px;
    background: #fff;
    color: #07182d;
    font: inherit;
    font-size: .82rem;
    font-weight: 850;
    cursor: pointer;
}

.member-pwa-install__dismiss,
.member-pwa-ios-help__close {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .78);
    font: inherit;
    font-size: 20px;
    cursor: pointer;
}

.member-pwa-ios-help {
    position: fixed;
    z-index: 1300;
    inset: 0;
    display: grid;
    place-items: end center;
    padding: 16px;
}

.member-pwa-ios-help__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 0, 0, .64);
}

.member-pwa-ios-help__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 460px);
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 26px;
    background: #07182d;
    color: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
}

.member-pwa-ios-help__panel > img {
    display: block;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    border-radius: 18px;
}

.member-pwa-ios-help__eyebrow {
    margin: 0 0 7px;
    color: rgba(255, 255, 255, .58);
    font-size: .72rem;
    font-weight: 850;
    letter-spacing: .14em;
}

.member-pwa-ios-help h2 {
    margin: 0 0 10px;
    font-size: 1.45rem;
}

.member-pwa-ios-help p:not(.member-pwa-ios-help__eyebrow) {
    margin: 0 0 20px;
    color: rgba(255, 255, 255, .76);
    line-height: 1.55;
}

.member-pwa-ios-help__close {
    position: absolute;
    top: 14px;
    right: 14px;
}

.member-pwa-context.member-pwa-standalone .member-app-header {
    padding-top: env(safe-area-inset-top);
}

@media (max-width: 560px) {
    .member-app-header__inner {
        min-height: 72px;
    }

    .member-app-brand img {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .member-app-brand__copy strong {
        font-size: .98rem;
    }

    .member-pwa-install {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .member-pwa-install__dismiss {
        position: absolute;
        top: -9px;
        right: -4px;
        width: 27px;
        height: 27px;
        border: 1px solid rgba(255, 255, 255, .1);
        background: #132942;
        font-size: 16px;
    }

    .member-pwa-install__copy span {
        max-width: 44vw;
    }
}
