/**
 * Homecare Business — full-page loader
 * Covers viewport, blocks scroll, hides when page is fully ready.
 */

:root {
    --hc-loader-z: 999999;
    --hc-loader-bg: #ffffff;
    --hc-loader-teal: #40E0D0;
    --hc-loader-gold: #B59B66;
    --hc-loader-text: #344767;
    --hc-loader-muted: #67748e;
}

html.page-loading,
html.page-loading body {
    overflow: hidden !important;
    height: 100%;
    touch-action: none;
    overscroll-behavior: none;
}

#hc-page-loader {
    position: fixed;
    inset: 0;
    z-index: var(--hc-loader-z);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--hc-loader-bg);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
}

#hc-page-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#hc-page-loader .hc-loader-backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(64, 224, 208, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(181, 155, 102, 0.1) 0%, transparent 65%),
        var(--hc-loader-bg);
}

#hc-page-loader .hc-loader-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    text-align: center;
}

#hc-page-loader .hc-loader-logo-wrap {
    position: relative;
    width: 148px;
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#hc-page-loader .hc-loader-logo {
    width: 110px;
    height: auto;
    max-height: 110px;
    object-fit: contain;
    position: relative;
    z-index: 2;
    animation: hc-loader-logo-pulse 2s ease-in-out infinite;
}

#hc-page-loader .hc-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--hc-loader-teal) 0deg,
        var(--hc-loader-gold) 120deg,
        rgba(64, 224, 208, 0.15) 240deg,
        var(--hc-loader-teal) 360deg
    );
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
    animation: hc-loader-spin 1.1s linear infinite;
}

#hc-page-loader .hc-loader-ring::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    background: var(--hc-loader-bg);
    box-shadow: inset 0 0 24px rgba(64, 224, 208, 0.08);
}

@keyframes hc-loader-spin {
    to { transform: rotate(360deg); }
}

@keyframes hc-loader-logo-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.04); opacity: 0.92; }
}

@media (prefers-reduced-motion: reduce) {
    #hc-page-loader .hc-loader-ring,
    #hc-page-loader .hc-loader-logo {
        animation: none;
    }

    #hc-page-loader {
        transition-duration: 0.15s;
    }
}
