/* --- Variables CSS --- */
:root {
    --primary-color: #b180ff; 
    --primary-hover: #cdaeff; 
    --secondary-color: #64CCC5; 
    --secondary-hover: #87D7CF; 
    --accent-color: #FFB347; 

    --dark-bg: #0A0918; 
    --medium-bg: #141228; 
    --light-bg: #1E1C3A; 
    
    --card-bg: linear-gradient(145deg, #1C1A33, #252244); 
    
    --text-color: #EAE6FF; 
    --text-muted: #A09CC9; 
    --text-darker: #1E1C3A; 

    --border-color: #3A365E; 
    
    --font-family: "Poppins", "Segoe UI", sans-serif;
    --box-shadow: 0 10px 25px rgba(17, 10, 31, 0.35); 
    --box-shadow-light: 0 5px 15px rgba(17, 10, 31, 0.25); 
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

/* --- Reset y Globales --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.7;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; 
}

main {
    flex: 1;
}

img, svg {
    max-width: 100%;
    display: block;
}

h1, h2, h3 {
    line-height: 1.3;
    color: var(--text-color); 
}

h1 { font-size: clamp(2.2rem, 5vw, 3rem); color: var(--primary-hover) }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 3vw, 1.5rem); }

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.section-title {
    text-align: center;
    margin-bottom: 1.5rem; 
    color: var(--primary-color);
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 700;
}
.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: clamp(1rem, 2.5vw, 1.1rem);
    max-width: 700px;
    margin: 0 auto 3rem auto; 
}

/* --- Header --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--medium-bg);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.pre-footer-info .logo {
    font-size: 2rem; 
    margin-bottom: 1rem;
}


nav a {
    color: var(--text-color);
    margin: 0 1rem;
    text-decoration: none;
    transition: color var(--transition-speed);
}
nav a:hover {
    color: var(--primary-hover);
}

.cta {
    background: var(--primary-color);
    color: var(--text-darker); 
    font-weight: 600;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color var(--transition-speed), transform var(--transition-speed), box-shadow var(--transition-speed);
    text-decoration: none;
    display: inline-block;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.cta:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(177, 128, 255, 0.3);
}

.cta.outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.cta.outline:hover {
    background: var(--primary-color);
    color: var(--text-darker);
}

/* --- Hero Section --- */
.hero {
    padding: 6rem 2rem; 
    text-align: center;
    min-height: 50vh; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative; 
    background: var(--dark-bg);
}

.hero-background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(177, 128, 255, 0.15) 0%, transparent 70%), 
        radial-gradient(ellipse at 70% 80%, rgba(100, 204, 197, 0.1) 0%, transparent 70%), 
        radial-gradient(ellipse at 50% 50%, rgba(177, 128, 255, 0.1) 0%, transparent 60%); 
    animation: subtleFog 25s ease-in-out infinite alternate;
    z-index: 0;
    
    -webkit-mask-image: linear-gradient(to bottom, white 60%, transparent 100%);
    mask-image: linear-gradient(to bottom, white 60%, transparent 100%);
}

@keyframes subtleFog {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
    25% {
        transform: translate(5px, -5px) scale(1.05);
        opacity: 0.7;
    }
    50% {
        transform: translate(-5px, 5px) scale(1);
        opacity: 0.5;
    }
    75% {
        transform: translate(3px, 3px) scale(1.03);
        opacity: 0.65;
    }
    100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.6;
    }
}

#hero-title {
    font-size: clamp(2.8rem, 7vw, 4.2rem); 
    color: var(--text-color); 
    margin-bottom: 1.5rem;
    max-width: 100%; 
    font-weight: 700;
    line-height: 1.2;
    z-index: 1; 
    position: relative; 
}

#typed-text-container {
    min-height: 2.5rem; 
    margin-top: 0.5rem;
    z-index: 1; 
    position: relative; 
}

#typed-text {
    font-size: clamp(1.3rem, 3vw, 1.8rem);
    color: var(--secondary-color); 
    border-right: 3px solid var(--secondary-color);
    white-space: nowrap;
    display: inline-block;
    min-height: 1.5em; 
    padding-right: 4px;
    animation: blink-cursor 0.8s steps(1) infinite;
    font-weight: 600;
}

/* --- Core Values Section --- */
.core-values-container {
    padding: 4rem 1rem;
    max-width: 1200px;
    /* ===== CAMBIO APLICADO AQUÍ ===== */
    /* Se redujo el margen superior de 3rem a 0 para juntar las secciones */
    margin: 0 auto 3rem;
}

.core-values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.core-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem 2rem 2.5rem 2rem; 
    text-align: left;
    box-shadow: var(--box-shadow-light);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
    position: relative; 
}

