/* Estilos base compartidos */
:root {
    --primary: #2a4eca;
    --primary-light: #3a5fda;
    --primary-dark: #112FA9;
    --secondary: #5ecfb1;
    --secondary-light: #6edfc1;
    --secondary-dark: #4ab69e;
    --gradient-1: linear-gradient(135deg, var(--secondary), var(--primary));
    --gradient-2: linear-gradient(135deg, var(--primary-light), var(--secondary-light));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f8fafc;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

.implementation-journey {
    max-width: 100%;
    overflow: hidden;
    position: relative;
}

/* Elementos decorativos de fondo */
.bg-decoration {
    position: absolute;
    z-index: -1;
}

.bg-circle-1 {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(94,207,177,0.1) 0%, rgba(94,207,177,0) 70%);
    top: 5%;
    left: -100px;
}

.bg-circle-2 {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(42,78,202,0.05) 0%, rgba(42,78,202,0) 70%);
    bottom: 5%;
    right: -150px;
}

.bg-dots {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(0,0,0,0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.2;
}

/* Encabezado */
.journey-header {
    text-align: center;
    max-width: 100%;
    margin: 1rem auto;
    padding: 0 1.5rem;
    position: relative;
}

.journey-subtitle {
    display: inline-block;
    background: var(--secondary-dark);
    color: white;
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 15px rgba(94,207,177,0.3);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease;
}

.journey-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease 0.2s;
    line-height: 1.3;
}

.journey-description {
    font-size: 1rem;
    color: #64748b;
    margin: 0 auto;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.6s ease 0.4s;
    line-height: 1.6;
}

.visible .journey-subtitle,
.visible .journey-title,
.visible .journey-description {
    transform: translateY(0);
    opacity: 1;
}

/* Contador de pasos */
.steps-counter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    opacity: 0;
    transition: all 0.6s ease 0.6s;
    padding: 1rem;
}

.visible .steps-counter {
    transform: translateY(0);
    opacity: 1;
}

.counter-item {
    text-align: center;
    flex: 0 0 calc(50% - 0.75rem);
    position: relative;
    margin-bottom: 0.75rem;
}

.counter-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.125rem;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.counter-text {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

.counter-item.active .counter-number {
    background: var(--gradient-1);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(94,207,177,0.3);
}

.counter-item.active .counter-text {
    color: var(--primary);
    font-weight: 600;
}

/* Línea de tiempo - Versión móvil */
.timeline-container {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.line-container {
    background: white !important;
}

.timeline-path {
    position: absolute;
    top: 0;
    left: 20px;
    width: 3px;
    height: 100%;
    background: #e2e8f0;
    z-index: 1;
}

.timeline-path::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--gradient-1);
    transition: height 1.5s ease;
}

.timeline-path.animated::before {
    height: 100%;
}

/* Tarjetas de la línea de tiempo - Versión móvil */
.timeline-cards {
    position: relative;
    z-index: 2;
}

