/* --- VARIABLES & RESET --- */
:root {
    --bg-main: #121214;
    --bg-surface: #1E1E24;
    --bg-darker: #0c0c0e;
    
    --accent-purple: #5D2593;
    --accent-purple-hover: #7B2CBF;
    --accent-orange: #FF4500;
    --accent-orange-hover: #ff6026;
    
    --text-main: #F4F4F5;
    --text-muted: #A1A1AA;
    
    --font-main: 'Inter', sans-serif;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-main);
}

body {
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

/* --- UTILITIES --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: 6rem 0;
}

.section-darker {
    background-color: var(--bg-darker);
}

.accent-purple { color: var(--accent-purple); }
.accent-orange { color: var(--accent-orange); }

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--accent-orange);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--accent-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 69, 0, 0.4);
}

/* Typography Headings */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- HEADER & NAV --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    padding: 1.5rem 0;
    background: transparent;
}

header.scrolled {
    padding: 1rem 0;
    background: rgba(18, 18, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 45px; /* Ajusta este valor según el tamaño de tu logo */
    width: auto;
    object-fit: contain;
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu a {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--text-main);
}

.btn-nav {
    background-color: var(--bg-surface);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.1);
}
.btn-nav:hover {
    border-color: var(--accent-purple);
    color: var(--text-main);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- HERO SECTION --- */
#hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide.slide-1 {
    background-image: linear-gradient(rgba(18, 18, 20, 0.85), rgba(18, 18, 20, 0.85)), url('assets/background_hero1.jpg');
}

.carousel-slide.slide-2 {
    background-image: linear-gradient(rgba(18, 18, 20, 0.85), rgba(18, 18, 20, 0.85)), url('assets/background_hero2.jpg');
}

.carousel-slide.slide-3 {
    background-image: linear-gradient(rgba(18, 18, 20, 0.85), rgba(18, 18, 20, 0.85)), url('assets/background_hero3.jpg');
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    padding-top: 5rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.hero-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.highlight-item {
    background: rgba(30, 30, 36, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlight-item i {
    color: var(--accent-orange);
}

.cta-button {
    font-size: 1.1rem;
    padding: 1.2rem 2.5rem;
}

/* --- M.E.S. & OEE SECTION --- */
.oee-container {
    background-color: var(--bg-surface);
    border-radius: 12px;
    padding: 3rem;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.oee-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.oee-header h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--accent-purple);
}

.oee-formula {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: monospace;
    background: rgba(0,0,0,0.3);
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 8px;
    letter-spacing: 1px;
}

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

.oee-card {
    text-align: center;
    padding: 2rem 1rem;
    background-color: var(--bg-main);
    border-radius: 8px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.oee-card:hover {
    border-color: var(--accent-purple);
    transform: translateY(-5px);
}

.oee-icon {
    font-size: 2.5rem;
    color: var(--accent-orange);
    margin-bottom: 1.5rem;
}

.oee-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.oee-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* --- TRAYECTORIA (TIMELINE) --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    height: 100%;
    width: 2px;
    background: rgba(255,255,255,0.1);
}

.timeline-item {
    position: relative;
    padding-left: 60px;
    margin-bottom: 3rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 13px;
    top: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent-purple);
    border: 3px solid var(--bg-main);
    box-shadow: 0 0 0 3px rgba(93, 37, 147, 0.3);
}

.timeline-content {
    background-color: var(--bg-surface);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--accent-purple);
    transform: translateX(5px);
}

.timeline-year {
    display: inline-block;
    background-color: rgba(93, 37, 147, 0.2);
    color: var(--accent-purple);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
}

.timeline-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-muted);
    line-height: 1.6;
}

.dot-future {
    background-color: var(--accent-orange);
    box-shadow: 0 0 0 3px rgba(255, 69, 0, 0.3);
}

.content-future {
    border-left: 3px solid var(--accent-orange);
}

.year-future {
    background-color: rgba(255, 69, 0, 0.2);
    color: var(--accent-orange);
}

/* --- SERVICIOS --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.service-card {
    background-color: var(--bg-surface);
    padding: 2.5rem 2rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-orange));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

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

.service-icon {
    font-size: 2.5rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.service-card:hover .service-icon {
    color: var(--accent-purple);
}

.service-card:hover:nth-child(even) .service-icon {
    color: var(--accent-orange);
}

.service-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.service-desc {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* --- ARQUITECTURA --- */
.architecture-diagram {
    background-color: var(--bg-surface);
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-bottom: 3rem;
    overflow-x: auto;
}

.arch-flow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 800px; /* Ensure horizontal scroll on small devices */
}

.arch-step {
    text-align: center;
    width: 120px;
}

.arch-step i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    background: var(--bg-main);
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.1);
    transition: var(--transition);
}

.arch-step p {
    font-size: 0.9rem;
    font-weight: 600;
}

.arch-step:hover i {
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px rgba(255, 69, 0, 0.2);
}

.highlight-step i {
    color: var(--accent-purple);
    border-color: var(--accent-purple);
}

.arch-arrow {
    color: rgba(255,255,255,0.2);
    font-size: 1.5rem;
}

.case-study {
    background: linear-gradient(135deg, rgba(93, 37, 147, 0.1), rgba(255, 69, 0, 0.05));
    border: 1px solid rgba(93, 37, 147, 0.3);
    border-radius: 8px;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.case-study-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.case-study-content p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* --- CONTACTO --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-form-container {
    background-color: var(--bg-surface);
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.05);
    width: 100%;
}

.contact-branding-side {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.contact-branding-side img.side-logo {
    max-width: 100%;
    width: 380px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 35px rgba(93, 37, 147, 0.3));
    transition: var(--transition);
}

.contact-branding-side img.side-logo:hover {
    transform: scale(1.03);
    filter: drop-shadow(0 0 45px rgba(255, 69, 0, 0.35));
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background-color: var(--bg-main);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px;
    color: var(--text-main);
    font-family: var(--font-main);
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(93, 37, 147, 0.2);
}

.error-msg {
    display: none;
    color: #ff4d4f;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.form-group.error input,
.form-group.error textarea {
    border-color: #ff4d4f;
}

.form-group.error .error-msg {
    display: block;
}

.recaptcha-wrapper {
    margin-bottom: 1.5rem;
    min-height: 78px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.recaptcha-wrapper .g-recaptcha {
    line-height: normal;
}

.recaptcha-wrapper.error iframe {
    border: 1px solid #ff4d4f;
    border-radius: 4px;
}

.recaptcha-wrapper.error .error-msg {
    display: block;
}

.btn-submit {
    width: 100%;
}

.form-success {
    background-color: rgba(40, 167, 69, 0.2);
    color: #4ade80;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1.5rem;
    text-align: center;
    border: 1px solid #4ade80;
}
.form-success.hidden {
    display: none;
}


/* --- FOOTER --- */
footer {
    background-color: var(--bg-main);
    padding: 2rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}

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

.footer-note {
    margin-top: 0.5rem;
    font-size: 0.8rem !important;
    color: rgba(161, 161, 170, 0.6) !important;
}

/* --- SCROLL REVEAL (JS class) --- */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .hero-title { font-size: 3rem; }
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    .contact-branding-side {
        order: 2;
    }
    .contact-branding-side img.side-logo {
        width: 260px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: var(--bg-darker);
        flex-direction: column;
        transition: 0.4s ease;
        padding-top: 2rem;
    }
    .nav-menu.active { left: 0; }
    .nav-menu ul {
        flex-direction: column;
        gap: 1.5rem;
    }
    .mobile-menu-btn { display: block; }
    
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .oee-formula { font-size: 1rem; }
}
