:root {
    --color-aqua: #A0E7E5;
    --color-turquoise: #68D2C2;
    --color-teal: #0D6A62;
    --color-white: #FFFFFF;
    --color-light-gray: #f8f9fa;
    --color-dark-gray: #343a40;
    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    font-family: var(--font-family-sans-serif);
    background-color: #051422; /* Dark background for contrast */
    color: var(--color-dark-gray);
    overflow-x: hidden; /* Prevent horizontal scrollbar from animations */
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.fullscreen-block {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5%;
    position: relative; /* Needed for z-index on content */
    flex-direction: column; /* Allow content and footer-bottom to stack */
}

/* --- Header Styles --- */
#main-header {
    padding: 20px 0;
    transition: padding 0.3s ease-in-out, background-color 0.3s ease-in-out;
}

#main-header.header-scrolled {
    padding: 10px 0;
    background-color: rgba(255, 255, 255, 0.9); /* Scrolled header is light */
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#main-header .navbar-brand img {
    transition: all 0.3s ease-in-out;
    filter: invert(1) grayscale(1) brightness(2); /* Default: white logo for dark bg */
}

#main-header.header-on-light .navbar-brand img,
#main-header.header-scrolled .navbar-brand img {
    filter: none; /* Revert to original logo on light sections or when scrolled */
}

#main-header.header-scrolled .navbar-brand img {
    width: 120px !important;
}

.navbar-nav .nav-link {
    color: var(--color-light-gray); /* Default: light links for dark bg */
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    margin: 0 15px;
    transition: color 0.3s ease-in-out;
}

#main-header.header-on-light .navbar-nav .nav-link,
#main-header.header-scrolled .navbar-nav .nav-link {
    color: var(--color-dark-gray); /* Dark links for light sections */
}

#main-header.header-on-light .navbar-nav .nav-link.active,
#main-header.header-on-light .navbar-nav .nav-link:hover,
#main-header.header-scrolled .navbar-nav .nav-link.active,
#main-header.header-scrolled .navbar-nav .nav-link:hover {
    color: var(--color-teal); /* Highlight color for dark links */
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-turquoise);
    transition: width 0.3s ease-in-out;
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 100%;
}

.navbar-toggler {
    border: none;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28248, 249, 250, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

#main-header.header-on-light .navbar-dark .navbar-toggler-icon,
#main-header.header-scrolled .navbar-dark .navbar-toggler-icon {
     background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2840, 40, 40, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}


/* --- Hero Section Styles --- */
#home {
    color: var(--color-white);
}

#home::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(5, 20, 34, 0.6) 0%, rgba(5, 20, 34, 1) 100%);
    z-index: 0;
}

.hero-content {
    max-width: 800px;
    animation: fadeIn 1.5s ease-in-out;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 40px;
    color: var(--color-aqua);
}

.hero-cta .btn {
    margin: 0 10px;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
    border-width: 2px;
    transition: all 0.3s ease;
}

.hero-cta .btn-primary {
    background-color: var(--color-turquoise);
    border-color: var(--color-turquoise);
    color: var(--color-dark-gray);
}

.hero-cta .btn-primary:hover {
    background-color: var(--color-aqua);
    border-color: var(--color-aqua);
    transform: translateY(-3px);
}

.hero-cta .btn-outline-light {
    border-color: var(--color-turquoise);
    color: var(--color-turquoise);
}

.hero-cta .btn-outline-light:hover {
    background-color: var(--color-turquoise);
    color: var(--color-dark-gray);
    transform: translateY(-3px);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Content Section Styles --- */
.content-section {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.bg-light-gray {
    background-color: rgba(248, 249, 250, 0.95) !important;
}

.bg-dark-gray {
    background-color: rgba(52, 58, 64, 0.95) !important;
}

.section-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--color-dark-gray);
}

.section-title.text-white {
    color: var(--color-white);
}

.section-subtitle {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
}

