/* =============================================================================
   CP Progress - globalni overlay "Spremam promjene, molimo pričekajte"
   Koristi se sa assets/js/cp-progress.js (window.CpProgress). Bez inline stilova
   (CSP), sve klase. Tekstovi dolaze iz jezičnih fajlova (segmenti/footer.php).
   ============================================================================= */
.cpp-overlay {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(17, 24, 39, 0.45);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.cpp-overlay.cpp-visible { opacity: 1; pointer-events: auto; }
.cpp-card {
    width: min(440px, calc(100vw - 32px));
    background: #fff; border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .12);
    padding: 28px 28px 24px; text-align: center;
    transform: translateY(12px) scale(.98); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.cpp-overlay.cpp-visible .cpp-card { transform: translateY(0) scale(1); }
.cpp-icon {
    width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
    background: conic-gradient(from 0deg, #2563eb, #7c3aed, #06b6d4, #2563eb);
    -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%);
    animation: cpp-spin 1.1s linear infinite;
}
.cpp-overlay.cpp-done .cpp-icon {
    -webkit-mask: none; mask: none; animation: none;
    background: #16a34a; position: relative;
}
.cpp-overlay.cpp-done .cpp-icon::after {
    content: ""; position: absolute; left: 22px; top: 14px; width: 16px; height: 30px;
    border: solid #fff; border-width: 0 4px 4px 0; transform: rotate(45deg);
}
.cpp-overlay.cpp-error .cpp-icon {
    -webkit-mask: none; mask: none; animation: none; background: #dc2626; position: relative;
}
.cpp-overlay.cpp-error .cpp-icon::before, .cpp-overlay.cpp-error .cpp-icon::after {
    content: ""; position: absolute; left: 30px; top: 16px; width: 4px; height: 32px; background: #fff; border-radius: 2px;
}
.cpp-overlay.cpp-error .cpp-icon::before { transform: rotate(45deg); }
.cpp-overlay.cpp-error .cpp-icon::after  { transform: rotate(-45deg); }
.cpp-title { font-size: 17px; font-weight: 700; color: #111827; margin: 0 0 6px; }
.cpp-subtitle { font-size: 13.5px; color: #6b7280; margin: 0 0 18px; min-height: 18px; }
.cpp-track {
    position: relative; height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden;
}
.cpp-bar {
    position: absolute; left: 0; top: 0; height: 100%; width: 40%; border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #06b6d4);
    background-size: 200% 100%;
    animation: cpp-slide 1.4s ease-in-out infinite, cpp-shimmer 2s linear infinite;
}
.cpp-track.cpp-determinate .cpp-bar { animation: cpp-shimmer 2s linear infinite; transition: width .35s ease; }
.cpp-overlay.cpp-done .cpp-bar { width: 100% !important; background: #16a34a; animation: none; }
.cpp-overlay.cpp-error .cpp-bar { width: 100% !important; background: #dc2626; animation: none; }
.cpp-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 12px; color: #9ca3af; font-variant-numeric: tabular-nums; }
.cpp-pct { font-weight: 600; color: #374151; }
@keyframes cpp-spin { to { transform: rotate(360deg); } }
@keyframes cpp-slide { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes cpp-shimmer { 0% { background-position: 0% 0; } 100% { background-position: 200% 0; } }
@media (prefers-reduced-motion: reduce) {
    .cpp-icon, .cpp-bar { animation: none !important; }
    .cpp-track:not(.cpp-determinate) .cpp-bar { width: 100%; opacity: .6; }
}
