/* ============================================================
   TRANSFORMATION FLOW - PROFESSIONAL VERSION 2026
   ------------------------------------------------------------
   Con animaciones visuales claras:
   - Pulso en paso activo
   - Barra cargando con flecha
   - Layout ANTES/DESPUÉS
   ============================================================ */

/* Container principal */
.svc-flow .container {
    max-width: 1400px;
}

/* Track de pasos */
.svc-flow-track {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 60px 0 80px;
    padding: 0 20px;
}

/* Línea de conexión - GRIS */
.svc-flow-line {
    position: absolute;
    top: 28px;
    left: 60px;
    right: 60px;
    height: 4px;
    background: var(--color-border-light); /* Gris */
    border-radius: 2px;
    z-index: 1;
}

/* Barra de progreso - NARANJA con animación de carga */
.svc-flow-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--color-highlight); /* Naranja puro #ff8108 */
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    border-radius: 2px;
    transition: width 3s ease-in-out, opacity 0.2s; /* Transición MÁS LENTA para verla */
    z-index: 2;
    opacity: 0;
    animation: progress-stripes 1.2s linear infinite;
}

@keyframes progress-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

/* FLECHA en la punta */
.svc-flow-progress::after {
    content: '▶';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--color-highlight);
    text-shadow: 0 0 12px rgba(255, 129, 8, 0.6);
    animation: arrow-pulse 1.5s ease-in-out infinite;
    z-index: -1;
}

@keyframes arrow-pulse {
    0%, 100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-50%) scale(1.2);
        opacity: 0.8;
    }
}

/* Pasos (círculos numerados) */
.svc-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: var(--color-bg); /* Fondo para tapar la línea */
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
    padding: 0 8px; /* Espacio para que el fondo tape la línea */
}

.svc-step-num {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-alt);
    border: 3px solid var(--color-border-light);
    border-radius: 50%;
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text-secondary);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10; /* Por encima de la línea */
}

.svc-step-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    text-align: center;
    max-width: 100px;
    line-height: 1.3;
    transition: color 0.3s;
}

/* Paso ACTIVO con PULSO (como el sol) */
.svc-step.active .svc-step-num {
    background: linear-gradient(135deg,
        rgba(255, 129, 8, 0.2),
        rgba(255, 129, 8, 0.1));
    border-color: var(--color-highlight);
    color: var(--color-highlight);
    font-weight: 900;
    transform: scale(1.15);
    box-shadow:
        0 0 0 0 rgba(255, 129, 8, 0.4),
        0 0 20px rgba(255, 129, 8, 0.3);
    animation: step-pulse 2s ease-in-out infinite;
}

@keyframes step-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 0 rgba(255, 129, 8, 0.4),
            0 0 20px rgba(255, 129, 8, 0.3);
    }
    50% {
        box-shadow:
            0 0 0 12px rgba(255, 129, 8, 0),
            0 0 30px rgba(255, 129, 8, 0.5);
    }
}

.svc-step.active .svc-step-label {
    color: var(--color-highlight);
    font-weight: 700;
}

/* Paso COMPLETADO - SIN cambio de color ni check */
.svc-step.done .svc-step-num {
    /* Mantener estilo normal */
}

.svc-step.done .svc-step-label {
    /* Mantener estilo normal */
}

/* Hover en pasos */
.svc-step:hover .svc-step-num {
    transform: scale(1.08);
    border-color: var(--color-accent);
}