.section-subtitle.text-white-50 {
    color: rgba(255, 255, 255, 0.6) !important;
}

.content-section .btn-primary {
    background-color: var(--color-teal);
    border-color: var(--color-teal);
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
}

.content-section .btn-primary:hover {
    background-color: #0F7A71;
    border-color: #0F7A71;
    transform: translateY(-3px);
}

/* --- Benefit Cards (Candidates Section) --- */
.benefit-card {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.benefit-icon {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--color-turquoise);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.benefit-text h5 {
    font-weight: 600;
    margin-bottom: 5px;
}

.benefit-text p {
    margin-bottom: 0;
    color: #555;
}

/* --- Service Items (Companies Section) --- */
.service-item {
    padding: 25px;
    margin-bottom: 20px;
    border-left: 3px solid var(--color-turquoise);
    transition: all 0.3s ease;
}

.service-item:hover {
    background-color: var(--color-white);
    transform: translateX(10px);
}

.service-item h5 {
    font-weight: 600;
    color: var(--color-teal);
}

.service-item p {
    margin-bottom: 0;
    color: #555;
}

/* --- Tech Tags (IT Recruiting Section) --- */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.tech-tags .badge {
    font-size: 1rem;
    padding: 0.6em 1em;
    border-radius: 50px;
    background-color: var(--color-aqua);
    color: var(--color-dark-gray);
    font-weight: 500;
}

/* --- Client Carousel Section --- */
#clientes {
    background-color: var(--color-white);
    padding: 80px 0;
    height: auto;
    min-height: auto;
}

.client-carousel .slick-slide {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
}

.client-carousel img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.8;
    transition: all 0.3s ease-in-out;
}

.client-carousel .slick-slide:hover img {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

.text-link {
    color: var(--color-teal);
    text-decoration: none;
    font-weight: 500;
}

.text-link:hover {
    text-decoration: underline;
}

/* --- Contact & Footer Section --- */
.contact-link {
    color: var(--color-aqua);
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--color-white);
}

.btn-success {
    background-color: #25D366;
    border-color: #25D366;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 50px;
}

.btn-success:hover {
    background-color: #1EBE57;
    border-color: #1EBE57;
}

.footer-bottom {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
}

/* --- Scroll Animations --- */
.animate-on-scroll {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: none;
}

.animate-on-scroll.from-left {
    transform: translateX(-50px);
}

.animate-on-scroll.from-right {
    transform: translateX(50px);
}

.animate-on-scroll.from-bottom {
    transform: translateY(50px);
}

/* --- Contact Form Page Styles --- */
body.contact-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #051422;
    color: var(--color-white);
}

.contact-main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 120px;
    padding-bottom: 60px;
}

.contact-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-white);
}

.contact-subtitle {
    font-size: 1.2rem;
    color: var(--color-aqua);
    margin-bottom: 30px;
}

.form-progress-bar-container {
    max-width: 700px;
    margin: 0 auto 40px auto;
}

.form-progress-bar {
    width: 100%;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.form-progress {
    height: 100%;
    width: 0;
    background-color: var(--color-turquoise);
    transition: width 0.4s ease-out;
    border-radius: 5px;
}

.form-container {
    width: 100%;
    max-width: 700px;
    position: relative;
    height: 250px;
    margin: 0 auto;
}

.form-slides {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.form-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    transform: scale(0.98);
    pointer-events: none;
}

.form-slide.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.form-label {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-aqua);
}

.form-control-lg {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--color-turquoise);
    border-radius: 0;
    color: var(--color-white);
    font-size: 1.5rem;
    text-align: center;
    padding: 10px 0;
    box-shadow: none !important;
    width: 100%;
    max-width: 500px; /* Limit max width */
}

textarea.form-control-lg {
    height: 120px; /* Give textarea a fixed height */
    resize: none;
}

.form-navigation {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 10;
}

.form-navigation .btn {
    background-color: var(--color-turquoise);
    border-color: var(--color-turquoise);
    color: var(--color-dark-gray);
}

