/* ============================================
   SERVICIOS.CSS - Design System Premium
   ============================================ */

/* Shared hero styles */
.service-hero {
    padding: 8rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.service-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 60% 0%, rgba(37, 99, 235, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.15);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(37, 99, 235, 0.12);
    transform: translateX(-4px);
}

/* ============================================
   GRID PATTERN (Tech background)
   ============================================ */
.tech-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    pointer-events: none;
}

/* ============================================
   ANIMATED CIRCUIT LINES
   ============================================ */
.circuit-container {
    position: absolute;
    top: 0; right: 0;
    width: 50%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.6;
}

.circuit-svg line, .circuit-svg path {
    stroke-dasharray: 400;
    stroke-dashoffset: 400;
    animation: drawLine 3s ease forwards;
}
.circuit-svg .l1 { animation-delay: 0.2s; }
.circuit-svg .l2 { animation-delay: 0.6s; }
.circuit-svg .l3 { animation-delay: 1s; }
.circuit-svg .l4 { animation-delay: 1.4s; }
.circuit-svg .l5 { animation-delay: 1.8s; }

@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

.circuit-dot {
    animation: pulseDot 2s ease-in-out infinite;
}
.circuit-dot:nth-child(2) { animation-delay: 0.5s; }
.circuit-dot:nth-child(3) { animation-delay: 1s; }

@keyframes pulseDot {
    0%, 100% { opacity: 0.4; r: 4; }
    50% { opacity: 1; r: 6; }
}

/* ============================================
   HERO CONTENT & BADGE
   ============================================ */
.s-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(6,182,212,0.1));
    color: var(--primary);
    border: 1px solid rgba(37,99,235,0.2);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
}

.s-hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.s-hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 2.5rem;
}

/* ============================================
   COUNTER / STAT ANIMATIONS
   ============================================ */
.stats-row {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    max-width: 130px;
}

/* ============================================
   PROBLEM → SOLUTION FLOW
   ============================================ */
.problem-solution {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
    margin: 4rem 0;
}

.problem-box {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 20px;
    padding: 2rem;
}

.problem-box .ps-label {
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.solution-box {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    padding: 2rem;
}

.solution-box .ps-label {
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ps-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    color: white;
    flex-shrink: 0;
    animation: pulseArrow 2s ease-in-out infinite;
}

@keyframes pulseArrow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.3); }
    50% { box-shadow: 0 0 0 15px rgba(37, 99, 235, 0); }
}

/* ============================================
   WOW MOMENT CALLOUT
   ============================================ */
.wow-callout {
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 50%, #1d4ed8 100%);
    border-radius: 28px;
    padding: 3.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    margin: 4rem 0;
}

.wow-callout::before {
    content: '"';
    position: absolute;
    top: -1rem;
    left: 2rem;
    font-size: 12rem;
    font-family: Georgia, serif;
    color: rgba(255,255,255,0.08);
    line-height: 1;
}

.wow-callout .scenario-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1rem;
}

