/* pwa.css — installatie-pop-up, meldingenvraag, toast, bel in de kopbalk
   en de meldingenpagina. Los van style.css zodat die niet hoeft te wijzigen. */

/* ---------- Bel in de kopbalk ---------- */
.kopbalk-bel {
    position: relative;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 12px;
    color: #cfe9fb;
    text-decoration: none;
    border: 1px solid rgba(148, 207, 255, .14);
    background: rgba(56, 189, 248, .06);
}
.kopbalk-bel svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kopbalk-bel:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }
.kopbalk-bel-teller {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #f87171;
    color: #fff;
    font-size: .66rem;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #06111f;
}

/* ---------- Blad onderin (installatie + meldingenvraag) ---------- */
.pwa-blad {
    position: fixed;
    left: max(.75rem, env(safe-area-inset-left));
    right: max(.75rem, env(safe-area-inset-right));
    bottom: calc(var(--nav-hoogte, 62px) + max(.55rem, env(safe-area-inset-bottom)) + .8rem);
    z-index: 11000;
    max-width: 460px;
    margin: 0 auto;
    padding: 1rem 1rem .85rem;
    border-radius: 22px;
    color: #e8f6ff;
    background: linear-gradient(150deg, rgba(20, 58, 92, .97), rgba(7, 26, 45, .97));
    border: 1px solid rgba(125, 211, 252, .26);
    box-shadow: 0 22px 60px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .07);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    backdrop-filter: blur(20px) saturate(150%);
    transform: translateY(16px);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
    max-height: calc(100vh - var(--nav-hoogte, 62px) - 5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
}
.pwa-blad.zichtbaar { transform: none; opacity: 1; }
body:not(:has(.bottomnav)) .pwa-blad { bottom: max(1rem, env(safe-area-inset-bottom)); }

