:root {
    /* Paleta Dark Luxury */
    --bg-primary: #000000;
    --bg-secondary: #070A10;
    --card-bg: #0B1220;
    --border-color: rgba(255, 255, 255, 0.08);

    --text-primary: #FFFFFF;
    --text-secondary: #C9D4F0;

    --accent-primary: #06B6D4;
    /* Cian Premium */
    --accent-secondary: #3B82F6;
    /* Azul Confianza */

    --success: #22C55E;
    --warning: #F59E0B;

    /* Typography */
    --font-heading: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --border-radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    line-height: 1.2;
}

h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.text-accent {
    color: var(--accent-primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 1rem;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #FFFFFF;
    box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.btn-sticky {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 99;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.scroll-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 45px;
    height: 45px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--accent-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background: var(--accent-primary);
    color: #fff;
    transform: translateY(-5px);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(7, 10, 16, 0.9);
    border-bottom-color: var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo img {
    height: 40px;
}

.nav-cta {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-primary);
}

.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 1.5rem;
}

.lang-switcher a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.lang-switcher a:hover,
.lang-switcher a.active {
    color: var(--accent-primary);
}

.lang-switcher span {
    opacity: 0.3;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        /* Hide for now on mobile or add mobile menu later if needed */
    }
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
    background: radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.1) 0%, rgba(0, 0, 0, 0) 60%);
    overflow: hidden;
}

.hero-content {
    flex: 1;
    z-index: 2;
    padding-right: 2rem;
}

.hero-label {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-visual img {
    max-width: 120%;
    margin-right: -20%;
    animation: float 6s ease-in-out infinite;
    filter: drop-shadow(0 0 50px rgba(6, 182, 212, 0.2));
}

/* Cases Section */
.cases-section {
    padding: 6rem 0;
    background-color: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.case-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.case-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(6, 182, 212, 0.3);
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.case-card:hover::before {
    transform: scaleX(1);
}

/* Services Flip Cards */
.services-section {
    padding: 6rem 0;
    background: var(--bg-primary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.flip-card {
    background-color: transparent;
    height: 400px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.flip-card-front {
    background-color: var(--card-bg);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.flip-card-front img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    opacity: 0.8;
}

.flip-card-details {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flip-card-back {
    background: linear-gradient(135deg, var(--bg-secondary), #0d1626);
    color: white;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    border: 1px solid var(--accent-primary);
}

/* Methodology */
.methodology-section {
    padding: 6rem 0;
    background-color: var(--bg-secondary);
}

.steps-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 3rem;
}

.step-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    position: relative;
}

.step-number {
    font-size: 3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.05);
    position: absolute;
    top: 1rem;
    right: 1.5rem;
}

/* About Section */
.about-section {
    padding: 6rem 0;
    background: var(--bg-primary);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

/* Contact/Form Section */
.contact-section {
    padding: 6rem 0;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-form {
    background: var(--card-bg);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    transition: border-color 0.3s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.form-checkbox-group {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.form-checkbox {
    margin-top: 0.2rem;
}

/* Phone field with country code */
.phone-group {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    /* overflow: hidden; <-- ELIMINADO para que el dropdown se vea */
    transition: border-color 0.3s;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 20;
    /* Asegurar que flote sobre otros inputs */
}

/* Redondear esquina izquierda del trigger */
.custom-select-trigger {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

/* Redondear esquina derecha del input */
.phone-number-input {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.phone-group:focus-within {
    border-color: var(--accent-primary);
}

/* Custom Phone Select (Fixes Windows flag issue) */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 140px;
    /* Ancho ajustable */
    border-right: 1px solid var(--border-color);
}

.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0.75rem;
    font-size: 0.9rem;
    cursor: pointer;
    height: 100%;
    color: var(--text-primary);
    background: rgba(6, 182, 212, 0.05);
    transition: background 0.2s;
}

.custom-select-trigger:hover {
    background: rgba(6, 182, 212, 0.1);
}

.custom-select-trigger span.fi {
    font-size: 1.2em;
    /* Bandera un poco más grande */
    margin-right: 8px;
    border-radius: 2px;
}

/* Flecha custom */
.custom-select-trigger::after {
    content: '';
    width: 10px;
    height: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2306B6D4' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    margin-left: 8px;
    margin-left: 8px;
}

/* Buscador dentro del dropdown */
.custom-search-container {
    padding: 0.5rem;
    position: sticky;
    top: 0;
    background: #0B1220;
    z-index: 55;
    border-bottom: 1px solid var(--border-color);
}

.custom-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.5rem;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    font-family: var(--font-body);
}

.custom-search-input:focus {
    border-color: var(--accent-primary);
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    z-index: 50;
    max-height: 280px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    margin-top: 4px;
    width: 250px;
}

/* Scrollbar dark */
.custom-options::-webkit-scrollbar {
    width: 6px;
}

.custom-options::-webkit-scrollbar-track {
    background: #000;
}

.custom-options::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover,
.custom-option.selected {
    background: rgba(6, 182, 212, 0.1);
    color: #fff;
}

.custom-option .fi {
    margin-right: 10px;
    font-size: 1.2em;
    border-radius: 2px;
}

.phone-number-input {
    flex: 1;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
}

.phone-number-input::placeholder {
    color: #475569;
}


/* Footer & Legal */
footer {
    padding: 4rem 0 2rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    margin-left: 2rem;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* Animations */
@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(1deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .hero {
        flex-direction: column;
        padding-top: calc(var(--header-height) + 2rem);
        text-align: center;
    }

    .hero-content {
        padding-right: 0;
        margin-bottom: 3rem;
    }

    .hero-visual img {
        max-width: 100%;
        margin-right: 0;
    }

    .steps-container {
        flex-direction: column;
    }

    .contact-layout {
        grid-template-columns: 1fr;
    }
}

/* FAQ Section */
.faq-section {
    padding: 6rem 0;
    background: var(--bg-primary);
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
}

.faq-question {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    padding: 0;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    margin-top: 1rem;
}

.faq-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    color: var(--accent-primary);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* 2-Step Form */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

.form-navigation {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-progress {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.progress-dot {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
}

.progress-dot.active {
    background: var(--accent-primary);
}

/* Image fallback styling */
.img-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px dashed var(--border-color);
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(7, 10, 16, 0.95);
    backdrop-filter: blur(15px);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cookie-banner.visible {
    transform: translateY(0);
}

.cookie-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 700px;
}

.cookie-content a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.btn-sm {
    padding: 0.5rem 1.25rem;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .cookie-container {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .cookie-banner {
        padding: 2rem 0;
    }
}