/* CSS Variables */
:root {
    --primary-color: #0f172a;
    /* Slate 900 */
    --secondary-color: #3b82f6;
    /* Blue 500 */
    --accent-color: #2563eb;
    /* Blue 600 */
    --text-main: #0f172a;
    /* Slate 900 (más oscuro) */
    --text-muted: #475569;
    /* Slate 600 (más contraste) */
    --bg-light: #f8fafc;
    /* Slate 50 */
    --white: #ffffff;
    --border-color: #cbd5e1;
    /* Slate 300 (más definido) */
    --error-color: #dc2626;
    /* Red 600 */

    --font-family: 'Inter', sans-serif;
    --transition-speed: 0.3s;
    --border-radius: 16px;
    --header-height: 80px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Navbar Layer */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(255, 255, 255, 0.85);
    /* Blanco con 85% opacidad */
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    /* Sombra más sutil */
}

.main-header.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    height: 70px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 4%;
    display: flex;
    justify-content: flex-start;
    /* Alineado a la izquierda */
    align-items: center;
    gap: 2.5rem;
    /* Espacio entre logo y menú reducido en un 35% */
}

.logo img {
    height: 44px;
    /* +10% para mayor impacto visual */
    width: auto;
    display: block;
    transition: height 0.3s ease;
}

.main-header.scrolled .logo img {
    height: 50px;
}

/* Navigation Menu */
.nav-menu ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

.nav-menu ul li a {
    text-decoration: none;
    color: var(--primary-color);
    /* Texto oscuro para fondo blanco */
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    /* text-transform: uppercase; - Eliminado para Sentence Case */
    transition: color var(--transition-speed) ease;
    padding: 0.5rem 0;
    position: relative;
}

.nav-menu ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-menu ul li a:hover {
    color: var(--secondary-color);
}

.nav-menu ul li a:hover::after {
    width: 100%;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    /* Hamburguesa oscura */
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Background Layer Management */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('bg-image.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
}

.background-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    z-index: -1;
}

/* Page Layout */
.landing-container {
    padding-top: calc(var(--header-height) + 60px);
    /* Separación aumentada (mínimo 1cm+) */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    position: relative;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 5rem;
    z-index: 1;
    animation: fadeIn 0.8s ease-out backwards;
}

.content-wrapper {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.main-title {
    color: var(--white);
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    max-width: 700px;
}

/* Form Panel */
.form-panel {
    background-color: rgba(255, 255, 255, 0.85);
    /* Mayor transparencia (85%) */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 2.5rem;
    width: 100%;
    max-width: 800px;
    /* Incrementado para doble columna */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0 auto;
}

.form-header {
    margin-bottom: 2rem;
    text-align: center;
}

.form-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.form-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

.mandatory-note {
    font-size: 0.8rem !important;
    color: #ef4444 !important;
    font-weight: 500;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

/* Campos que ocupan todo el ancho (Mensaje, Privacidad, Botón) */
.full-width,
.privacy-checks,
.submit-btn {
    grid-column: span 2;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.4rem;
}

.required {
    color: #ef4444;
    margin-left: 2px;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--font-family);
    font-size: 1rem;
    color: var(--text-main);
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    outline: none;
    transition: all var(--transition-speed) ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--secondary-color);
    background-color: var(--white);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

/* Error Styling */
.field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.error-msg {
    display: none;
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.35rem;
    font-weight: 500;
}

.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select {
    border-color: var(--error-color);
    background-color: #fef2f2;
}

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

/* reCAPTCHA specific spacing */
.g-recaptcha {
    margin-top: 0.5rem;
    display: flex;
    justify-content: center;
}

@media (max-width: 576px) {
    .g-recaptcha {
        transform: scale(0.85);
        transform-origin: center center;
    }
}

/* Custom Select */
.select-wrapper {
    position: relative;
}

select {
    appearance: none;
    cursor: pointer;
    padding-right: 2.5rem;
}

.custom-arrow {
    position: absolute;
    top: 50%;
    right: 1.2rem;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    pointer-events: none;
}

/* Privacy Checkboxes */
.privacy-checks {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.check-group {
    position: relative;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    user-select: none;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    min-width: 18px;
    height: 18px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.checkbox-container:hover input~.checkmark {
    border-color: var(--secondary-color);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.label-text a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.label-text a:hover {
    text-decoration: underline;
}

.check-group.has-error .checkmark {
    border-color: var(--error-color);
    background-color: #fef2f2;
}

.check-group.has-error .error-msg {
    display: block;
    margin-bottom: 0.5rem;
}

/* Submit Button */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.125rem;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.submit-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

.privacy-disclaimer {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.4;
}

.privacy-disclaimer a {
    color: var(--secondary-color);
    text-decoration: underline;
    font-weight: 500;
}

/* Success Message */
.success-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem 0;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s ease-out;
}

.success-message h3 {
    font-size: 1.7rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.success-message p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.success-message.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.success-icon {
    width: 60px;
    height: 60px;
    background-color: #22c55e;
    color: white;
    font-size: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* Mobile Responsive */
/* SEO Footer & Legal (Discreet) */
.seo-footer {
    width: 100%;
    padding: 3rem 2rem;
    text-align: center;
    background: transparent;
    position: relative;
    z-index: 10;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.seo-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    line-height: 1.6;
    font-weight: 300;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.legal-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
}

.legal-links a:hover {
    color: var(--white);
    text-decoration: underline;
}

.social-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: 1rem;
}

.social-links a {
    color: var(--text-muted);
    transition: color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
}

.social-links svg {
    width: 20px;
    height: 20px;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .legal-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .social-links {
        margin-left: 0;
        margin-top: 1rem;
        justify-content: center;
    }
}

.credits {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.75rem;
}

.integra-cloud {
    color: var(--white);
    font-weight: 700;
}

@media (max-width: 768px) {
    .contact-form {
        grid-template-columns: 1fr;
    }

    .full-width,
    .privacy-checks,
    .submit-btn {
        grid-column: span 1;
    }
}

@media (max-width: 992px) {
    .menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--primary-color);
        display: flex;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .nav-menu ul li a {
        font-size: 1.5rem;
    }

    .menu-toggle.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

@media (max-width: 576px) {
    body {
        padding: 0;
    }

    .main-title {
        font-size: 1.75rem;
        padding: 0 1rem;
    }

    .landing-container {
        padding-top: calc(var(--header-height) + 40px);
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .form-panel {
        padding: 2.5rem 1.5rem;
        border-radius: 20px;
    }

    .form-header h2 {
        font-size: 1.75rem;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--white);
    width: 90%;
    max-width: 600px;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--error-color);
}

.modal-body {
    color: var(--text-main);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    text-align: justify;
    /* Texto justificado */
}

.modal-body p {
    margin-bottom: 1rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.btn-close-modal {
    padding: 0.75rem 2rem;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-close-modal:hover {
    opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}