/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700;900&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- DESIGN SYSTEM & VARIABLES --- */
:root {
    /* Colors - Dark Theme */
    --bg-main: #0B0B0E;
    --bg-card: #15151A;
    --bg-input: #1F1F26;
    --border-color: #2A2A35;

    --text-primary: #FFFFFF;
    --text-secondary: #A0A0AB;
    --text-muted: #5E5E6B;

    --accent-primary: #2DD4BF;
    /* Mint green */
    --accent-secondary: #22A882;

    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-main: 'Inter', sans-serif;

    /* Layout */
    --container-width: 1200px;
    --section-padding: 100px 24px;
    --border-radius-md: 12px;
    --border-radius-lg: 24px;

    /* Transitions */
    --transition-fast: 0.2s ease;
}

/* --- RESETS & GLOBALS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 80px;
    /* Compensate for fixed navbar */
}

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

ul {
    list-style: none;
}

/* --- UTILITIES --- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
}

.section {
    padding: var(--section-padding);
}

.bg-card {
    background-color: var(--bg-main);
}

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Typography */
.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 24px;
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 64px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-primary {
    background-color: var(--accent-primary);
    color: #000;
    border: 1px solid var(--accent-primary);
}

.btn-primary:hover {
    background-color: #FFFFFF;
    color: var(--accent-primary);
    border-color: #FFFFFF;
}

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

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

/* --- NAVBAR --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(11, 11, 14, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    padding: 16px 24px;
}

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

.navbar-brand {
    display: flex;
    align-items: center;
}

.navbar-logo {
    height: 50px;
    width: auto;
}

.navbar-menu {
    display: flex;
    gap: 32px;
}

.nav-link {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.nav-link:hover {
    color: var(--accent-primary);
}

.nav-btn {
    padding: 10px 20px;
    font-size: 0.875rem;
}

/* --- HELPER COMPONENTS --- */
.mobile-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px;
}

.back-to-top {
    position: fixed;
    bottom: -60px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--accent-primary);
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    bottom: 24px;
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(45, 212, 191, 0.5);
}


/* --- COMPONENTS: CARDS --- */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: 0 0 25px rgba(45, 212, 191, 0.4), inset 0 0 10px rgba(45, 212, 191, 0.1);
}

.card-icon {
    font-size: 2.5rem;
    color: var(--accent-primary);
    margin-bottom: 24px;
    display: inline-block;
}

.card-icon img {
    width: 50px;
}

.service-icon {
    height: 35px;
    margin-bottom: 24px;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.card-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- SECTIONS --- */

/* Hero */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-image: linear-gradient(rgba(11, 11, 14, 0.55), rgba(11, 11, 14, 0.55)), url(../assets/images/herobackground.jpg);
    background-blend-mode: multiply;
    background-size: cover;
    background-position: center;
    padding: var(--section-padding);
}

/* Faux background blur to emulate the figma design */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: radial-gradient(circle at 80% 30%, rgba(46, 213, 165, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 20% 70%, rgba(100, 100, 255, 0.05) 0%, transparent 50%);
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
}


.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.25rem, 5vw, 3.75rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 24px;
}

.muted-title {
    color: #2DD4BF;
    font-size: 12px;
    background-color: hsl(180, 100%, 10%);
    border-radius: 9999px;
    padding: 4px 12px;
}

.emphasis {
    font-style: italic;
    color: var(--accent-primary);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 16px;
}


/* RESPONSIVE */
@media (max-width: 900px) {

    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero {
        padding: 100px 48px;
    }

    .footer {
        padding: 40px 48px;
    }
}

@media (max-width: 820px) {
    .mobile-toggle {
        display: block;
    }

    .navbar-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(11, 11, 14, 0.98);
        border-bottom: 1px solid var(--accent-primary);
        flex-direction: column;
        text-align: center;
        padding: 24px 0;
        gap: 24px;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    .navbar-menu.active {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    /* Dropdown mobile styles */
    .has-dropdown .nav-link {
        justify-content: center;
    }

    .has-dropdown {
        display: flex;
        flex-direction: column;
    }

    .dropdown-menu {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
        width: 220px;
        opacity: 0;
        pointer-events: none;
        background: #1A1A20;
        border: none !important;
        outline: none !important;
        border-radius: 12px;
        box-shadow: none;
        padding: 6px;
        margin: auto;
        min-width: auto;
    }

    .dropdown-menu::before {
        display: none !important;
    }

    .has-dropdown.open .dropdown-menu {
        opacity: 1;
        pointer-events: auto;
    }

    .has-dropdown:not(.open) .dropdown-menu {
        display: none;
    }

    .dropdown-item {
        padding: 10px 16px;
        text-align: center;
        border-radius: 8px;
    }

    .dropdown-item:hover {
        background-color: rgba(45, 212, 191, 0.08);
        color: var(--accent-primary);
    }

    .hero {
        padding: 80px 24px;
        min-height: 70vh;
    }

    .footer {
        padding: 40px 24px;
    }

    .footer-container {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .copyright {
        flex-direction: column;
    }
}

@media (max-width: 600px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.5rem;
    }

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

    .hero-actions {
        flex-direction: column;
    }

    .nav-btn {
        display: none;
        /* Ocultar botón de presupuesto en navbar si la pantalla es muy pequeña */
    }
}

/* --- HELPERS --- */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.mx-auto {
    margin-inline: auto;
}

/* Override .section-description mx-auto for centered headers */
.text-center .section-description {
    margin-left: auto;
    margin-right: auto;
}

/* --- PROCESS METHODOLOGY SECTION --- */
.process-step {
    position: relative;
    padding-top: 40px;
    text-align: center;
}

.step-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03);
    /* Huge muted number behind the text */
    z-index: 0;
    pointer-events: none;
    font-family: inherit;
    letter-spacing: -5px;
}

