/* ns-loader.css - styling for ns-loader.js
 *
 * Two levels of feedback: a top progress bar for every request, and a
 * centred card only for the slow ones. Colours follow the brand green used
 * by the Continue button so it reads as part of the page, not a browser
 * artefact.
 */

/* ---------------- top progress bar ---------------- */
.ns-loadbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 2147483600;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
}

.ns-loadbar.is-on {
    opacity: 1;
}

.ns-loadbar > span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6CB545, #9ad06f, #6CB545);
    box-shadow: 0 0 10px rgba(108, 181, 69, .6);
    border-radius: 0 3px 3px 0;
    transition: width .25s ease;
}

/* creep towards 90% - the request decides when it actually finishes */
.ns-loadbar.is-on > span {
    width: 90%;
    transition: width 9s cubic-bezier(.08, .78, .3, 1);
}

.ns-loadbar.is-done > span {
    width: 100%;
    transition: width .2s ease;
}

/* ---------------- centred card (slow requests only) ---------------- */
.ns-loadcard {
    position: fixed;
    inset: 0;
    z-index: 2147483500;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(23, 41, 28, .28);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.ns-loadcard.is-on {
    opacity: 1;
    visibility: visible;
}

.ns-loadcard-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 210px;
    padding: 28px 34px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(16, 38, 22, .22);
    transform: translateY(8px) scale(.97);
    transition: transform .22s cubic-bezier(.2, .8, .3, 1);
}

.ns-loadcard.is-on .ns-loadcard-box {
    transform: none;
}

.ns-loadspin {
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    border: 3.5px solid #e4f0dc;
    border-top-color: #6CB545;
    border-radius: 50%;
    animation: ns-loadspin .7s linear infinite;
}

@keyframes ns-loadspin {
    to { transform: rotate(360deg); }
}

.ns-loadcard-text {
    font-size: 15.5px;
    font-weight: 600;
    color: #1f3326;
}

.ns-loadcard-sub {
    font-size: 13px;
    color: #7b8c80;
}

/* stop background scrolling while the card is up */
html.ns-loading,
html.ns-loading body {
    overflow: hidden;
}

/* ---------------- inline button state ----------------
   Livewire's own wire:loading hooks still work; this just gives any button
   inside a submitting form a sensible disabled look so it cannot be
   double-pressed while the card is up. */
html.ns-loading button[type="submit"],
html.ns-loading .buyer-btn-next,
html.ns-loading .btn-continue {
    pointer-events: none;
    opacity: .75;
}

@media (prefers-reduced-motion: reduce) {
    .ns-loadspin { animation-duration: 1.6s; }
    .ns-loadbar > span,
    .ns-loadcard-box { transition: none; }
}

@media (max-width: 575.98px) {
    .ns-loadcard-box {
        min-width: 0;
        width: min(78vw, 260px);
        padding: 24px 26px;
    }
}
