/**
 * Estilos personalizados para Contact Form 7
 * Diseño moderno y elegante con Tailwind CSS
 */

/* Contenedor del formulario */
.contact-form-wrapper .wpcf7 {
    position: relative;
}

/* Campos de formulario */
.contact-form-wrapper .wpcf7-form-control-wrap {
    display: block;
    position: relative;
}

.contact-form-wrapper input[type="text"],
.contact-form-wrapper input[type="email"],
.contact-form-wrapper input[type="tel"],
.contact-form-wrapper input[type="url"],
.contact-form-wrapper textarea,
.contact-form-wrapper select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #1f2937;
    background-color: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    transition: all 0.2s ease-in-out;
    outline: none;
    font-family: inherit;
}

.contact-form-wrapper input[type="text"]:focus,
.contact-form-wrapper input[type="email"]:focus,
.contact-form-wrapper input[type="tel"]:focus,
.contact-form-wrapper input[type="url"]:focus,
.contact-form-wrapper textarea:focus,
.contact-form-wrapper select:focus {
    background-color: #ffffff;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
    transform: translateY(-1px);
}

.contact-form-wrapper input[type="text"]:hover,
.contact-form-wrapper input[type="email"]:hover,
.contact-form-wrapper input[type="tel"]:hover,
.contact-form-wrapper input[type="url"]:hover,
.contact-form-wrapper textarea:hover,
.contact-form-wrapper select:hover {
    border-color: #cbd5e1;
}

/* Placeholder */
.contact-form-wrapper input::placeholder,
.contact-form-wrapper textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Textarea específico */
.contact-form-wrapper textarea {
    min-height: 150px;
    resize: vertical;
}

/* Labels */
.contact-form-wrapper label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.025em;
}

/* Párrafos del formulario */
.contact-form-wrapper .wpcf7-form p {
    margin-bottom: 1.5rem;
}

.contact-form-wrapper .wpcf7-form p:last-of-type {
    margin-bottom: 0;
}

/* Botón de envío */
.contact-form-wrapper input[type="submit"],
.contact-form-wrapper button[type="submit"] {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #ffffff;
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3), 0 2px 4px -1px rgba(14, 165, 233, 0.2);
    position: relative;
    overflow: hidden;
}

.contact-form-wrapper input[type="submit"]:hover,
.contact-form-wrapper button[type="submit"]:hover {
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
    box-shadow: 0 10px 15px -3px rgba(14, 165, 233, 0.4), 0 4px 6px -2px rgba(14, 165, 233, 0.3);
    transform: translateY(-2px);
}

.contact-form-wrapper input[type="submit"]:active,
.contact-form-wrapper button[type="submit"]:active {
    transform: translateY(0);
    box-shadow: 0 4px 6px -1px rgba(14, 165, 233, 0.3), 0 2px 4px -1px rgba(14, 165, 233, 0.2);
}

.contact-form-wrapper input[type="submit"]:disabled,
.contact-form-wrapper button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Efecto de onda en el botón */
.contact-form-wrapper input[type="submit"]::before,
.contact-form-wrapper button[type="submit"]::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.contact-form-wrapper input[type="submit"]:hover::before,
.contact-form-wrapper button[type="submit"]:hover::before {
    width: 300px;
    height: 300px;
}

/* Mensajes de validación */
.contact-form-wrapper .wpcf7-not-valid-tip {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #ef4444;
    font-weight: 500;
}

.contact-form-wrapper .wpcf7-form-control.wpcf7-not-valid {
    border-color: #ef4444 !important;
    background-color: #fef2f2;
}

.contact-form-wrapper .wpcf7-form-control.wpcf7-not-valid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Mensaje de respuesta */
.contact-form-wrapper .wpcf7-response-output {
    margin: 1.5rem 0 0;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: 2px solid;
}

.contact-form-wrapper .wpcf7-mail-sent-ok {
    color: #065f46;
    background-color: #d1fae5;
    border-color: #10b981;
}

.contact-form-wrapper .wpcf7-mail-sent-ng,
.contact-form-wrapper .wpcf7-validation-errors {
    color: #991b1b;
    background-color: #fee2e2;
    border-color: #ef4444;
}

.contact-form-wrapper .wpcf7-spam-blocked {
    color: #92400e;
    background-color: #fef3c7;
    border-color: #f59e0b;
}

/* Spinner de carga */
.contact-form-wrapper .wpcf7-spinner {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: wpcf7-spin 0.8s linear infinite;
}

@keyframes wpcf7-spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Checkbox y Radio buttons */
.contact-form-wrapper input[type="checkbox"],
.contact-form-wrapper input[type="radio"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    border: 2px solid #d1d5db;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-form-wrapper input[type="radio"] {
    border-radius: 50%;
}

.contact-form-wrapper input[type="checkbox"]:checked,
.contact-form-wrapper input[type="radio"]:checked {
    background-color: #0ea5e9;
    border-color: #0ea5e9;
}

.contact-form-wrapper .wpcf7-list-item {
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
}

.contact-form-wrapper .wpcf7-list-item-label {
    margin: 0;
    font-weight: 400;
    color: #4b5563;
    cursor: pointer;
}

/* File upload */
.contact-form-wrapper input[type="file"] {
    padding: 0.75rem;
    font-size: 0.875rem;
}

.contact-form-wrapper input[type="file"]::file-selector-button {
    padding: 0.5rem 1rem;
    margin-right: 1rem;
    font-weight: 600;
    color: #0ea5e9;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-form-wrapper input[type="file"]::file-selector-button:hover {
    background-color: #e0f2fe;
    border-color: #7dd3fc;
}

/* Animación de entrada */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-form-wrapper .wpcf7-form {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive */
@media (max-width: 640px) {
    .contact-form-wrapper input[type="text"],
    .contact-form-wrapper input[type="email"],
    .contact-form-wrapper input[type="tel"],
    .contact-form-wrapper input[type="url"],
    .contact-form-wrapper textarea,
    .contact-form-wrapper select {
        font-size: 16px; /* Evita zoom en iOS */
    }
}

/* Accesibilidad */
.contact-form-wrapper input:focus-visible,
.contact-form-wrapper textarea:focus-visible,
.contact-form-wrapper select:focus-visible,
.contact-form-wrapper button:focus-visible {
    outline: 2px solid #0ea5e9;
    outline-offset: 2px;
}

/* Estados de error mejorados */
.contact-form-wrapper .wpcf7-form.invalid .wpcf7-response-output {
    animation: shake 0.5s ease-in-out;
}

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

/* Animación para campos con error */
.contact-form-wrapper .wpcf7-not-valid {
    animation: errorPulse 0.5s ease-in-out;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}
