/* Estilos para el formulario de contacto UDLA */
input[type=date], input[type=email], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=url], select, textarea {
    border-radius: 16px !important;
}

.contact-form-grid {
    background-color: #ffffff;
    border: 2px solid #bb5420;
    border-radius: 12px;
    padding: 30px;
    margin: 0 auto;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
    align-items: end;
}

.form-row:last-of-type {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.form-group p {
    margin-bottom: 0;
}

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

.form-group label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 5px;
}


.nationality-group .radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.nationality-group .radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    margin: 0;
}

.nationality-group .radio-group input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.nationality-group .radio-group input[type="radio"]:checked::after{
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    border: 2px solid #ff6b35;
    border-radius: 50%;
    background-color: #fff;
}
/* Estilos para radio buttons con error */
.nationality-group .radio-group.wpcf7-not-valid {
    padding: 8px;
    border-radius: 4px;
    background-color: rgba(220, 53, 69, 0.05);
}

/* Mensajes de error para radio buttons */
.nationality-group .wpcf7-not-valid-tip {
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    max-width: none;
}

/* Mensajes de error para el campo de nacionalidad texto */
#nacionalidad-texto + .wpcf7-not-valid-tip {
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    max-width: none;
    font-size: 10px;
    color: #dc3545;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    position: absolute;
    z-index: 10;
}

/* Estilos para el grupo RUT */
.rut-group {
    margin-top: 10px;
}
.nationality-group p span .wpcf7-not-valid-tip {
    top: calc(100% + 10px);
}


.form-control {
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #333;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.form-control::placeholder {
    color: #6c757d;
    opacity: 0.7;
}

.form-control:hover {
    border-color: #007cba;
    transition: all 0.3s ease;
}

/* Estilos específicos para select */
.form-control[data-type="select"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}



/* Estilos para textarea */
.form-control[data-type="textarea"] {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}



/* Botón de envío */
.form-submit {
    text-align: left;
    margin-top: 30px;
}
.form-submit .wpcf7-submit {
    background: linear-gradient(90deg,rgba(204, 88, 21, 1) 0%, rgba(140, 52, 29, 1) 100%, rgba(7, 7, 7, 1) 100%, rgba(5, 8, 7, 1) 100%);
    border-radius: 30px;
    color: #fff;
}
.form-submit .wpcf7-submit:hover {
    background: linear-gradient(90deg,rgba(204, 88, 21, 1) 0%, rgba(140, 52, 29, 1) 100%, rgba(7, 7, 7, 1) 100%, rgba(5, 8, 7, 1) 100%);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    text-align: center;
}

.btn-primary {
    background-color: #ff5200;
    color: #ffffff;
    border: none;
    font-weight: 600;
    font-size: 16px;
    padding: 14px 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    text-align: center;
    width: auto;
    display: inline-block;
}

.btn-primary:hover {
    background-color: #9f3200;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 124, 186, 0.3);
}

/* Estados de validación */
.form-control.wpcf7-not-valid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-control.wpcf7-not-valid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.wpcf7-not-valid-tip {
    color: #dc3545;
    font-size: 10px;
    margin-top: 5px;
    font-weight: 500;
    position: absolute;
    left: 0;
    z-index: 10;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    max-width: 200px;
}

/* Contenedor para mensajes de error */
.form-group {
    position: relative;
    margin-bottom: 25px; /* Espacio fijo para mensajes de error */
}

/* Ajustar espaciado cuando hay errores */
.form-group.has-error {
    margin-bottom: 30px;
}

/* Mensajes de respuesta del formulario */
.wpcf7-response-output {
    margin-top: 20px !important;
    margin-bottom: 0 !important;
    padding: 16px !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    border: none !important;
    position: relative;
    z-index: 5;
}

/* Asegurar que los mensajes no afecten el layout */
.wpcf7-response-output.wpcf7-validation-errors,
.wpcf7-response-output.wpcf7-mail-sent-ng,
.wpcf7-response-output.wpcf7-spam-blocked {
    position: relative;
    margin-top: 20px !important;
    margin-bottom: 0 !important;
}

/* Mantener el grid estable */
.contact-form-grid {
    position: relative;
    overflow: visible;
}

.form-row {
    position: relative;
    overflow: visible;
}

/* Mensajes de respuesta */
.form-messages {
    margin-top: 20px;
}

.wpcf7-response-output {
    padding: 16px;
    border-radius: 8px;
    font-weight: 500;
    margin: 0;
    border: none;
}

.wpcf7-response-output.wpcf7-mail-sent-ok {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.wpcf7-response-output.wpcf7-validation-errors {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.wpcf7-response-output.wpcf7-mail-sent-ng {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.wpcf7-response-output.wpcf7-spam-blocked {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* Loading state */
.wpcf7-spinner {
    margin-left: 10px;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.nationality-group .radio-group p {
    margin-bottom: 0;
}
.radio-group .wpcf7-list-item:first-child {
    margin-left: 0;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 1024px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .form-group.full-width {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .contact-form-grid {
        padding: 20px;
        margin: 10px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-group.full-width {
        grid-column: 1;
    }
    
    .nationality-group .radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .rut-group {
        margin-top: 8px;
    }
    
    .form-control {
        padding: 10px 14px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 16px;
        width: 100%;
    }
    
    /* Ajustes para errores en móvil */
    .wpcf7-not-valid-tip {
        position: static;
        margin-top: 5px;
        max-width: none;
        width: 100%;
        box-sizing: border-box;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group.has-error {
        margin-bottom: 25px;
    }
}

/* Estilos adicionales para mejor UX */
.form-group:focus-within label {
    color: #007cba;
}

/* Animación de entrada */
.contact-form-grid {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para campos requeridos */
.form-group label[for*="required"]::after {
    content: " *";
    color: #dc3545;
}

/* Mejoras de accesibilidad */
.form-control:focus-visible {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Estilos para campos deshabilitados */
.form-control:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

/* Estilos específicos para el campo de nacionalidad deshabilitado */
.form-control.disabled-field {
    background-color: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
    opacity: 0.7;
}

.form-control.disabled-field:focus {
    border-color: #dee2e6;
    box-shadow: none;
}