/* DETALLE DEL PASO — Layout ANTES/DESPUÉS */
.svc-flow-detail {
    background: var(--color-bg-alt);
    border: 2px solid var(--color-border-light);
    border-radius: 24px;
    padding: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.svc-flow-detail.is-in {
    opacity: 1;
    transform: translateY(0);
}

/* Header del paso */
.svc-flow-step-header {
    padding: 24px 40px 20px;
    border-bottom: 2px solid var(--color-border-light);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.svc-flow-step-icon {
    font-size: 36px;
    line-height: 1;
    margin: 0;
}

.svc-flow-step-title {
    font-size: clamp(1.3rem, 2vw, 1.7rem);
    font-weight: 800;
    color: var(--color-text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.svc-flow-step-desc {
    font-size: var(--text-base);
    line-height: 1.4;
    color: var(--color-text-secondary);
    margin: 0;
}

/* ANTES/DESPUÉS - CARDS APILADAS CON GLASSMORPHISM */
.svc-flow-comparison {
    position: relative;
    min-height: 520px;
    padding: 40px 20px 80px;
    background: linear-gradient(135deg,
        rgba(0, 102, 204, 0.02) 0%,
        transparent 50%,
        rgba(255, 129, 8, 0.02) 100%);
    border-radius: 0 0 24px 24px;
}

/* Card ANTES (base layer) - MÁS VISIBLE */
.svc-flow-before {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 0 auto;
    padding: 56px 48px 80px;
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.svc-flow-before-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
    padding: 6px 14px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.svc-flow-before-icon {
    font-size: 56px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.svc-flow-before-content {
    font-size: var(--text-base);
    line-height: 1.7;
    color: var(--color-text-secondary);
    max-width: 680px;
    margin: 0 auto;
}

/* Card CON HOPE (floating layer con glassmorphism) */
.svc-flow-after {
    position: absolute;
    top: 180px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    width: calc(100% - 160px);
    max-width: 760px;
    padding: 40px 44px;
    text-align: center;

    /* Glassmorphism effect */
    background: rgba(var(--color-bg-rgb, 0, 0, 0), 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    /* Gradient border */
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 24px;

    /* Premium shadow con glow */
    box-shadow:
        0 0 0 1px rgba(0, 102, 204, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.25),
        0 0 40px rgba(0, 102, 204, 0.15);

    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gradient border effect */
.svc-flow-after::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    background: linear-gradient(135deg,
        var(--color-accent) 0%,
        var(--color-highlight) 100%);
    border-radius: 24px;
    -webkit-mask: linear-gradient(#fff 0 0) content-box,
                  linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

body.dark-mode .svc-flow-after {
    background: rgba(0, 0, 0, 0.8);
}

body.light-mode .svc-flow-after {
    background: rgba(255, 255, 255, 0.9);
}

.svc-flow-after:hover {
    transform: translateX(-50%) translateY(-4px);
    box-shadow:
        0 0 0 1px rgba(0, 102, 204, 0.2),
        0 24px 80px rgba(0, 0, 0, 0.3),
        0 0 60px rgba(0, 102, 204, 0.25);
}

.svc-flow-after-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    background: linear-gradient(135deg,
        rgba(0, 102, 204, 0.15),
        rgba(255, 129, 8, 0.1));
    padding: 6px 14px;
    border-radius: 12px;
    border: 1px solid rgba(0, 102, 204, 0.2);
    margin-bottom: 20px;
}

.svc-flow-after-icon {
    font-size: 64px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 12px rgba(0, 102, 204, 0.3));
}

.svc-flow-after-content {
    font-size: var(--text-lg);
    line-height: 1.6;
    color: var(--color-text-primary);
    font-weight: 600;
    max-width: 640px;
    margin: 0 auto 24px;
}

/* Badge de resultado (fuera del card, destacado) */
.svc-flow-result-visual {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;

    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 28px;

    background: linear-gradient(135deg,
        var(--color-accent) 0%,
        var(--color-highlight) 100%);
    border: 3px solid var(--color-bg);
    border-radius: 24px;
    box-shadow:
        0 0 0 2px var(--color-accent),
        0 12px 32px rgba(0, 102, 204, 0.4);

    font-size: var(--text-base);
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    white-space: nowrap;

    animation: result-pulse 2s ease-in-out infinite;
}

@keyframes result-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 2px var(--color-accent),
            0 12px 32px rgba(0, 102, 204, 0.4);
    }
    50% {
        box-shadow:
            0 0 0 2px var(--color-accent),
            0 12px 40px rgba(0, 102, 204, 0.6),
            0 0 20px rgba(255, 129, 8, 0.4);
    }
}

/* Responsive */
@media (max-width: 1023px) {
    .svc-flow-track {
        margin: 40px 0 60px;
        padding: 0 10px;
    }

    .svc-flow-line {
        left: 40px;
        right: 40px;
    }

    .svc-step-num {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .svc-step-label {
        font-size: 12px;
        max-width: 80px;
    }

    /* Cards apiladas en mobile */
    .svc-flow-comparison {
        min-height: 500px;
        padding: 32px 16px;
    }

    .svc-flow-before {
        padding: 36px 28px;
    }

    .svc-flow-after {
        top: 140px;
        width: calc(100% - 40px);
        padding: 36px 28px;
    }

    .svc-flow-result-visual {
        bottom: -24px;
        padding: 14px 24px;
        font-size: var(--text-sm);
    }
}

@media (max-width: 767px) {
    .svc-flow-track {
        flex-wrap: wrap;
        gap: 24px;
        justify-content: center;
    }

    .svc-flow-line {
        display: none;
    }

    .svc-flow-progress {
        display: none;
    }

    .svc-step {
        flex: 0 0 auto;
    }

    .svc-flow-step-header {
        padding: 24px 20px 20px;
    }

    /* Mobile: stack vertical, no overlap */
    .svc-flow-comparison {
        min-height: auto;
        padding: 24px 12px 60px;
        display: flex;
        flex-direction: column;
        gap: 32px;
    }

    .svc-flow-before {
        position: relative;
        padding: 28px 24px;
    }

    .svc-flow-after {
        position: relative;
        top: auto;
        left: auto;
        transform: none;
        width: 100%;
        max-width: 100%;
        padding: 32px 24px;
    }

    .svc-flow-after:hover {
        transform: translateY(-2px);
    }

    .svc-flow-result-visual {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin-top: 24px;
    }
}
