/* ============================================
   LOADING PROFESSIONNEL - Design Moderne & Organisé
   ============================================ */

/* Overlay Global */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.75) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: overlayFadeIn 0.3s ease-out;
}

.loading-overlay.hidden {
    animation: overlayFadeOut 0.3s ease-out forwards;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes overlayFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Container Principal */
.loading-container {
    width: 100%;
    max-width: 480px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Carte de Chargement */
.loading-card {
    width: 100%;
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
    border-radius: 24px;
    box-shadow: 
        0 30px 90px rgba(0, 0, 0, 0.3),
        0 15px 40px rgba(0, 120, 212, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
    animation: cardSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.loading-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        #0078D4 0%, 
        #00B4D8 25%,
        #0099BC 50%,
        #00B4D8 75%,
        #0078D4 100%);
    background-size: 200% 100%;
    animation: topBarAnimation 3s ease-in-out infinite;
}

@keyframes topBarAnimation {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header de la Carte */
.loading-header {
    padding: 32px 32px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.02) 0%, transparent 100%);
}

.loading-logo {
    flex-shrink: 0;
}

.logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0078D4 0%, #00B4D8 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 8px 16px rgba(0, 120, 212, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 70%);
    animation: logoShine 3s linear infinite;
}

@keyframes logoShine {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.logo-svg {
    width: 32px;
    height: 32px;
    color: white;
    position: relative;
    z-index: 1;
}

.logo-circle {
    stroke-dasharray: 175;
    stroke-dashoffset: 175;
    animation: circleDraw 2s ease-in-out infinite;
}

.logo-hand {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: handDraw 1.5s ease-in-out infinite 0.5s;
}

@keyframes circleDraw {
    0% {
        stroke-dashoffset: 175;
    }
    50% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -175;
    }
}

@keyframes handDraw {
    0% {
        stroke-dashoffset: 40;
    }
    50%, 100% {
        stroke-dashoffset: 0;
    }
}

.loading-title-section {
    flex: 1;
    min-width: 0;
}

.loading-title {
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 700;
    color: #323130;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.loading-subtitle {
    margin: 0;
    font-size: 14px;
    color: #605E5C;
    font-weight: 400;
    line-height: 1.4;
    min-height: 20px;
}

.loading-subtitle:empty {
    display: none;
}

/* Body de la Carte */
.loading-body {
    padding: 32px;
}

/* Indicateur de Chargement */
.loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    height: 80px;
}

.pulse-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    border: 2px solid #0078D4;
    border-radius: 50%;
    opacity: 0;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.pulse-ring:nth-child(1) {
    animation-delay: 0s;
}

.pulse-ring:nth-child(2) {
    animation-delay: 0.5s;
}

.pulse-ring:nth-child(3) {
    animation-delay: 1s;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.loading-dots {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #0078D4 0%, #00B4D8 100%);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.4);
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8) translateY(0);
        opacity: 0.7;
    }
    40% {
        transform: scale(1.2) translateY(-8px);
        opacity: 1;
    }
}

/* Barre de Progression */
.loading-progress-container {
    margin-top: 8px;
}

.progress-track {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, 
        rgba(0, 120, 212, 0.08) 0%, 
        rgba(0, 180, 216, 0.12) 50%, 
        rgba(0, 120, 212, 0.08) 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
    animation: trackShimmer 3s ease-in-out infinite;
}

@keyframes trackShimmer {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.progress-fill-animated {
    height: 100%;
    width: 35%;
    background: linear-gradient(90deg, 
        #0078D4 0%, 
        #00B4D8 25%,
        #0099BC 50%,
        #00B4D8 75%,
        #0078D4 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    position: relative;
    animation: progressMove 2s ease-in-out infinite, gradientFlow 3s ease-in-out infinite;
    box-shadow: 
        0 0 12px rgba(0, 120, 212, 0.5),
        0 0 24px rgba(0, 180, 216, 0.3);
    overflow: hidden;
}

.progress-fill-animated::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.6) 50%, 
        transparent 100%);
    animation: shine 2s ease-in-out infinite;
}

@keyframes progressMove {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(250%);
    }
    100% {
        transform: translateX(250%);
    }
}

@keyframes gradientFlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes shine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* Étapes de Progression */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    gap: 12px;
}

.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E8F4F8 0%, #D1E9F2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #0078D4;
    border: 2px solid rgba(0, 120, 212, 0.2);
    transition: all 0.3s ease;
}

.step.active .step-icon {
    background: linear-gradient(135deg, #0078D4 0%, #00B4D8 100%);
    color: white;
    border-color: #0078D4;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
    transform: scale(1.1);
    animation: stepPulse 2s ease-in-out infinite;
}

@keyframes stepPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 120, 212, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 120, 212, 0.5);
    }
}

.step-label {
    font-size: 11px;
    font-weight: 500;
    color: #605E5C;
    text-align: center;
    letter-spacing: 0.3px;
}

.step.active .step-label {
    color: #0078D4;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .loading-container {
        max-width: 90%;
        padding: 16px;
    }
    
    .loading-card {
        border-radius: 20px;
    }
    
    .loading-header {
        padding: 24px 24px 20px;
        gap: 16px;
    }
    
    .logo-icon {
        width: 48px;
        height: 48px;
    }
    
    .logo-svg {
        width: 28px;
        height: 28px;
    }
    
    .loading-title {
        font-size: 18px;
    }
    
    .loading-subtitle {
        font-size: 13px;
    }
    
    .loading-body {
        padding: 24px;
    }
    
    .loading-indicator {
        height: 70px;
        margin-bottom: 32px;
    }
    
    .pulse-ring {
        width: 70px;
        height: 70px;
    }
    
    .progress-steps {
        margin-top: 20px;
        gap: 8px;
    }
    
    .step-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .step-label {
        font-size: 10px;
    }
}

/* Animation de transition entre étapes */
.step.completed .step-icon {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: white;
    border-color: #10B981;
}

.step.completed .step-label {
    color: #10B981;
}