.core-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.core-icon {
    position: absolute;
    top: 1.5rem; 
    right: 1.5rem; 
    color: var(--secondary-color); 
    opacity: 1; 
    line-height: 0;
}

.core-icon svg {
    width: 30px; 
    height: 30px; 
}

.core-label {
    background: var(--primary-color);
    color: var(--text-darker);
    font-size: 0.8rem;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px; 
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 1.5rem;
    margin-top: 1rem; 
}

.core-card h3 {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

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

/* --- How It Works Section --- */
.how-it-works {
    padding: 4rem 1rem;
    max-width: 1200px;
    margin: 3rem auto;
    background-color: var(--medium-bg); 
    border-radius: var(--border-radius);
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.step-card {
    background: var(--light-bg);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-light);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed);
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: var(--secondary-color);
}

.step-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color); 
    width: 50px;
    height: 50px;
    line-height: 46px; 
    border-radius: 50%;
    background: rgba(100, 204, 197, 0.1); 
    border: 2px solid var(--secondary-color);
    margin: 0 auto 1.5rem auto;
}

.step-icon {
    margin: 0 auto 1.5rem auto;
    color: var(--primary-color); 
}
.step-icon svg {
    width: 48px;
    height: 48px;
    margin: 0 auto; 
}

.step-card h3 {
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

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

/* --- Plans Section --- */
.plans-box {
    max-width: 1100px;
    margin: 4rem auto;
    padding: 3rem 1rem;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    justify-content: center;
    align-items: stretch; 
}

.plan-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    box-shadow: var(--box-shadow-light);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed);
    position: relative; 
}
.plan-card.hidden-plan {
    display: none;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: var(--primary-color);
}

.plan-card.popular {
    border-color: var(--secondary-color); 
    box-shadow: 0 10px 30px rgba(100, 204, 197, 0.25);
}
.plan-card.popular .cta { 
    background: var(--secondary-color);
    color: var(--dark-bg);
}
.plan-card.popular .cta:hover {
    background: var(--secondary-hover);
}

.popular-badge {
    position: absolute;
    top: -1px; 
    right: -1px;
    background-color: var(--secondary-color);
    color: var(--dark-bg);
    padding: 0.5rem 1.2rem; 
    font-size: 0.7rem; 
    font-weight: bold;
    text-transform: uppercase;
    border-top-right-radius: var(--border-radius); 
    border-bottom-left-radius: var(--border-radius);
    z-index: 2; 
}

.plan-card h3 {
    font-size: 1.6rem;
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

.plan-pricing {
    margin-bottom: 1.5rem; 
    min-height: 160px; 
    display: flex; 
    flex-direction: column;
    justify-content: center; 
}
.price-option {
    display: none;
}
.price-option.active {
    display: block;
}
.plan-partner-pricing { /* Para el plan partner que no tiene switcher */
    margin-bottom: 0; 
    /* Ajustar min-height si es necesario para alinear el botón */
    min-height: calc(160px + 2.5rem + 0.6rem); /* Altura del pricing + altura aproximada del switcher + margen */
}


.price-label-above {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: -0.25rem; 
    font-weight: 300;
}

.plan-card .price-amount {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.1; 
}
.price-option[data-option="flex"] .price-amount { 
    font-size: 2.2rem; 
}


.plan-card.popular .price-amount {
    color: var(--secondary-color); 
}

.plan-card .price-period {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 300;
}

.plan-card .plan-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0; 
    line-height: 1.5; 
}
.price-option[data-option="flex"] .plan-description {
    font-size: 0.85rem; 
}


.plan-switcher {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem; 
    background-color: rgba(0,0,0,0.2);
    border-radius: 6px;
    padding: 0.3rem;
    height: 2.5rem; /* Altura fija para el switcher */
    box-sizing: border-box;
}
.plan-switcher-placeholder { /* Para el plan Partner */
    height: 2.5rem; /* Misma altura que .plan-switcher */
    margin-bottom: 1.5rem; /* Mismo margen que .plan-switcher */
}


.switch-btn {
    flex: 1;
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.switch-btn.active {
    background-color: var(--primary-color);
    color: var(--text-darker);
}
.plan-card.popular .switch-btn.active {
    background-color: var(--secondary-color);
}

.plan-card .cta {
    margin-top: auto; 
}

.view-all-plans-container {
    text-align: center;
    margin-top: 2.5rem;
}


/* --- Featured Projects Section --- */
.featured-projects {
    padding: 4rem 1rem;
    max-width: 1200px;
    margin: 3rem auto;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden; 
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-light);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
}