.pwa-blad-sluit {
    position: absolute;
    top: .45rem;
    right: .45rem;
    width: 36px;
    min-height: 36px;
    height: 36px;
    padding: 0;
    border-radius: 12px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #9fbdd3;
    font-size: 1.45rem;
    line-height: 1;
    cursor: pointer;
}
.pwa-blad-kop { display: flex; gap: .8rem; align-items: flex-start; padding-right: 1.6rem; }
.pwa-blad-icoon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    box-shadow: 0 8px 20px rgba(14, 165, 233, .3);
}
.pwa-blad-icoon img { display: block; width: 44px; height: 44px; }
.pwa-blad-icoon svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pwa-blad-push .pwa-blad-icoon svg { animation: pwa-bel 2.4s ease-in-out 1s 2; transform-origin: 50% 20%; }
@keyframes pwa-bel { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20%, 40% { transform: rotate(-14deg); } }
.pwa-blad-titel { margin: .05rem 0 .25rem; font-size: 1rem; line-height: 1.25; letter-spacing: -.015em; }
.pwa-blad-tekst { margin: 0; color: #a9c4d8; font-size: .84rem; line-height: 1.5; }
.pwa-blad-uitleg { margin: .2rem 0 .6rem; color: #cfe6f5; font-size: .84rem; line-height: 1.5; }

.pwa-stappen-houder { margin-top: .8rem; }
.pwa-stappen {
    counter-reset: pwa-stap;
    list-style: none;
    margin: 0;
    padding: .7rem .75rem;
    border-radius: 16px;
    background: rgba(3, 17, 31, .5);
    border: 1px solid rgba(148, 207, 255, .14);
}
.pwa-stappen li {
    counter-increment: pwa-stap;
    position: relative;
    padding: .38rem 0 .38rem 2.1rem;
    font-size: .86rem;
    line-height: 1.55;
    color: #dff1fc;
}
.pwa-stappen li::before {
    content: counter(pwa-stap);
    position: absolute;
    left: 0;
    top: .38rem;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    background: rgba(56, 189, 248, .18);
    color: #7dd3fc;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.45rem;
    text-align: center;
}
.pwa-stappen strong { color: #fff; }
.pwa-inline-icoon {
    display: inline-block;
    width: 1.25em;
    height: 1.25em;
    margin: 0 .1em;
    vertical-align: -.25em;
    fill: none;
    stroke: #7dd3fc;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.pwa-inline-woord {
    display: inline-block;
    min-width: 1.5em;
    padding: 0 .3em;
    border-radius: 6px;
    background: rgba(125, 211, 252, .14);
    color: #7dd3fc;
    font-weight: 800;
    text-align: center;
    line-height: 1.35;
}

.pwa-blad-acties { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .9rem; }
.pwa-blad-acties > :only-child { grid-column: 1 / -1; }
.pwa-knop {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: .55rem .8rem;
    border-radius: 14px;
    border: 1px solid rgba(125, 211, 252, .22);
    background: rgba(56, 189, 248, .08);
    box-shadow: none;
    color: #dff5ff;
    font: inherit;
    font-size: .88rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
.pwa-knop-hoofd { border-color: transparent; background: linear-gradient(135deg, #38bdf8, #2563eb); color: #fff; box-shadow: 0 10px 24px rgba(14, 165, 233, .25); }
.pwa-knop:disabled { opacity: .7; }
.pwa-knop:focus-visible, .pwa-blad-sluit:focus-visible, .pwa-blad-voet:focus-visible { outline: 2px solid #7dd3fc; outline-offset: 2px; }
.pwa-stappen-box .pwa-knop { margin-top: .2rem; }
.pwa-blad-voet {
    display: block;
    width: 100%;
    min-height: 36px;
    margin: .45rem 0 0;
    padding: .3rem;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #8fb1cc;
    font: inherit;
    font-size: .78rem;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

/* ---------- Toast ---------- */
.pwa-toast {
    position: fixed;
    left: 50%;
    top: calc(env(safe-area-inset-top) + .8rem);
    z-index: 13000;
    width: min(440px, calc(100% - 1.5rem));
    padding: .8rem 1rem;
    border-radius: 16px;
    color: #eaf8ff;
    font-size: .88rem;
    line-height: 1.45;
    background: rgba(8, 35, 59, .96);
    border: 1px solid rgba(125, 211, 252, .28);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
    transform: translate(-50%, -12px);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
}
.pwa-toast.zichtbaar { transform: translate(-50%, 0); opacity: 1; }
.pwa-toast-goed { border-color: rgba(52, 211, 153, .45); }
.pwa-toast-fout { border-color: rgba(248, 113, 113, .5); }

@media (prefers-reduced-motion: reduce) {
    .pwa-blad, .pwa-toast { transition: none; }
    .pwa-blad-push .pwa-blad-icoon svg { animation: none; }
}

/* ---------- Meldingenpagina ---------- */
.mp-status { display: flex; gap: .75rem; align-items: flex-start; margin: 0 0 .9rem; }
.mp-status-stip { flex: 0 0 12px; width: 12px; height: 12px; margin-top: .4rem; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 4px rgba(100, 116, 139, .18); }
.mp-status[data-status="aan"] .mp-status-stip { background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, .18); }
.mp-status[data-status="geblokkeerd"] .mp-status-stip,
.mp-status[data-status="niet"] .mp-status-stip { background: #f87171; box-shadow: 0 0 0 4px rgba(248, 113, 113, .18); }
.mp-status[data-status="ios_installeer"] .mp-status-stip,
.mp-status[data-status="uit"] .mp-status-stip { background: #f5a623; box-shadow: 0 0 0 4px rgba(245, 166, 35, .18); }
.mp-status p { margin: 0; line-height: 1.5; }
.mp-knoppen { display: flex; flex-wrap: wrap; gap: .55rem; }
.mp-knoppen button, .mp-knoppen .knop { width: auto; margin: 0; }
.mp-knoppen [hidden] { display: none !important; }
.mp-groep { margin: 1.1rem 0 .5rem; color: #7dd3fc; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.mp-groep:first-of-type { margin-top: .4rem; }
.mp-tijden { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin: -.2rem 0 1rem; }
.mp-tijden label { display: grid; gap: .3rem; font-size: .8rem; color: #9eb7cc; }
.mp-lijst { list-style: none; margin: 0; padding: 0; }
.mp-lijst li { border-bottom: 1px solid rgba(148, 207, 255, .12); }
.mp-lijst li:last-child { border-bottom: 0; }
.mp-lijst a { display: block; padding: .75rem .1rem; color: inherit; text-decoration: none; }
.mp-lijst strong { display: block; font-size: .9rem; line-height: 1.35; }
.mp-lijst span { display: block; margin-top: .2rem; color: #a8bfd0; font-size: .8rem; line-height: 1.45; }
.mp-lijst small { display: block; margin-top: .3rem; color: #6f8ca3; font-size: .7rem; }
.mp-lijst li.ongelezen strong::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: .45rem; border-radius: 50%; background: #38bdf8; vertical-align: .1em; }

/* iPhone-app (beginscherm): de statusbalk is doorzichtig. Normaal houdt
   env(safe-area-inset-top) de kopbalk eronder vandaan; valt die op 0 terug,
   dan zorgt het minimum ervoor dat tijd en batterij nooit over de tekst vallen. */
html.pwa-ios-app .kopbalk { padding-top: calc(max(env(safe-area-inset-top), 47px) + .7rem); }
html.pwa-ios-app .kaart-top { padding-top: calc(max(env(safe-area-inset-top), 47px) + .6rem); }
html.pwa-ios-app .pwa-toast { top: calc(max(env(safe-area-inset-top), 47px) + .6rem); }