.success-message h3 {
    font-size: 2.5rem;
    color: var(--color-aqua);
}

.success-message .btn-primary {
    background-color: var(--color-turquoise);
    border-color: var(--color-turquoise);
    color: var(--color-dark-gray);
}

.form-error-message {
    display: none; /* Hidden by default */
    background-color: #ff4d4d26;
    color: #ffc4c4;
    border: 1px solid #ff4d4d;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.form-error-message.visible {
    display: block;
}

.contact-footer {
    text-align: center;
    padding: 20px;
    color: rgba(255, 255, 255, 0.4);
    background-color: #051422;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .hero-cta .btn {
        margin-bottom: 15px;
    }

    .fullscreen-block {
        height: auto;
        min-height: 100vh;
        padding-top: 120px;
        padding-bottom: 80px;
    }

    #home.fullscreen-block {
        min-height: 100vh;
        padding-top: 0;
        padding-bottom: 0;
    }

    .section-title {
        font-size: 2.2rem;
    }

    .text-lg-start {
        text-align: center !important;
    }

    .benefit-card, .service-item {
        margin-bottom: 20px;
    }

    #candidatos .col-lg-5, #consulting-services .col-lg-6 {
        margin-bottom: 40px;
    }
}

@media (max-width: 768px) {
    .contact-title {
        font-size: 2.2rem;
    }
    .form-label {
        font-size: 1.5rem;
    }
    .form-control-lg {
        font-size: 1.2rem;
    }
    .form-container {
        height: 200px;
    }
}

main {
    overflow-x: clip; /* Prevent horizontal scroll from animations */
}

/* =================================
   Mobile Overrides
   ================================= */
@media (max-width: 991.98px) {
    /* --- General Section Spacing & Vertical Alignment --- */
    .fullscreen-block {
        height: auto; /* Let content define height */
        min-height: 100vh; /* Use full height to allow proper centering */
        padding-top: 120px; /* Space for fixed header */
        padding-bottom: 80px;
        display: flex;
        flex-direction: column; /* Stack content vertically */
        justify-content: center; /* Center content vertically */
        align-items: center; /* Center content horizontally */
    }

    #home.fullscreen-block {
        padding-top: 0;
        padding-bottom: 0;
    }

    .section-title {
        font-size: 2.5rem; /* Slightly smaller titles on tablets */
    }

    /* --- Hero Buttons --- */
    .hero-cta .btn {
        display: block;
        margin-left: auto;
        margin-right: auto;
        max-width: 300px; /* Prevent buttons from being too wide */
    }
    .hero-cta .btn:first-child {
        margin-bottom: 15px; /* Add space between the two buttons */
    }

    /* --- Candidate & Consulting Section Alignment --- */
    #candidatos .text-lg-start,
    #consulting-services .text-lg-start {
        text-align: center !important; /* Force center alignment */
    }

    #candidatos .col-lg-5,
    #consulting-services .col-lg-6 {
        margin-bottom: 40px; /* Add space between text and cards/items */
    }

    .benefit-card, .service-item {
        text-align: left; /* Keep card text left-aligned */
    }
    
    .service-item:hover {
        transform: none; /* Disable hover effect on mobile */
    }

    /* Disable horizontal scroll animations on mobile to prevent overflow */
    .animate-on-scroll.from-left,
    .animate-on-scroll.from-right {
        transform: none;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: 2.8rem; /* Adjust hero title for smaller screens */
    }

    .section-title {
        font-size: 2.1rem; /* Adjust section titles */
    }

    /* --- Footer Contact Links --- */
    #contacto .contact-link {
        display: block; /* Each link on its own line */
        margin: 10px 0;
    }
    #contacto .contact-link + .mx-3 {
        display: none; /* Hide the separator */
    }
}

    .contact-info .contact-link {
        display: block;
        margin-bottom: 10px;
    }
    .contact-info .mx-3 {
        display: none;
    }
}