.step-title {
    font-family: var(--font-heading);
    color: var(--accent-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.process-step .card-text {
    position: relative;
    z-index: 1;
}

/* --- PARTNER BANNER --- */
.partner-banner {
    padding-top: 40px;
    padding-bottom: 40px;
}

.banner-container {
    background-color: var(--accent-primary);
    border-radius: var(--border-radius-lg);
    padding: 48px 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
    gap: 32px;
}

/* Subtle glowing orb / watermark background */
.banner-container::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/bannertexture.png');
    background-size: auto 100%;
    /* Para que alcance a cubrir la altura o se mantenga estético */
    background-position: top right;
    background-repeat: no-repeat;
    opacity: 0.15;
    /* Un poco de opacidad para mezclar la textura */
    pointer-events: none;
    z-index: 0;
}

.banner-content {
    position: relative;
    z-index: 1;
    max-width: 60%;
}

.banner-title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 900;
    color: var(--bg-card);
    margin-bottom: 12px;
    line-height: 1.2;
}

.banner-text {
    font-size: 1.125rem;
    color: rgba(21, 21, 26, 0.8);
    /* Slightly transparent dark text */
    margin-bottom: 0;
}

.banner-action {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.banner-btn.btn {
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 16px 32px;
    font-weight: 600;
    border-radius: 12px;
    box-shadow: none;
    border: none;
    transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.banner-btn.btn:hover {
    background-color: var(--border-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
    .banner-container {
        flex-direction: column;
        text-align: center;
        padding: 40px 32px;
    }

    .banner-content {
        max-width: 100%;
        margin-bottom: 32px;
    }
}

/* --- FAQ SECTION --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
}

.faq-item {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.faq-item:hover {
    border-color: var(--text-muted);
}

.faq-question {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 24px;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-main);
    transition: background-color var(--transition-fast);
}

.faq-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.faq-item.active .faq-icon {
    transform: rotate(-180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: rgba(255, 255, 255, 0.02);
}

.faq-answer p {
    padding: 0 24px 24px 24px;
    color: var(--text-secondary);
}

.faq-item.active .faq-answer {
    max-height: 200px;
    /* Arbitrary enough to fit content */
}

/* --- CONTACT SECTION --- */
.contacto-grid {
    align-items: center;
}

.contacto-info {
    padding-right: 40px;
}

.contacto-list {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contacto-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.contacto-icon {
    color: var(--accent-primary);
    font-size: 1.25rem;
}

.contacto-icon img {
    width: 20px;
}

.mt-4 {
    margin-top: 32px;
}

.mt-2 {
    margin-top: 16px;
}

.w-100 {
    width: 100%;
}

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

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.social-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-2px);
}

.social-btn img {
    width: 20px;
}

/* Form Wrapper */
.contacto-form-wrapper {
    background-color: #1A1A1E;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #8A8A93;
    font-size: 0.875rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px;
    background-color: #222226;
    border: 1px solid #33333C;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-group select {
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position-x: 95%;
    background-position-y: 50%;
}

.form-group select option {
    background-color: #222226;
    color: var(--text-primary);
}

.form-submit-btn {
    padding: 18px;
    font-size: 1.125rem;
    border-radius: 12px;
}

/* --- FOOTER --- */
.footer {
    padding: 40px 24px;
    border-top: 1px solid var(--border-color);
}

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

.copyright {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: var(--container-width);
}

.avisos {
    display: flex;
    color: var(--text-secondary);
    font-size: 14px;
    gap: 10px;
}

/* --- DROPDOWN NAVIGATION (Home) --- */
.has-dropdown {
    position: relative;
}

.has-dropdown .nav-link {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.has-dropdown svg {
    transition: transform 0.2s ease;
}

.has-dropdown:hover svg,
.has-dropdown:focus-within svg,
.has-dropdown.open svg {
    transform: rotate(180deg);
}

/*
 * FIX GAP BUG: top:100% + padding-top:12px instead of top:calc(100%+12px).
 * The menu element starts right at the bottom of the trigger, so the mouse
 * never leaves the hover area while crossing the visual gap.
 */
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 6px;
    /* top padding = visual gap, no dead zone */
    min-width: 230px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 200;
}

/* Inner box — the visible panel */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: #1A1A20;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    z-index: -1;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.has-dropdown:hover .dropdown-menu,
.has-dropdown:focus-within .dropdown-menu,
.has-dropdown.open .dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    display: block;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
    /* sit above the ::before panel */
    z-index: 1;
}

.dropdown-item:hover {
    background-color: rgba(45, 212, 191, 0.08);
    color: var(--accent-primary);
}

/* --- CLICKABLE SERVICE CARDS --- */
.card.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.card.card-link:hover .card-cta {
    color: var(--accent-primary);
}

.card-cta {
    display: inline-block;
    margin-top: 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: color 0.2s ease;
}