.wow-callout .scenario-text {
    font-size: 1.3rem;
    line-height: 1.6;
    font-weight: 500;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.wow-callout .scenario-result {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: white;
}

.wow-callout .impact-row {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.wow-callout .impact-item {
    text-align: center;
}

.wow-callout .impact-num {
    font-size: 2rem;
    font-weight: 800;
    display: block;
}

.wow-callout .impact-text {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ============================================
   FEATURE CARDS v2
   ============================================ */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.feat-card {
    background: white;
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.feat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.feat-card:hover::before {
    transform: scaleX(1);
}

.feat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.3);
}

.feat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(37,99,235,0.1), rgba(6,182,212,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.feat-icon i {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.feat-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.feat-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ============================================
   REAL CASE STUDIES
   ============================================ */
.case-study-card {
    background: white;
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    overflow: hidden;
    margin: 4rem 0;
}

.case-header {
    background: linear-gradient(135deg, #0a1c40, #1e3a8a);
    padding: 2rem 2.5rem;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.case-tag {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50px;
    padding: 0.35rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.case-company {
    font-size: 1.4rem;
    font-weight: 800;
}

.case-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

@media (max-width: 768px) {
    .case-body { grid-template-columns: 1fr; }
    .problem-solution { grid-template-columns: 1fr; }
    .ps-arrow { transform: rotate(90deg); }
}

.case-problem, .case-result {
    padding: 2.5rem;
}

.case-problem {
    border-right: 1px solid var(--surface-border);
}

.case-kpi {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.kpi-item {
    text-align: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, rgba(37,99,235,0.06), rgba(6,182,212,0.06));
    border-radius: 16px;
    border: 1px solid rgba(37,99,235,0.12);
}

.kpi-num {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.kpi-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ============================================
   STEP INDICATOR
   ============================================ */
.steps-row {
    display: flex;
    gap: 0;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.step-item {
    flex: 1;
    min-width: 150px;
    position: relative;
    padding: 2rem 1.5rem;
    text-align: center;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 2.5rem;
    right: -1px;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary), rgba(37,99,235,0.1));
}

.step-num {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    position: relative;
    z-index: 1;
}

.step-item h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step-item p {
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* ============================================
   FLOATING DATA ANIMATION (Hero visual)
   ============================================ */
.data-visual {
    position: relative;
    padding: 2rem;
}

.data-terminal {
    background: #0d1117;
    border-radius: 16px;
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    box-shadow: 0 30px 80px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.08);
}

.terminal-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-line {
    line-height: 2;
    opacity: 0;
    animation: typeIn 0.5s ease forwards;
}

.terminal-line:nth-child(1) { animation-delay: 0.3s; }
.terminal-line:nth-child(2) { animation-delay: 0.7s; }
.terminal-line:nth-child(3) { animation-delay: 1.1s; }
.terminal-line:nth-child(4) { animation-delay: 1.5s; }
.terminal-line:nth-child(5) { animation-delay: 1.9s; }
.terminal-line:nth-child(6) { animation-delay: 2.3s; }
.terminal-line:nth-child(7) { animation-delay: 2.7s; }

@keyframes typeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

.t-comment { color: #6b7280; }
.t-key { color: #60a5fa; }
.t-value { color: #34d399; }
.t-string { color: #f9a8d4; }
.t-success { color: #34d399; font-weight: bold; }
.t-alert { color: #fbbf24; }

.floating-tag {
    position: absolute;
    background: white;
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: floatTag 4s ease-in-out infinite;
}

.floating-tag.tag-green { color: #059669; border-color: rgba(16,185,129,0.3); }
.floating-tag.tag-blue { color: var(--primary); border-color: rgba(37,99,235,0.3); }
.floating-tag.tag-orange { color: #d97706; border-color: rgba(217,119,6,0.3); }

.floating-tag:nth-child(2) { animation-delay: 1s; }
.floating-tag:nth-child(3) { animation-delay: 2s; }

@keyframes floatTag {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* ============================================
   SECTION TITLES
   ============================================ */
.section-eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.s-title {
    font-family: var(--font-heading);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.s-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 600px;
}

/* ============================================
   CTA SECTION
   ============================================ */
.service-cta {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border-top: 1px solid var(--surface-border);
    padding: 5rem 0;
    text-align: center;
}

.service-cta h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.service-cta p {
    color: var(--text-muted);
    max-width: 550px;
    margin: 0 auto 2rem;
}

/* ============================================
   ANIMATIONS (Entrance)
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Particle dots */
.dot-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.2;
    animation: driftUp 8s ease-in-out infinite;
}

@keyframes driftUp {
    0% { transform: translateY(0) scale(1); opacity: 0.2; }
    50% { opacity: 0.5; }
    100% { transform: translateY(-100px) scale(0); opacity: 0; }
}
