/* =============================================
   CONTACT.CSS - D4T Applications
   Ubicación: /assets/css/sections/contact.css
   Estilos para la sección de contacto
   ============================================= */

/* ===========================================
   SECCIÓN PRINCIPAL
   =========================================== */
#contact {
    position: relative;
    padding: 100px 0;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    overflow: hidden;
}

.contact-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

/* ===========================================
   HEADER
   =========================================== */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-label {
    display: inline-block;
    padding: 8px 24px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    color: #667eea;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 20px;
    line-height: 1.2;
}

.section-title .highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-description {
    font-size: 1.125rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ===========================================
   WRAPPER PRINCIPAL
   =========================================== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

/* ===========================================
   FORMULARIO
   =========================================== */
.contact-form-container {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Filas del formulario */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Grupos del formulario */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    color: #e2e8f0;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Inputs base */
.form-control {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

/* WhatsApp input group */
.whatsapp-input-group {
    display: flex;
    gap: 8px;
    position: relative;
}

.country-select {
    width: 120px;
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.country-select:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.country-select option {
    background: #1a1a2e;
    color: #ffffff;
}

.phone-input {
    flex: 1;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Prevenir el desplazamiento del layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start; /* Cambiar de stretch a start */
}

/* ===========================================
   CHECKBOXES
   =========================================== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.checkbox-label:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.3);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
}

.checkbox-custom::after {
    content: '';
    position: absolute;
    display: none;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-custom::after {
    display: block;
    animation: checkmark-scale 0.3s ease-out;
}

@keyframes checkmark-scale {
    0% { transform: rotate(45deg) scale(0); }
    50% { transform: rotate(45deg) scale(1.2); }
    100% { transform: rotate(45deg) scale(1); }
}

.checkbox-text {
    color: #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Checkbox de términos */
.terms-label {
    background: rgba(102, 126, 234, 0.05);
    border-color: rgba(102, 126, 234, 0.1);
}

.terms-label .checkbox-text a {
    color: #667eea;
    text-decoration: none;
}

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

/* ===========================================
   BOTONES DE ACCIÓN
   =========================================== */
.form-actions {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.btn-submit,
.btn-whatsapp {
    flex: 1;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.4);
}

.btn-whatsapp {
    background: #25d366;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.3);
}

.btn-whatsapp:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(37, 211, 102, 0.4);
}

/* Estado de carga */
.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ===========================================
   MENSAJES DE ERROR
   =========================================== */
.error-message {
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 0.75rem;
    color: #ef4444;
    display: none;
    white-space: nowrap;
    z-index: 1;
}

.error-message.active {
    display: block;
}

/* Error específico para el grupo de WhatsApp */
.form-group:has(.whatsapp-input-group) {
    position: relative;
    padding-bottom: 24px; /* Espacio para el mensaje de error */
}

.form-group:has(.whatsapp-input-group) .error-message {
    bottom: 0;
}

/* Ajuste para otros campos */
.form-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 80px; /* Altura mínima para evitar saltos */
}

.form-control.error {
    border-color: #ef4444;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* ===========================================
   INFORMACIÓN DE CONTACTO
   =========================================== */
.contact-info-container {
    position: sticky;
    top: 100px;
}

.info-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.info-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
}

.info-card > p {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 32px;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Items de información */
.info-items {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.info-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(8px);
}

.info-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-icon svg {
    color: #ffffff;
}

.info-content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.info-content p {
    color: #e2e8f0;
    font-size: 1rem;
}

.availability,
.response-time {
    font-size: 0.875rem;
    color: #64748b;
}

.whatsapp-item {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(37, 211, 102, 0.05) 100%);
    border-color: rgba(37, 211, 102, 0.2);
}

.whatsapp-item .info-icon {
    background: #25d366;
}

.whatsapp-link {
    display: inline-block;
    margin-top: 8px;
    color: #25d366;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.whatsapp-link:hover {
    transform: translateX(4px);
}

/* ===========================================
   REDES SOCIALES
   =========================================== */
.social-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 16px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-link {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    transition: all 0.3s;
}

.social-link:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: #ffffff;
    transform: translateY(-4px);
}

/* ===========================================
   EFECTOS DE FONDO
   =========================================== */
.contact-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.grid-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.5;
}

.gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #667eea 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation: blob-float 20s ease-in-out infinite;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #764ba2 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    animation: blob-float 20s ease-in-out infinite 10s;
}

@keyframes blob-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ===========================================
   MODALES
   =========================================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    animation: modal-appear 0.3s ease-out;
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: #94a3b8;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    transform: rotate(90deg);
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
}

.modal-icon svg {
    width: 100%;
    height: 100%;
}

/* Checkmark animation */
.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #22c55e;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #22c55e;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.modal-content h3 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
}

.modal-message {
    color: #94a3b8;
    line-height: 1.6;
    margin-bottom: 32px;
}

.modal .primary-btn {
    padding: 14px 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.modal .primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

/* Error modal */
.error-modal .modal-icon svg {
    stroke: #ef4444;
}

.error-modal .modal-icon path {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 968px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .contact-info-container {
        position: static;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    #contact {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .contact-form-container,
    .info-card {
        padding: 24px;
    }
    
    .info-item {
        padding: 16px;
    }
    
    .info-icon {
        width: 40px;
        height: 40px;
    }
    
    .whatsapp-input-group {
        flex-direction: column;
    }
    
    .country-select {
        width: 100%;
    }
    
    .modal-content {
        padding: 32px 24px;
    }
}