:root {
    --identity-gate-background: #f3f6ff;
    --hcc-loader-track: rgba(79, 70, 229, .15);
    --hcc-loader-brand: #10275d;
    --hcc-loader-label: #4f6084;
}

.dark-mode {
    --hcc-loader-track: rgba(255, 255, 255, .18);
    --hcc-loader-brand: #f8fafc;
    --hcc-loader-label: #dbeafe;
}

hcc-page-loader.page-loader,
.page-loader {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 320px;
    padding: 48px 20px;
    color: var(--hcc-loader-label);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.page-loader[hidden] { display: none !important; }
.page-loader-full { width: 100%; min-height: 100dvh; }
.page-loader-surface { background: var(--identity-gate-background); }
.page-loader-compact { min-height: 190px; padding: 28px 16px; }
.page-loader-table { min-height: 150px; padding: 24px 12px; }

.page-loader-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    margin-bottom: 8px;
}

.page-loader-mark::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid var(--hcc-loader-track);
    border-top-color: #4f46e5;
    border-right-color: #38bdf8;
    border-radius: 50%;
    animation: hcc-loader-spin 1.1s linear infinite;
}

.page-loader-mark span {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    padding: 5px;
    border: 1px solid #edf0f8;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 5px 18px rgba(23, 37, 84, .05);
}

.page-loader-logo { display: block; width: 100%; height: 100%; object-fit: contain; }
.page-loader-brand { margin: 0; color: var(--hcc-loader-brand); font-size: 20px; font-weight: 700; line-height: 1.4; }
.page-loader-label { margin: 0; color: var(--hcc-loader-label); font-size: 14px; line-height: 1.5; }

.hcc-compact-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    box-sizing: border-box;
    border: 2px solid var(--hcc-loader-track);
    border-top-color: #4f46e5;
    border-right-color: #38bdf8;
    border-radius: 50%;
    animation: hcc-loader-spin 1.1s linear infinite;
    vertical-align: -.12em;
}

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

@media (max-width: 760px) {
    hcc-page-loader.page-loader,
    .page-loader { min-height: 260px; padding: 36px 16px; }
    .page-loader-full { min-height: 100dvh; }
    .page-loader-compact,
    .page-loader-table { min-height: 170px; padding: 24px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .page-loader-mark::before,
    .hcc-compact-spinner { animation: none; }
}