.project-image {
    width: 100%;
    height: 220px;
    object-fit: cover; 
    display: block;
    filter: grayscale(30%) contrast(110%); 
    transition: filter var(--transition-speed);
}
.project-card:hover .project-image {
    filter: grayscale(0%) contrast(100%);
}


.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.project-description {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    min-height: 4.5em; 
}

.project-tag {
    display: inline-block;
    background-color: rgba(177, 128, 255, 0.15); 
    color: var(--primary-color);
    padding: 0.3rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}
.project-tag.tag-secondary { 
    background-color: rgba(100, 204, 197, 0.15); 
    color: var(--secondary-color);
}

.testimonial-cta {
    text-align: center;
    margin-top: 4rem;
    padding: 2.5rem; 
    background-color: var(--light-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--box-shadow-light);
}
.testimonial-cta p {
    font-size: 1.25rem; 
    color: var(--text-color);
    font-style: italic;
    margin-bottom: 0.75rem;
}
.testimonial-cta span {
    font-size: 0.95rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* --- FAQ Section --- */
.faq {
    padding: 4rem 1rem;
    max-width: 800px;
    margin: 3rem auto;
}

.faq-item {
    border: 1px solid var(--border-color);
    background: var(--light-bg);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: border-color var(--transition-speed);
    box-shadow: var(--box-shadow-light);
}
.faq-item:hover {
    border-color: var(--primary-color);
}

.faq-question {
    background: none;
    border: none;
    color: var(--text-color);
    padding: 1.25rem 1.5rem;
    width: 100%;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    outline: none;
    transition: background-color var(--transition-speed);
}
.faq-question:hover {
    background-color: rgba(255,255,255,0.03);
}

.faq-question::after {
    content: "+"; 
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%) rotate(0deg); 
    font-size: 1.5rem;
    color: var(--secondary-color); 
    transition: transform var(--transition-speed) ease, content var(--transition-speed) ease; 
}

.faq-item.open .faq-question::after {
    content: "−"; 
    transform: translateY(-50%) rotate(180deg); 
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    background: var(--dark-bg); 
    color: var(--text-muted);
    transition: max-height 0.4s ease-in-out; 
}

.faq-answer p {
    padding: 1rem 1.5rem; 
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1.7; 
}

/* --- Pre-Footer Section --- */
.pre-footer {
    background-color: var(--medium-bg); 
    padding: 4rem 2rem;
    margin-top: 4rem; 
    border-top: 1px solid var(--border-color);
}

.pre-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.pre-footer-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    max-width: 300px; 
}

.pre-footer-social {
    display: flex;
    gap: 1rem;
}

.pre-footer-social a {
    color: var(--text-muted);
    transition: color var(--transition-speed);
}

.pre-footer-social a:hover {
    color: var(--secondary-color); 
}

.pre-footer-social svg {
    width: 24px;
    height: 24px;
}

.pre-footer-links h4 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.pre-footer-links a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    transition: color var(--transition-speed);
}

.pre-footer-links a:hover {
    color: var(--primary-hover);
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--dark-bg); 
    color: #888; 
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color); 
}

/* --- Animation Utilities --- */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInAnimation 0.8s ease-out forwards;
}

.fade-in[data-delay] {
    animation-delay: calc(var(--delay, 0) * 1ms);
}

@keyframes fadeInAnimation {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    .hero {
        padding: 4rem 1rem; 
    }
    .core-values-grid, .plans-grid, .steps-container, .projects-grid {
        grid-template-columns: 1fr; 
    }
    .plan-card.popular .popular-badge {
        transform: rotate(30deg) translate(10px, -28px); 
        font-size: 0.65rem;
        padding: 0.3rem 1rem;
    }
    .section-title {
        margin-bottom: 1rem;
    }
    .section-subtitle {
        margin-bottom: 2rem;
    }
    .core-card, .plan-card, .faq-item, .step-card, .project-card {
        padding: 1.5rem;
    }
    .core-icon { 
        top: 1rem;
        right: 1rem;
    }
    .core-icon svg {
        width: 24px;
        height: 24px;
    }

    #hero-title {
        font-size: clamp(2.2rem, 6vw, 3.2rem); 
    }

    .faq-question {
        font-size: 1rem;
    }
    #typed-text {
        font-size: clamp(1.1rem, 3vw, 1.5rem);
    }

    .pre-footer-content {
        grid-template-columns: 1fr; 
        text-align: center; 
    }
    .pre-footer-info .logo, .pre-footer-description {
        margin-left: auto;
        margin-right: auto;
    }
    .pre-footer-social {
        justify-content: center; 
    }
    .pre-footer-links h4 {
        margin-top: 1.5rem; 
    }
}