/* CRM journey loaders + page splash */

.crm-page-splash {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(247, 227, 161, 0.28), transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(231, 76, 60, 0.16), transparent 45%),
        rgba(47, 67, 88, 0.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.crm-page-splash.is-on {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.crm-page-splash.is-force-hide {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: none !important;
}

.crm-page-splash-inner {
    width: min(100%, 320px);
    text-align: center;
    color: #fff;
    transform: translateY(10px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.crm-page-splash.is-on .crm-page-splash-inner {
    transform: none;
}

.crm-page-splash-title {
    margin: 18px 0 6px;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.crm-page-splash-hint {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.78;
    min-height: 1.3em;
    transition: opacity 0.25s ease;
}

.crm-page-splash-hint.is-swap {
    opacity: 0;
}

.crm-page-splash .crm-journey-orb {
    margin: 0 auto;
    --journey-accent: #f7e3a1;
    --journey-accent-soft: rgba(247, 227, 161, 0.35);
    background: color-mix(in srgb, #2f4358 55%, transparent);
    border-color: rgba(247, 227, 161, 0.35);
    color: #f7e3a1;
}

/* Shared orbit loader */
.crm-journey-orb {
    --journey-accent: var(--crm-coral, #e74c3c);
    --journey-accent-soft: color-mix(in srgb, var(--journey-accent) 28%, transparent);
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--journey-accent) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--journey-accent) 22%, transparent);
    color: var(--journey-accent);
    box-shadow: 0 10px 28px rgba(47, 67, 88, 0.12);
}

.crm-journey-orb > i {
    font-size: 22px;
    animation: crm-journey-icon 1.8s ease-in-out infinite;
    z-index: 1;
}

.crm-journey-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--journey-accent);
    border-right-color: var(--journey-accent-soft);
    animation: crm-journey-spin 1.1s linear infinite;
}

.crm-journey-ring--2 {
    inset: -10px;
    border-top-color: var(--journey-accent-soft);
    border-right-color: transparent;
    border-bottom-color: var(--journey-accent);
    animation-duration: 1.7s;
    animation-direction: reverse;
    opacity: 0.7;
}

@keyframes crm-journey-spin {
    to { transform: rotate(360deg); }
}

@keyframes crm-journey-icon {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    50% { transform: translateY(-2px) scale(1.06); opacity: 0.88; }
}

/* Inline / list loaders */
.crm-journey-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 14px 18px;
    text-align: center;
}

.crm-journey-loader.is-compact {
    padding: 22px 10px;
}

.crm-journey-loader .crm-journey-orb {
    margin-bottom: 4px;
}

.crm-journey-title {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--crm-navy, #2f4358);
}

.crm-journey-hint {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: rgba(47, 67, 88, 0.55);
    min-height: 1.35em;
    transition: opacity 0.25s ease;
}

.crm-journey-hint.is-swap {
    opacity: 0;
}

.crm-journey-dots {
    display: inline-flex;
    gap: 5px;
    margin-top: 2px;
}

.crm-journey-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--crm-coral, #e74c3c);
    opacity: 0.35;
    animation: crm-journey-dot 1.2s ease-in-out infinite;
}

.crm-journey-dots span:nth-child(2) { animation-delay: 0.15s; }
.crm-journey-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes crm-journey-dot {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.3; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* Skeleton cards while list loads */
.crm-journey-skeletons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.crm-journey-skel {
    border-radius: 14px;
    border: 1px solid rgba(47, 67, 88, 0.08);
    background: #fff;
    padding: 14px 14px 14px 18px;
    position: relative;
    overflow: hidden;
    text-align: left;
}

.crm-journey-skel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: color-mix(in srgb, var(--crm-coral, #e74c3c) 35%, #ddd);
}

.crm-journey-skel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        100deg,
        transparent 20%,
        rgba(255, 255, 255, 0.65) 40%,
        transparent 60%
    );
    transform: translateX(-100%);
    animation: crm-journey-shimmer 1.4s ease-in-out infinite;
}

@keyframes crm-journey-shimmer {
    to { transform: translateX(100%); }
}

.crm-journey-skel-line {
    height: 10px;
    border-radius: 999px;
    background: rgba(47, 67, 88, 0.1);
    margin-bottom: 8px;
}

.crm-journey-skel-line--lg {
    width: 62%;
    height: 12px;
}

.crm-journey-skel-line--md {
    width: 44%;
}

.crm-journey-skel-line--sm {
    width: 28%;
    margin-bottom: 0;
}

.crm-journey-skel-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.crm-journey-skel-pill {
    height: 18px;
    width: 64px;
    border-radius: 999px;
    background: rgba(47, 67, 88, 0.08);
}

.crm-journey-skel:nth-child(2) { opacity: 0.88; }
.crm-journey-skel:nth-child(3) { opacity: 0.72; }

/* Soft boot for shell content */
.crm-capture-body.crm-booting .crm-capture-shell {
    opacity: 0;
    transform: translateY(8px);
}

.crm-capture-body.crm-booted .crm-capture-shell {
    opacity: 1;
    transform: none;
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
    .crm-journey-ring,
    .crm-journey-orb > i,
    .crm-journey-dots span,
    .crm-journey-skel::after {
        animation: none !important;
    }

    .crm-capture-pane,
    .crm-page-splash,
    .crm-page-splash-inner,
    .crm-capture-body.crm-booted .crm-capture-shell {
        transition: none !important;
    }
}
