/* --- VARIABLES CSS & RESET --- */
:root {
    --primary-color: #2563EB;
    --secondary-color: #7C3AED;
    --dark-bg: #111827;
    --light-bg: #F9FAFB;
    --text-color: #374151;
    --heading-color: #1F2937;
    --white: #ffffff;
    --transition: all 0.3s ease;
    --container-width: 1200px;
    --error-color: #DC2626;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
}

h1, h2, h3, h4 {
    font-family: 'Poppins', sans-serif;
    color: var(--heading-color);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

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

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* MENSAJES DE ERROR */
.error-message {
    display: block;
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
}

.form-group input.invalid,
.form-group textarea.invalid {
    border-color: var(--error-color);
}

/* --- HEADER --- */
header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 15px 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--heading-color);
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

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

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--heading-color);
}

/* --- HERO SECTION --- */
#hero {
    padding: 160px 0 100px;
    background: linear-gradient(180deg, #EFF6FF 0%, #FFFFFF 100%);
    text-align: center;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: -webkit-linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #6B7280;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* --- SERVICES --- */
#servicios {
    padding: 100px 0;
    background-color: var(--white);
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.section-title p {
    color: #6B7280;
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.service-card {
    background: var(--white);
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 40px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 25px;
}

.icon-n8n { color: #EA4B71; }
.icon-pbi { color: #F2C811; }

.service-card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

/* --- BENEFITS --- */
#beneficios {
    background-color: var(--light-bg);
    padding: 100px 0;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.benefit-item i {
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin-top: 5px;
    background: #EDE9FE;
    padding: 10px;
    border-radius: 50%;
}

/* --- PORTFOLIO --- */
#portafolio {
    padding: 100px 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden;
    border: 1px solid #E5E7EB;
}

.portfolio-content {
    padding: 25px;
}

.tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: inline-block;
}

.tag-auto { background-color: #FEE2E2; color: #991B1B; }
.tag-data { background-color: #FEF3C7; color: #92400E; }

.portfolio-card h3 {
    margin-bottom: 10px;
}

.case-detail {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.case-detail strong {
    color: var(--heading-color);
}

/* --- ABOUT ME --- */
#sobre-mi {
    padding: 100px 0;
    background: var(--dark-bg);
    color: var(--white);
}

.about-container {
    display: flex;
    gap: 50px;
    align-items: center;
}

.about-text h2 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.about-text p {
    color: #D1D5DB;
    margin-bottom: 20px;
}

.tech-stack {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.tech-stack i {
    font-size: 2rem;
    opacity: 0.8;
    transition: var(--transition);
}

.tech-stack i:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* --- CONTACT --- */
#contacto {
    padding: 100px 0;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background: var(--white);
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border-radius: 20px;
    padding: 50px;
    border: 1px solid #E5E7EB;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.contact-link i {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.social-links a {
    font-size: 1.5rem;
    color: #6B7280;
    transition: var(--transition);
}

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

form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* --- FOOTER --- */
footer {
    text-align: center;
    padding: 30px 0;
    background-color: var(--light-bg);
    border-top: 1px solid #E5E7EB;
    font-size: 0.9rem;
    color: #6B7280;
}

/* --- BOTÓN FLOTANTE WHATSAPP --- */
.btn-whatsapp {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 35px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    transform: scale(1.1);
    color: white; 
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* --- POP-UP LEAD MAGNET --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.popup-content {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    border-top: 5px solid var(--secondary-color);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 25px;
    font-weight: bold;
    color: #9CA3AF;
    cursor: pointer;
    transition: 0.3s;
    background: none;
    border: none;
}

.close-popup:hover { 
    color: var(--heading-color); 
}

.popup-content h3 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--heading-color);
}

.popup-content p {
    color: #6B7280;
    margin-bottom: 25px;
    font-size: 0.95rem;
}

.popup-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 1rem;
}

.small-print {
    font-size: 0.75rem;
    color: #9CA3AF;
    margin-top: 15px;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    .about-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        right: 0px;
        height: 100vh;
        top: 0px;
        background-color: var(--white);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 70%;
        transform: translateX(100%);
        transition: transform 0.5s ease-in;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        transform: translateX(0%);
    }

    .hamburger {
        display: block;
        z-index: 1001;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }
}
