/* ========================================
   PAW LOADER
   ========================================
   The app's "one moment" graphic: four paw prints step across, one after
   another, like a dog walking by, with a short line under them.
     <div class="pis-paw-loader" role="status">
       <span class="pis-paw-trail" aria-hidden="true">(4 x <svg class="pis-paw">)</span>
       <span class="pis-paw-label">Loading Your Booking</span>
     </div>
   With Reduce Motion on, the paws stand still and gently fade together. */

.pis-paw-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 28px 16px;
    color: #5b6b78;
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
    text-align: center;
}

.pis-paw-trail {
    position: relative;
    display: block;
    width: 128px;
    height: 52px;
}

.pis-paw {
    position: absolute;
    width: 30px;
    height: 30px;
    opacity: 0;
    color: #f39c34;
    animation: pis-paw-step 1.8s ease-out infinite;
}

.pis-paw path,
.pis-paw ellipse {
    fill: currentColor;
}

/* left, right, left, right: toes point the way the dog walks */
.pis-paw:nth-child(1) { left: 0;     top: 20px; transform: rotate(90deg); animation-delay: 0s; }
.pis-paw:nth-child(2) { left: 32px;  top: 2px;  transform: rotate(90deg); animation-delay: .22s; }
.pis-paw:nth-child(3) { left: 64px;  top: 20px; transform: rotate(90deg); animation-delay: .44s; }
.pis-paw:nth-child(4) { left: 96px;  top: 2px;  transform: rotate(90deg); animation-delay: .66s; }

@keyframes pis-paw-step {
    0%   { opacity: 0; scale: .55; }
    10%  { opacity: 1; scale: 1.08; }
    16%  { opacity: 1; scale: 1; }
    58%  { opacity: 1; scale: 1; }
    78%, 100% { opacity: 0; scale: 1; }
}

.pis-paw-label {
    display: block;
    max-width: 260px;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .pis-paw {
        animation: pis-paw-still 2.4s ease-in-out infinite;
        animation-delay: 0s !important;
    }

    @keyframes pis-paw-still {
        0%, 100% { opacity: .9; }
        50% { opacity: .45; }
    }
}

/* ========================================
   CHECKOUT: one loader, then everything at once
   ======================================== */
/* The booking and the ways to pay stay hidden (but laid out, so the pay
   buttons can get ready) until all of it is there, then appear together. */
.payment-layout { position: relative; }
.pis-checkout-wait .payment-layout > * { visibility: hidden; }
.pis-checkout-wait .payment-layout > .pis-checkout-loader { visibility: visible; }
.pis-checkout-loader {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2;
    padding-top: 110px;
}
.pis-checkout-loader[hidden] { display: none; }
.pis-checkout-shown .payment-layout > *:not(.pis-checkout-loader) {
    animation: pis-checkout-in .28s ease-out both;
}
@keyframes pis-checkout-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .pis-checkout-shown .payment-layout > *:not(.pis-checkout-loader) { animation: none; }
}

/* ========================================
   APP OPENING (dashboard.html)
   ======================================== */
/* Opening the app with its saved copy: a plain white screen (like the phone's own launch
   screen) stays up until Home is complete, then lifts, so nothing fills in while you watch.
   If that takes a moment, the logo shows. Never more than about 2.5 s. */
html.pis-launch-cover::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: #fff;
    transition: opacity .2s ease;
}
html.pis-launch-cover::before {
    content: "";
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 2147483001;
    width: 112px;
    height: 112px;
    margin: -56px 0 0 -56px;
    border-radius: 26px;
    background: url("/portal/assets/pwa-icon-512.png") center / cover no-repeat;
    opacity: 0;
    animation: pis-launch-logo .3s ease .8s forwards;
    transition: opacity .2s ease;
}
html.pis-launch-cover.pis-launch-out::after,
html.pis-launch-cover.pis-launch-out::before {
    opacity: 0;
    animation: none;
}
@keyframes pis-launch-logo { to { opacity: 1; } }

/* The intro video plays clean; the paws only show if it ends before the portal is ready. */
.mobile-portal-intro-loading { opacity: 0; transition: opacity .3s ease; }
.mobile-portal-intro.is-waiting .mobile-portal-intro-loading { opacity: 1; }
.mobile-portal-intro-loading .pis-paw { color: #fff; }

/* The loading screen (when there's no intro) and the wait after Edit Booking */
#loading .pis-paw-trail { margin: 4px 0; }
.pis-cp-wait .pis-paw-trail { margin-bottom: 2px; }

/* ========================================
   VISIT SCREEN: one loader, then the whole screen at once (visit-ready.js)
   ======================================== */
.client-portal-page .csd-overlay.pis-vs-wait .csd-body { opacity: 0 !important; pointer-events: none !important; }
.pis-vs-loader {
    position: fixed;
    left: 0;
    right: 0;
    top: 32%;
    z-index: 3;
    pointer-events: none;
}
.pis-vs-loader .pis-paw { color: var(--pis-paw-color, #f39c34); }
.client-portal-page .csd-overlay.pis-vs-in .csd-body > * { animation: pis-checkout-in .26s ease-out both; }
@media (prefers-reduced-motion: reduce) {
    .client-portal-page .csd-overlay.pis-vs-in .csd-body > * { animation: none; }
}

/* ========================================
   UPDATES WITH PHOTOS: the paws, then everything at once (photos-ready.js)
   ======================================== */
/* Boarding and sit updates: the content is laid out but not shown while the paws walk over it. */
.pis-pr-wait { position: relative; min-height: min(52dvh, 420px); }
.pis-pr-wait.pis-pr-small { min-height: 150px; }
.pis-pr-wait > :not(.pis-pr-loader) { opacity: 0 !important; pointer-events: none !important; }
.pis-pr-loader { position: absolute; left: 0; right: 0; top: 0; height: min(52dvh, 420px); z-index: 3; pointer-events: none; }
.pis-pr-small > .pis-pr-loader { height: 150px; padding: 12px 16px; }
.pis-pr-loader .pis-paw { color: var(--pis-paw-color, #f39c34); }
/* the sheet opens at its full height (it doesn't grow behind the paws) */
.boarding-viewer-dialog:has(.pis-pr-wait),
.client-boarding-dialog:has(> .client-boarding-dialog-body.pis-pr-wait) { height: 88dvh; }
.pis-pr-in > :not(.pis-pr-loader) { animation: pis-checkout-in .26s ease-out both; }
@media (prefers-reduced-motion: reduce) {
    .pis-pr-in > * { animation: none; }
}