.timeline-card {
    position: relative;
    padding-left: 45px;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.timeline-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.card-dot {
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 3;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.timeline-card.visible .card-dot {
    background: var(--primary-dark);
    border-color: white;
}

.card-dot-icon {
    color: #cbd5e1;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.timeline-card.visible .card-dot-icon {
    color: white;
}

.card-content {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-step {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.card-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--secondary);
    color: white;
    border-radius: 50%;
    margin-right: 0.5rem;
    font-size: 0.7rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.card-description {
    color: #64748b;
    margin-bottom: 1.25rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.card-features {
    list-style: none;
}

.card-feature {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.feature-icon {
    flex: 0 0 20px;
    height: 20px;
    background: rgba(94,207,177,0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    color: white;
    font-size: 0.7rem;
}

.feature-text {
    flex: 1;
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
}

/* Colores alternados para las tarjetas */
.timeline-card:nth-child(1) .card-step,
.timeline-card:nth-child(1) .card-title{
    color: var(--secondary);
}

.timeline-card:nth-child(2) .card-step,
.timeline-card:nth-child(2) .card-title {
    color: #3b82f6;
}

.timeline-card:nth-child(3) .card-step,
.timeline-card:nth-child(3) .card-title {
    color: #3b82f6;
}

.timeline-card:nth-child(4) .card-step,
.timeline-card:nth-child(4) .card-title {
    color: var(--primary);
}

.timeline-card:nth-child(1) .card-step-number,
.timeline-card:nth-child(1) .feature-icon {
    background: var(--secondary);
}

.timeline-card:nth-child(2) .card-step-number,
.timeline-card:nth-child(2) .feature-icon {
    background: #3b82f6;
    color: white;
}

.timeline-card:nth-child(3) .card-step-number,
.timeline-card:nth-child(3) .feature-icon {
    background: #3a5fda;
    color: white;
}

.timeline-card:nth-child(4) .card-step-number,
.timeline-card:nth-child(4) .feature-icon {
    background: var(--primary);
    color: white;
}

.timeline-card:nth-child(1) .card-dot {
    background-color: var(--secondary);
}

.timeline-card:nth-child(2) .card-dot {
    background-color: var(--primary-light);
}

.timeline-card:nth-child(3) .card-dot {
    background-color: var(--primary);
}

/* Ilustraciones */
.card-illustration {
    position: absolute;
    width: 80px;
    height: 80px;
    bottom: 10px;
    right: 10px;
    opacity: 0.08;
    transition: all 0.3s ease;
}

/* CTA Section */
.cta-container {
    max-width: 90%;
    margin: 3rem auto 0;
    padding: 0 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.cta-container.visible {
    opacity: 1;
    transform: translateY(0);
}

.cta-box {
    background: white;
    border-radius: 20px;
    padding: 2rem 1.5rem;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
    position: relative;
    z-index: 1;
}

.cta-description {
    color: #64748b;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cta-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.cta-button-primary {
    background: var(--primary-light);
    color: white;
    box-shadow: 0 4px 10px rgba(94,207,177,0.3);
}

.cta-button-primary:active {
    color: var(--secondary);
    transform: translateY(2px);
    box-shadow: 0 2px 5px rgba(94,207,177,0.3);
}

.cta-button-secondary {
    background: white;
    color: var(--primary);
    border: 1px solid #e2e8f0;
}

.cta-button-secondary:active {
    background: #f8fafc;
}

.cta-button i {
    margin-left: 0.5rem;
}

.cta-decoration {
    position: absolute;
    z-index: 0;
}

.cta-blob-1 {
    width: 150px;
    height: 150px;
    background: rgba(94,207,177,0.05);
    border-radius: 50%;
    top: -75px;
    left: -75px;
}

.cta-blob-2 {
    width: 100px;
    height: 100px;
    background: rgba(42,78,202,0.05);
    border-radius: 50%;
    bottom: -50px;
    right: -50px;
}

/* Animaciones */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

.pulse-animation {
    animation: pulse 4s ease-in-out infinite;
}

/* ======= ESTILOS PARA DESKTOP (≥1024px) ======= */
@media (min-width: 1024px) {
    .implementation-journey {
        padding: 6rem 0;
    }

    .bg-circle-1 {
        width: 400px;
        height: 400px;
        top: 10%;
        left: -200px;
    }

    .bg-circle-2 {
        width: 600px;
        height: 600px;
        bottom: 10%;
        right: -300px;
    }

    .journey-header {
        max-width: 900px;
        margin-bottom: 5rem;
    }

    .journey-subtitle {
        font-size: 1rem;
        padding: 0.5rem 1.5rem;
    }

    .journey-title {
        font-size: 3.5rem;
        margin-bottom: 1.5rem;
    }

    .journey-description {
        font-size: 1.25rem;
        max-width: 700px;
    }

    .steps-counter {
        max-width: 600px;
        padding: 1.5rem;
        flex-wrap: nowrap;
    }

    .counter-item {
        flex: 1;
        margin-bottom: 0;
        position: relative;
    }

    .counter-item:not(:last-child)::after {
        content: '';
        position: absolute;
        top: 50%;
        right: 0;
        width: 100%;
        height: 2px;
        background: #e2e8f0;
        transform: translateY(-50%);
        z-index: 1;
    }

    .counter-number {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        position: relative;
        z-index: 2;
    }

    .counter-text {
        font-size: 0.875rem;
        margin-top: 1rem;
    }

    /* Línea de tiempo curva para desktop */
    .timeline-container {
        max-width: 1400px;
        padding: 0 2rem;
    }

    /* Ocultar la línea recta en desktop */
    .timeline-path {
        display: none;
    }

    /* Mostrar la línea curva en desktop */
    .timeline-curve {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

    /* Tarjetas alternadas a izquierda y derecha */
    .timeline-card {
        display: flex;
        padding-left: 0;
        margin-bottom: 8rem;
        align-items: center;
    }

    .timeline-card:nth-child(odd) {
        flex-direction: row-reverse;
    }

    .card-dot {
        position: relative;
        left: auto;
        top: auto;
        width: 50px;
        height: 50px;
        margin: 0;
        flex: 0 0 50px;
    }

    .card-dot-icon {
        font-size: 1.25rem;
    }

    .card-content {
        flex: 0 0 calc(50% - 50px);
        padding: 2.5rem;
        margin: 0;
        border-radius: 30px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    .timeline-card:nth-child(odd) .card-content {
        margin-right: 2rem;
        margin-left: 0;
        border-radius: 30px 0 30px 30px;
    }

    .timeline-card:nth-child(even) .card-content {
        margin-left: 2rem;
        margin-right: 0;
        border-radius: 0 30px 30px 30px;
    }

    .timeline-card:hover .card-content {
        transform: translateY(-10px);
        box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    }

    .card-step {
        font-size: 0.875rem;
    }

    .card-step-number {
        width: 24px;
        height: 24px;
    }

    .card-title {
        font-size: 1.75rem;
        margin-bottom: 1rem;
    }

    .card-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .feature-icon {
        flex: 0 0 24px;
        height: 24px;
        margin-right: 1rem;
    }

    .feature-text {
        font-size: 0.95rem;
    }

    /* Ilustraciones más grandes para desktop */
    .card-illustration {
        width: 120px;
        height: 120px;
        bottom: -10px;
        right: 20px;
    }

    .timeline-card:hover .card-illustration {
        opacity: 0.15;
        transform: scale(1.1) rotate(10deg);
    }

    /* Decoraciones de tarjetas */
    .card-decoration {
        display: block;
        position: absolute;
        z-index: 0;
    }

    .card-circle {
        width: 150px;
        height: 150px;
        border-radius: 50%;
        background: rgba(94,207,177,0.05);
        bottom: -75px;
        right: -75px;
    }

    .card-dots {
        top: 20px;
        right: 20px;
        opacity: 0.3;
    }

    /* CTA Section */
    .cta-container {
        max-width: 900px;
        margin: 5rem auto 0;
    }

    .cta-box {
        padding: 3rem;
        border-radius: 30px;
    }

    .cta-title {
        font-size: 2rem;
    }

    .cta-description {
        font-size: 1.125rem;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 2rem;
    }

    .cta-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }

    .cta-button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .cta-button-primary:hover {
        color: var(--secondary) !important;
        transform: translateY(-5px);
        background-color: white !important;
        box-shadow: 0 10px 20px rgba(94,207,177,0.2);
    }

    .cta-button-secondary:hover {
        background: #f8fafc;
        transform: translateY(-5px);
    }

    .cta-button:hover i {
        transform: translateX(5px);
    }

    .cta-blob-1 {
        width: 300px;
        height: 300px;
        top: -150px;
        left: -150px;
    }

    .cta-blob-2 {
        width: 200px;
        height: 200px;
        bottom: -100px;
        right: -100px;
    }
}

/* Estilos para tablets (≥640px y <1024px) */
@media (min-width: 640px) and (max-width: 1023px) {
    .journey-title {
        font-size: 2.25rem;
    }

    .steps-counter {
        max-width: 500px;
    }

    .counter-item {
        flex: 0 0 calc(25% - 0.75rem);
        margin-bottom: 0;
    }

    .timeline-card {
        padding-left: 60px;
    }

    .timeline-path {
        left: 45px;
    }

    .card-dot {
        width: 50px;
        height: 50px;
        left: 5px;
    }

    .card-content {
        padding: 2rem;
    }

    .cta-container {
        max-width: 500px;
    }

    .cta-buttons {
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 639px) {
    .steps-counter {
        flex-wrap: wrap;
        justify-content: center;
    }

    .counter-item {
        flex: 0 0 calc(50% - 0.75rem);
        margin-bottom: 0.75rem;
    }

    .timeline-card {
        padding-left: 45px;
        margin-bottom: 3rem;
    }

    .card-dot {
        width: 40px;
        height: 40px;
    }

    .card-content {
        padding: 1.5rem;
    }
    .timeline-path {
        left: 35px;
    }
}